Linux中fdisk硬盤分區(qū)方法
本例中我們會(huì)添加兩個(gè)200M的主分區(qū),其它為擴(kuò)展分區(qū),在擴(kuò)展分區(qū)中我們添加兩個(gè)200M大小的邏輯分區(qū)
Command (m for help): p 注:列出分區(qū)表;
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System
Command (m for help): n 注:添加分區(qū);
Command action
e extended
p primary partition (1-4)
p 注:添加主分區(qū);
Partition number (1-4): 1 注:添加主分區(qū)1;
First cylinder (1-125, default 1): 注:直接回車,主分區(qū)1的起始位置;默認(rèn)為1,默認(rèn)就好;
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-125, default 125): +200M 注:指定分區(qū)大小,用+200M來指定大小為200M
Command (m for help): n 注:添加新分區(qū);
Command action
e extended
p primary partition (1-4)
p 注:添加主分區(qū)
Partition number (1-4): 2 注:添加主分區(qū)2;
First cylinder (26-125, default 26):
Using default value 26
Last cylinder or +size or +sizeM or +sizeK (26-125, default 125): +200M 注:指定分區(qū)大小,用+200M來指定大小為200M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
e 注:添加擴(kuò)展分區(qū);
Partition number (1-4): 3 注:指定為3 ,因?yàn)橹鞣謪^(qū)已經(jīng)分了兩個(gè)了,這個(gè)也算主分區(qū),從3開始;
First cylinder (51-125, default 51): 注:直接回車;
Using default value 51
Last cylinder or +size or +sizeM or +sizeK (51-125, default 125): 注:直接回車,把其余的所有空間都給擴(kuò)展分區(qū);
Using default value 125
Command (m for help): p
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ 83 Linux
/dev/sda2 26 50 201600 83 Linux
/dev/sda3 51 125 604800 5 Extended
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l 注:添加邏輯分區(qū);
First cylinder (51-125, default 51):
Using default value 51
Last cylinder or +size or +sizeM or +sizeK (51-125, default 125): +200M 注:添加一個(gè)大小為200M大小的分區(qū);
Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
l 注:添加一個(gè)邏輯分區(qū);
First cylinder (76-125, default 76):
Using default value 76
Last cylinder or +size or +sizeM or +sizeK (76-125, default 125): +200M 注:添加一個(gè)大小為200M大小的分區(qū);
Command (m for help): p 列出分區(qū)表;
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ 83 Linux
/dev/sda2 26 50 201600 83 Linux
/dev/sda3 51 125 604800 5 Extended
/dev/sda5 51 75 201568+ 83 Linux
/dev/sda6 76 100 201568+ 83 Linux
然后我們根據(jù)前面所說通過t指令來改變分區(qū)類型;
最后不要忘記w保存退出
五、對分區(qū)進(jìn)行格式化,以及加載
先提示一下;用 mkfs.bfs mkfs.ext2 mkfs.jfs mkfs.msdos mkfs.vfatmkfs.cramfs mkfs.ext3 mkfs.minix mkfs.reiserfs mkfs.xfs 等命令來格式化分區(qū),比如我想格式化 sda6為ext3文件系統(tǒng),則輸入;
[root@localhost beinan]# mkfs.ext3 /dev/sda6
如果我想加載 sda6到目前系統(tǒng)來存取文件,應(yīng)該有mount 命令,但首先您得建一個(gè)掛載目錄;比如 /mnt/sda6 ;
[root@localhost beinan]# mkdir /mnt/sda6
[root@localhost beinan]# mount /dev/sda6 /mnt/sda6
[root@localhost beinan]# df -lh
Filesystem 容量 已用 可用 已用% 掛載點(diǎn)
/dev/hda8 11G 8.4G 2.0G 81% /
/dev/shm 236M 0 236M 0% /dev/shm
/dev/hda10 16G 6.9G 8.3G 46% /mnt/hda10
/dev/sda6 191M 5.6M 176M 4% /mnt/sda6
這樣我們就能進(jìn)入 /mnt/sda6目錄,然后存取文件了
具體的權(quán)限方法,以及mount 更詳細(xì)的用法,在以后我會(huì)專門寫一個(gè)帖子;在一帖中放下所有的內(nèi)容實(shí)在有點(diǎn)為難。
linux操作系統(tǒng)文章專題:linux操作系統(tǒng)詳解(linux不再難懂)linux相關(guān)文章:linux教程
評(píng)論