Linux系统学习第三章:磁盘与文件系统管理(三)硬盘分区、格式化、检验与挂载
2012-12-04 10:42
861 查看
新增一块硬盘时,我们应该有的操作
(1)对硬盘进行分区,以新建可用的分区
(2)对硬盘进行格式化,以创建可用的文件系统
(3)对新建的文件系统进行检验
(4)创建挂载点,将它挂载上来
一、磁盘分区命令fdisk
1、查看系统所有能够找到的设备的分区:fdisk -l
看第一行:Disk /dev/sda:32.2GB,没有其他的disk,说明,这个系统只有一块硬盘,大小为32.2GB
每个设备对应着七列内容:
Device:代表设备对应的文件名
Boot:是否为开机引导模块
Start:该设备(分区)所在的柱面的开始号码
End:该设备所在的柱面的结束号码
Blocks:该分区的容量
System:所用的文件系统(只是参考)
2、分区操作
fdisk 设备名称
输入以上命令后,会让你输入一些其他的参数,这些参数代表着不同的含义:
(1)p 打印当前系统分区表
(2)m 调出参数命令菜单(相当于 --help)
(3)n 新建一个分区
(4)d 删除一个分区
(5)q 离开fdisk命令,不保存
(6)w 把操作后的结果写入分区表并离开
二、磁盘格式化
mkfs -t 文件系统类型 设备名
如:mkfs -t ext3 /dev/sda6
三、磁盘检验
fsck [-atCfD] 设备名称
-a 自动修复检查到的有问题的扇区
-t 指定文件系统(一般能自动识别)
-C 显示检验过程的进度
-f 强制检验
-D 针对 文件系统下的目录进行优化配置
四、磁盘挂载与卸载 :mount、umount
(1)mount 设备名 挂载目录
如:mount /dev/sda6 /home/web
(2)umount 设备名
(1)对硬盘进行分区,以新建可用的分区
(2)对硬盘进行格式化,以创建可用的文件系统
(3)对新建的文件系统进行检验
(4)创建挂载点,将它挂载上来
一、磁盘分区命令fdisk
1、查看系统所有能够找到的设备的分区:fdisk -l
[root@localhost ~]# fdisk -l Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1288 10241437+ 83 Linux /dev/sda3 1289 1925 5116702+ 83 Linux /dev/sda4 1926 3916 15992707+ 5 Extended /dev/sda5 1926 2052 1020096 82 Linux swap / Solaris
看第一行:Disk /dev/sda:32.2GB,没有其他的disk,说明,这个系统只有一块硬盘,大小为32.2GB
每个设备对应着七列内容:
Device:代表设备对应的文件名
Boot:是否为开机引导模块
Start:该设备(分区)所在的柱面的开始号码
End:该设备所在的柱面的结束号码
Blocks:该分区的容量
System:所用的文件系统(只是参考)
2、分区操作
fdisk 设备名称
输入以上命令后,会让你输入一些其他的参数,这些参数代表着不同的含义:
(1)p 打印当前系统分区表
[root@localhost ~]# fdisk /dev/sda The number of cylinders for this disk is set to 3916. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1288 10241437+ 83 Linux /dev/sda3 1289 1925 5116702+ 83 Linux /dev/sda4 1926 3916 15992707+ 5 Extended /dev/sda5 1926 2052 1020096 82 Linux swap / Solaris
(2)m 调出参数命令菜单(相当于 --help)
Command (m for help): m Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition l list known partition types m print this menu n add a new partition o create a new empty DOS partition table p print the partition table q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit x extra functionality (experts only)
(3)n 新建一个分区
Command (m for help): n First cylinder (2053-3916, default 2053): 3500 Last cylinder or +size or +sizeM or +sizeK (3500-3916, default 3916): +100M Command (m for help): p Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1288 10241437+ 83 Linux /dev/sda3 1289 1925 5116702+ 83 Linux /dev/sda4 1926 3916 15992707+ 5 Extended /dev/sda5 1926 2052 1020096 82 Linux swap / Solaris /dev/sda6 3500 3512 104422+ 83 Linux
(4)d 删除一个分区
Command (m for help): d Partition number (1-6): 6 Command (m for help): p Disk /dev/sda: 32.2 GB, 32212254720 bytes 255 heads, 63 sectors/track, 3916 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 1288 10241437+ 83 Linux /dev/sda3 1289 1925 5116702+ 83 Linux /dev/sda4 1926 3916 15992707+ 5 Extended /dev/sda5 1926 2052 1020096 82 Linux swap / Solaris
(5)q 离开fdisk命令,不保存
(6)w 把操作后的结果写入分区表并离开
二、磁盘格式化
mkfs -t 文件系统类型 设备名
如:mkfs -t ext3 /dev/sda6
三、磁盘检验
fsck [-atCfD] 设备名称
-a 自动修复检查到的有问题的扇区
-t 指定文件系统(一般能自动识别)
-C 显示检验过程的进度
-f 强制检验
-D 针对 文件系统下的目录进行优化配置
四、磁盘挂载与卸载 :mount、umount
(1)mount 设备名 挂载目录
如:mount /dev/sda6 /home/web
(2)umount 设备名
相关文章推荐
- chapter8:Linux磁盘与文件系统管理之(3)磁盘的分区,格式化,检验与挂载
- Linux系统学习第三章:磁盘与文件系统管理(一)磁盘分区
- Linux系统学习第三章:磁盘与文件系统管理(二)文件系统管理
- Linux学习-磁盘的分区、格式化、检验与挂载
- Linux学习命令汇总六——磁盘分区,磁盘挂载,文件系统管理,压缩及归档命令
- linux 磁盘管理三部曲——(2)管理分区,文件系统类型格式化
- Linux学习之CentOS(十二)------磁盘管理之 磁盘的分区、格式化、挂载(转)
- Linux菜鸟笔记——磁盘管理与文件系统管理 之 磁盘的分割、格式化、检验
- 磁盘及文件系统管理(分区,挂载,卸载,信息展示与统计)
- 掌握管理Linux磁盘和分区的方法 创建并挂载文件系统以及 创建并管理LVM
- Linux磁盘和文件系统管理(1)_分区 格式化
- 管理磁盘及分区 创建文件系统 挂载,卸载
- linux 磁盘管理四部曲——(2)管理分区,文件系统类型格式化
- Linux磁盘与文件系统管理学习笔记
- Linux学习--第二天--分区、格式化、系统安装、vmware、远程管理工具
- linux服务器 磁盘和文件系统管理(一)管理磁盘及分区
- linux系统的磁盘添加分区格式化与分区挂载
- Ubuntu操作系统学习笔记之文件系统挂载管理
- Linux入门之磁盘管理(3)文件系统挂载
- 开机挂载 -- 第8章 Linux 磁盘与文件系统管理