Gpt无分区限制,故只有主分区,无扩展分区和逻辑分区.分区直接按容量算,不按柱面算.
查看分区:parted -l
将分区表类型转换为gpt.: 主要命令mklabel gpt
对sdc盘分区:
[root@lbg ~]# parted /dev/sdc
GNU Parted 3.1
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt --再在里面输入 :mklabel gpt --转为gpt文件系统,但注意会销毁所有数据.
(parted) p ---输入p,d打印查看分区表
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
后执行分区命令: mkpart primary 0 1G
(parted) mkpart primary 0 1G ---创建分区并设置分区大小
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i ---输入i忽略
(parted) p --输入p查看分区
Model: VMware, VMware Virtual S (scsi)
Disk /dev/sdc: 2147MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 1000MB 1000MB primary
(parted) q --输入q保存退出,p是打印分区表
Information: You may need to update /etc/fstab.
删除分区: rm 分区编号 --删除已经创建的分区
后面是格式化(mkfs.ext4 /dev/sdc1)和挂载(mount /dev/sdc1 /tmp/test/a)
说明:gpt分区格式用fdisk看不到具体信息,直接用parted -l 即可.