fdisk选中/dev/sdb 输入m所有基本选项都出现,输入n新建分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
有扩展分区和主分区,逻辑分区在扩展分区中建立。注意到括号中的1-4,最多只能建四个主分区(包括扩展分区)。先建一个主分区:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p #建主分区
Partition number (1-4): 1 #分区号为1
First cylinder (1-2610, default 1): #直接回车默认从第一个柱面开始划分
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-2610, default 2610): +2G #加空间大小,这里有很多种选择:+后面单位可以接M,G,K(记得要大写)表示划分你所加的空间,也可以是柱面数。不管怎样都不能超过该磁盘剩余的空间否则无效。
Command (m for help): p #分好后查看分区信息,刚所做的所有一目了然。
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfaa2aa49
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
同上所述建立扩展分区:
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e #建立扩展分区
Partition number (1-4): 4
First cylinder (263-2610, default 263):
Using default value 263
Last cylinder, +cylinders or +size{K,M,G} (263-2610, default 2610): +4G
Command (m for help): p
Disk /dev/sdb: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfaa2aa49
Device Boot Start End Blocks Id System
/dev/sdb1 1 262 2104483+ 83 Linux
/dev/sdb4 263 785 4200997+ 5 Extended