[root@Centos ~]# fdisk /dev/sda#fdisk的參數(shù)是設(shè)備名稱而非分區(qū)名 WARNING: DOS-compatible mode is deprecated. It"s strongly recommended toswitch off the mode (command "c") and change display units to sectors (command "u").Command (m for help): m#交互式命令,提示鍵入“m”以獲取幫助Command action#可以看到,fdisk有如下這么多的子命令atoggle a bootable flag#設(shè)定可啟動(dòng)標(biāo)記 bedit bsd disklabel ctoggle the dos compatibility flag ddelete a partition#刪除一個(gè)分區(qū) llist known partition types#各分區(qū)類型所對(duì)應(yīng)的System ID mprint this menu nadd a new partition#新建一個(gè)分區(qū) ocreate a new empty DOS partition table pprint the partition table#顯示當(dāng)前的分區(qū)信息 qquit without saving changes#不保存退出screate a new empty Sun disklabel tchange a partition"s system id#修改指定分區(qū)的System IDuchange display/entry units v verify the partition table wwrite table to disk and exit#保存退出 xextra functionality (experts only)我們重點(diǎn)來(lái)看下“l(fā)”子命令,用于列出Linux支持的分區(qū)所對(duì)應(yīng)的 System ID :
[root@Centos ~]# fdisk /dev/sdaWARNING: DOS-compatible mode is deprecated. It"s strongly recommended to switch off the mode (command "c") and change display units tosectors (command "u").Command (m for help): l0Empty 24NEC DOS 81Minix / old Lin bfSolaris1FAT12 39Plan 982Linux swap / So c1DRDOS/sec (FAT- 2XENIX root3cPartitionMagic83Linux c4DRDOS/sec (FAT- 3XENIX usr40Venix 8028684OS/2 hidden C:c6DRDOS/sec (FAT- 4FAT16 <32M41PPC PReP Boot85Linux extendedc7Syrinx 5Extended42SFS86NTFS volume set daNon-FS data6FAT16 4dQNX4.x87NTFS volume set dbCP/M / CTOS / .7HPFS/NTFS4eQNX4.x 2nd part 88Linux plaintext deDell Utility8AIX4fQNX4.x 3rd part 8eLinux LVMdfBootIt 9AIX bootable50OnTrack DM93Amoebae1DOS accessaOS/2 Boot Manag 51OnTrack DM6 Aux 94Amoeba BBTe3DOS R/ObW95 FAT3252CP/M9fBSD/OSe4SpeedStorcW95 FAT32 (LBA) 53OnTrack DM6 Aux a0IBM Thinkpad hi ebBeOS fseW95 FAT16 (LBA) 54OnTrackDM6a5FreeBSD eeGPTfW95 Ext"d (LBA) 55EZ-Drivea6OpenBSD efEFI (FAT-12/16/10OPUS56Golden Bowa7NeXTSTEPf0Linux/PA-RISC b 11Hidden FAT125cPriam Ediska8Darwin UFSf1SpeedStor12Compaq diagnost 61SpeedStora9NetBSDf4SpeedStor14Hidden FAT16 <3 63GNU HURD or Sys abDarwin bootf2DOS secondary16Hidden FAT1664Novell NetwareafHFS / HFSfbVMware VMFS17Hidden HPFS/NTF 65Novell Netwareb7BSDI fs fcVMware VMKCORE18AST SmartSleep70DiskSecure Mult b8BSDI swapfdLinux raid auto 1bHidden W95 FAT3 75PC/IX bbBoot Wizard hid feLANstep 1cHidden W95 FAT3 80Old MinixbeSolaris bootffBBT1eHidden W95 FAT1其中常用的類型為:
82:Linux swap交換分區(qū)
83:Linux分區(qū)
8e:Linux邏輯卷
fd:Soft Raid
下面我們來(lái)進(jìn)行常規(guī)的分區(qū)操作哈!
首先來(lái)查看下當(dāng)前主機(jī)的分區(qū)情況:
[root@Centos ~]# fdisk /dev/sdaWARNING: DOS-compatible mode is deprecated. It"s strongly recommended toswitch off the mode (command "c") and change display units to sectors (command "u"). Command (m for help): pDisk /dev/sda: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 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: 0x00097863Device BootStart EndBlocksIdSystem /dev/sda1 * 12620480083Linux Partition 1 does not end on cylinder boundary. /dev/sda2 269152428882Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 911305510412748883Linux#這里可以看到該主機(jī)上已經(jīng)沒有尚未劃分的磁盤空間既然沒有多余的磁盤空間來(lái)創(chuàng)建分區(qū),那我們先來(lái)刪除其中一個(gè)分區(qū):
Disk /dev/sda: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 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: 0x00097863Device BootStart EndBlocksIdSystem /dev/sda1 * 12620480083Linux Partition 1 does not end on cylinder boundary. /dev/sda2 269152428882Linux swap / Solaris Partition 2 does not end on cylinder boundary. /dev/sda3 911305510412748883LinuxCommand (m for help): d#刪除一個(gè)分區(qū) Partition number (1-4): 4#根據(jù)前面的內(nèi)容,主分區(qū) 擴(kuò)展分區(qū)的數(shù)目只能是4個(gè) Warning: partition 4 has empty type #顯示第4個(gè)分區(qū)不存在哈 Command (m for help): d Partition number (1-4): 3#刪除第3個(gè)分區(qū) Command (m for help): p#驗(yàn)證結(jié)果,可以看到sda3分區(qū)被刪除了Disk /dev/sda: 107.4 GB, 107374182400 bytes 255 heads, 63 sectors/track, 13054 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: 0x00097863Device BootStart EndBlocksIdSystem /dev/sda1 * 12620480083Linux Partition 1 does not end on cylinder boundary. /dev/sda2 269152428882Linux swap / Solaris Partition 2 does not end on cylinder boundary.創(chuàng)建擴(kuò)展分區(qū):
推薦閱讀
- 西梅和烏梅是一種嗎
- 微信群主怎樣一鍵解散微信群?
- 一般尼龍棒的材質(zhì)是什么
- 火車票能改簽到前一天嗎
- 續(xù) 關(guān)于"神仙紙"
- 波普問答怎么玩
- 揠苗助長(zhǎng)的歇后語(yǔ) 揠苗助長(zhǎng)的下一句是什么
- 鈦餐具的危害
- 用了X800后的一些感想
- TCL899初用體驗(yàn)
