格式化硬盘命令linux 格式化硬盘 linux( 七 )


Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device BootStartEndBlocksIdSystem
/dev/sdb120481044475120083Linux
/dev/sdb21044482068475120083Linux
/dev/sdb32068483092475120083Linux
/dev/sdb430924830929825+83Linux
#已经建好四个主分区啦 , 现在我们来看看如果再建主分区或是扩展分区的话会出现怎样的情况:
Command (m for help): n
You must delete some partition and add an extended partition first
#看到了吧,不能再建分区啦!要再建分区的话必须删除some分区,再新建一个扩展分区才行 。
#现在 , 我们删掉一个主分区,来新建扩展分区
Command (m for help): d#删除分区
Partition number (1-4): 4#选择要删除分区的分区号,我们选第四个
Command (m for help): p#打印,如下,四个分区变成了三个!
Disk /dev/sdb: 254 MB, 254017536 bytes
8 heads, 61 sectors/track, 1016 cylinders, total 496128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device BootStartEndBlocksIdSystem
/dev/sdb120481044475120083Linux
/dev/sdb21044482068475120083Linux
/dev/sdb32068483092475120083Linux
#新建一个扩展分区
#如果在没有建满三个主分的区的情况下建立扩展分区,相关选项会有些不同 。
Command (m for help): n
Command action
eextended
pprimary partition (1-4)
e
Selected partition 4
First sector (309248-496127, default 309248): #enter,默认
Using default value 309248
Last sector, +sectors or +size{K,M,G} (309248-496127, default 496127):#enter,默认,使用剩余空间
Using default value 496127
Command (m for help): p
Disk /dev/sdb: 254 MB, 254017536 bytes
8 heads, 61 sectors/track, 1016 cylinders, total 496128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device BootStartEndBlocksIdSystem
/dev/sdb120481044475120083Linux
/dev/sdb21044482068475120083Linux
/dev/sdb32068483092475120083Linux
/dev/sdb4309248496127934405Extended
#接下来 , 我们在新建的扩展分区里再新建两个逻辑分区,因为已经有了三个主分区,这里不会再显示是建立逻辑分区还是主分区的提示!
Command (m for help): n
First sector (311296-496127, default 311296):#enter
Using default value 311296
Last sector, +sectors or +size{K,M,G} (311296-496127, default 496127): +50M
Command (m for help): n
First sector (415744-496127, default 415744):#enter
Using default value 415744
Last sector, +sectors or +size{K,M,G} (415744-496127, default 496127):#enter
Using default value 496127
Command (m for help): p
Disk /dev/sdb: 254 MB, 254017536 bytes
8 heads, 61 sectors/track, 1016 cylinders, total 496128 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device BootStartEndBlocksIdSystem
/dev/sdb120481044475120083Linux
/dev/sdb21044482068475120083Linux
/dev/sdb32068483092475120083Linux
/dev/sdb4309248496127934405Extended
/dev/sdb53112964136955120083Linux
/dev/sdb64157444961274019283Linux
#上面的列表,就是我们今天分区的成果啦!接下来保存退出 , 重启计算机,就可以进行下一步的mkfs操作啦!如果忘记了相关的操作命令,记得按m!!!

推荐阅读