[[email protected] ~]# fdisk /dev/sdb
…省略部分輸出…
Command (m for help): n
#建立新分割區
Command action
l logical (5 or over)
#由於在前面章節中,擴充套件分割區已經建立,所以這裡變成了l(logic)
p primary partition (1-4)
l
#建立邏輯分割區
First cylinder (655-2610, default 655):
#不用指定分割區號,預設會從5開始分配,所以直接選擇起始柱面
#注意:邏輯分割區是在擴充套件分割區內部再劃分的,所以柱面是和擴充套件分割區重疊的
Using default value 655
Last cylinder, +cylinders or +size{K, M, G} (655-2610, default 2610):+2G
#分配2GB大小
Command (m for help): n
#再建立一個邏輯分割區
Command action
l logical (5 or over)
p primary partition (1-4)
l
First cylinder (917-2610, default 917):
Using default value 917
Last cylinder, +cylinders or +size{K, M, G} (917-2610, default 2610):+2G
Command (m for help): p
#檢視一下已經建立的分割區
Disk /dev/sdb: 21.5GB, 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: 0xb4b0720c
Device Boot Start End Blocks id System
/dev/sdb1 1 654
5253223+ 83 Linux
#主分割區
/dev/sdb2 655 2610 15711570
5 Extended
#擴充套件分割區
/dev/sdb5 655 916
2104483+ 83 Linux
#邏輯分割區 1
/dev/sdb6 917 1178
2104483+ 83 Linux
#邏輯分割區2
Command (m for help): w
#儲存並退出
The partition table has been altered!
Calling ioctl。to re-read partition table.
Syncing disks.
[[email protected] -]#
#退回到提示符介面
Command (m for help): w
#儲存並退出
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16:
Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
#要求重新啟動,才能格式化
Syncing disks.
[[email protected] ~]# partprobe
如果這個命令不存在,則請安裝 parted-2.1-18.el6.i686 這個軟體包。partprobe 命令不是必需的,如果沒有提示重新啟動系統,則直接格式化即可。