fdisk命令用于观察硬盘实体使用情况,也可对硬盘分区。
[root@xuliangwei ~]# fdisk /dev/sdb Command (m for help): m #输入m列出常用的命令 Command action a toggle a bootable flag #切换分区启动标记 b edit bsd disklabel #编辑sdb磁盘标签 c toggle the dos compatibility flag #切换dos兼容模式 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 #创建新的Sun磁盘标签 t change a partitions system id #修改分区ID,可以通过l查看id u change display/entry units #修改容量单位,磁柱或扇区 v verify the partition table #检验分区表 w write table to disk and exit #保存退出 x extra functionality (experts only) #拓展功能