規(guī)劃硬盤中的分區(qū)——fdisk
fdisk [磁盤設(shè)備]
使用此命令可進(jìn)入交互操縱,您可以在下面的交互操縱里面胡作非為,但是切記離開時(shí)必須按q命令,不能按w
#找出系統(tǒng)中所在根目錄所在磁盤,并查閱該硬盤內(nèi)的相關(guān)信息
[root@localhost ~]# df / <==重點(diǎn)找出磁盤文件名而已 文件系統(tǒng) 1K-塊 已用 可用 已用% 掛載點(diǎn) /dev/hda2 9920624 2968604 6439952 32% / [root@localhost ~]# fdisk /dev/hda ==>進(jìn)入交互操縱模式,注意這里不要寫具體的數(shù)字 The number of cylinders for this disk is set to 2610. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): m <==等待輸入,m是命令菜單 Command action a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition ==>刪除一個(gè)分區(qū) l list known partition types ==>創(chuàng)建邏輯分區(qū) m print this menu n add a new partition ==>增加一個(gè)分區(qū) o create a new empty DOS partition table p print the partition table ==>在屏幕上顯示分區(qū)表 q quit without saving changes ==>不存儲(chǔ),直接離開fdisk程序 s create a new empty Sun disklabel t change a partition's system id 變更分區(qū)類型 u change display/entry units v verify the partition table w write table to disk and exit ==>將剛才的操作寫入分區(qū)表,慎重操作 x extra functionality (experts only)
常見操作有:創(chuàng)建主分區(qū)、創(chuàng)建擴(kuò)展分區(qū)(將硬盤的所有剩余空間作為擴(kuò)展分區(qū))、創(chuàng)建邏輯分區(qū)、改變分區(qū)的系統(tǒng)代碼、保存分區(qū)表信息、用partprobe探測(cè)硬盤分區(qū)變化
下面舉出幾例做測(cè)試,離開時(shí)不保存:
Command (m for help): p ==>查看磁盤分區(qū)表,和終端命令模式下的fdisk -l 作用相同 Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 1288 10241437+ 83 Linux /dev/hda3 1289 1925 5116702+ 83 Linux /dev/hda4 1926 2610 5502262+ 5 Extended /dev/hda5 1926 1989 514048+ 82 Linux swap / Solaris Command (m for help): d Partition number (1-5): 4 ==>刪除第4個(gè)分區(qū) Command (m for help): d ==>刪除第3個(gè)分區(qū) Partition number (1-4): 3 Command (m for help): p ==>再次顯示時(shí)觀察下面只顯示了前兩個(gè)分區(qū),第5個(gè)沒顯示 Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 1288 10241437+ 83 Linux Command (m for help): n ==>創(chuàng)建一個(gè)分區(qū) Command action e extended p primary partition (1-4) p ==>選擇創(chuàng)建的分區(qū)類型為主分區(qū) Partition number (1-4): 4 ==>選擇4號(hào)做主分區(qū) First cylinder (1289-2610, default 1289): Using default value 1289 ==>起始柱面若直接按enter鍵就是使用默認(rèn)值 Last cylinder or +size or +sizeM or +sizeK (1289-2610, default 2610): +512M Command (m for help): p ==>再次查看分區(qū)表,發(fā)現(xiàn)多了一個(gè)剛從建立的分區(qū)4 Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 1288 10241437+ 83 Linux /dev/hda4 1289 1351 506047+ 83 Linux Command (m for help): n ==>再建一個(gè)分區(qū) Command action e extended p primary partition (1-4) e ==>建立擴(kuò)展分區(qū) Selected partition 3 ==>這個(gè)是系統(tǒng)主動(dòng)選擇的分區(qū) First cylinder (1352-2610, default 1352): Using default value 1352 Last cylinder or +size or +sizeM or +sizeK (1352-2610, default 2610): Using default value 2610 Command (m for help): p Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 1288 10241437+ 83 Linux /dev/hda3 1352 2610 10112917+ 5 Extended ==>看,剛新建的擴(kuò)展分區(qū) /dev/hda4 1289 1351 506047+ 83 Linux Partition table entries are not in disk order Command (m for help): n ==>再多建幾個(gè)分區(qū)玩玩,反正后面不保存就行了,,呵呵 First cylinder (1352-2610, default 1352): Using default value 1352 Last cylinder or +size or +sizeM or +sizeK (1352-2610, default 2610): +2084 Value out of range. Last cylinder or +size or +sizeM or +sizeK (1352-2610, default 2610): +2084M Command (m for help): n ==>有沒有發(fā)現(xiàn),最后建立2個(gè)分區(qū)的時(shí)候根本沒有詢問我們要建立是主分區(qū)還是擴(kuò)展分區(qū),為啥?因?yàn)榉謪^(qū)已經(jīng)超過4了,您別無選擇,只能是擴(kuò)展分區(qū)了。。。 First cylinder (1606-2610, default 1606): Using default value 1606 Last cylinder or +size or +sizeM or +sizeK (1606-2610, default 2610): Using default value 2610 Command (m for help): p Disk /dev/hda: 21.4 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 13 104391 83 Linux /dev/hda2 14 1288 10241437+ 83 Linux /dev/hda3 1352 2610 10112917+ 5 Extended /dev/hda4 1289 1351 506047+ 83 Linux /dev/hda5 1352 1605 2040223+ 83 Linux ==>這是后面又新建的2個(gè)分區(qū) /dev/hda6 1606 2610 8072631 83 Linux Partition table entries are not in disk order Command (m for help): q ==>這里一定要按q啊,因?yàn)槲覄偛艃H僅是演示操作,還破壞性的刪除了2個(gè)分區(qū),你要是真要分區(qū),那就要按w保存了。 [root@localhost ~]#
2015職稱計(jì)算機(jī)考試書PowerPoint2007中 .. 定價(jià):¥45 優(yōu)惠價(jià):¥42 更多書籍 | |
2015年全國(guó)職稱計(jì)算機(jī)考試教材(2007模 .. 定價(jià):¥225 優(yōu)惠價(jià):¥213 更多書籍 |