[root@Centos ~]# fdisk /dev/sda#fdisk的参数是设备名称而非分区名 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#设定可启动标记 bedit bsd disklabel ctoggle the dos compatibility flag ddelete a partition#删除一个分区 llist known partition types#各分区类型所对应的System ID mprint this menu nadd a new partition#新建一个分区 ocreate a new empty DOS partition table pprint the partition table#显示当前的分区信息 qquit without saving changes#不保存退出screate a new empty Sun disklabel tchange a partition"s system id#修改指定分区的System IDuchange display/entry units v verify the partition table wwrite table to disk and exit#保存退出 xextra functionality (experts only)我们重点来看下“l”子命令,用于列出Linux支持的分区所对应的 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交换分区
83:Linux分区
8e:Linux逻辑卷
fd:Soft Raid
下面我们来进行常规的分区操作哈!
首先来查看下当前主机的分区情况:
[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#这里可以看到该主机上已经没有尚未划分的磁盘空间既然没有多余的磁盘空间来创建分区,那我们先来删除其中一个分区:
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#删除一个分区 Partition number (1-4): 4#根据前面的内容,主分区 扩展分区的数目只能是4个 Warning: partition 4 has empty type #显示第4个分区不存在哈 Command (m for help): d Partition number (1-4): 3#删除第3个分区 Command (m for help): p#验证结果,可以看到sda3分区被删除了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.创建扩展分区:
推荐阅读
- 西梅和乌梅是一种吗
- 微信群主怎样一键解散微信群?
- 一般尼龙棒的材质是什么
- 火车票能改签到前一天吗
- 续 关于"神仙纸"
- 波普问答怎么玩
- 揠苗助长的歇后语 揠苗助长的下一句是什么
- 钛餐具的危害
- 用了X800后的一些感想
- TCL899初用体验
