传统的MBR(Master Boot Record)分区方式,有一个局限:无法支持超过2TB的硬盘的分区(或单个分区超过2TB),这个情况在当前这个数据量激增的时候,实在令人难以接受(尤其是企业级的应用,动辄数TB的数据量)。
这个问题引入了一个GPT(Globally Unique Identifier Partition Table Format)分区的概念,相关信息历史可以参考词条GPT。
GPT的分区表很好了解决了传统MBR无法逾越2TB的限制。但是在Linux系统中,传统的fdisk命令无法支持gpt分区方式。(在红帽企业版Linux 4 Update 4之后的版本提供了对大于2 terabytes(TB)的磁盘设备的支持)
parted的操作都是实时的,也就是说你执行了一个分区的命令,他就实实在在地分区了,而不是像fdisk那样,需要执行w命令写入所做的修改, 所以进行parted的测试千万注意不能在生产环境中!
下面是parted命令的用法:
$ parted /dev/sda help
check NUMBERdo a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBERcopy file system to another partition
help [COMMAND]prints general help, or help on COMMAND
mklabel,mktable LABEL-TYPEcreate a new disklabel (partition table)
mkfs NUMBER FS-TYPEmake a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START ENDmake a partition
mkpartfs PART-TYPE FS-TYPE START ENDmake a partition with a file system
move NUMBER START ENDmove partition NUMBER
name NUMBER NAMEname partition NUMBER as NAME
print [free|NUMBER|all]display the partition table, a partition, or all devices
quitexit program
rescue START ENDrescue a lost partition near START and END
resize NUMBER START ENDresize partition NUMBER and its file system
rm NUMBERdelete partition NUMBER
select DEVICEchoose the device to edit
set NUMBER FLAG STATEchange the FLAG on partition NUMBER
toggle [NUMBER [FLAG]]toggle the state of FLAG on partition NUMBER
unit UNITset the default unit to UNIT
versiondisplays the current version of GNU Parted and copyright information
