b 将GPT数据备份到一个文件
c 更改分区名称
d 删除一个分区
i 显示分区详细信息
l 列出已知分区类型。此处8200是Linux swap,8300是Linux filesystem(对应fdisk的82和83)。还有一个8e00是Linux LVM
n 增加一个新的分区
o 创建一个新的空白的GPT分区表
p 显示当前磁盘的分区表
q 退出gdisk程序,不保存任何修改
r 恢复和转换选项(仅限专家)
s 排序分区
t 改变分区的类型
v 验证磁盘分区表
w 将分区表写入裁判并退出(保存并退出)
x 额外功能(仅限专家)
? 显示帮助信息
扩展:Liunx LVM(Linux逻辑卷管理),将多个硬盘(物理盘)和硬盘分区(物理分区)做成一个逻辑卷,并把这个逻辑卷作为一个整体来统一管理,动态对分区进行扩缩空间大小,安全快捷方便管理。
(3).实例
[root@xuexi ~]# gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************
Command (? for help): p //显示当前磁盘的分区表
Disk /dev/sdb: 4194304 sectors, 2.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 4E50861F-8360-4B97-986E-51F4080BF678
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 4194270
Partitions will be aligned on 2048-sector boundaries
Total free space is 2097085 sectors (1024.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 2099199 1024.0 MiB 8300 Linux filesystem
Command (? for help): d //删除一个分区
Using 1
Command (? for help): n //新建一个分区
Partition number (1-128, default 1):
First sector (34-4194270, default = 2048) or {+-}size{KMGTP}: //开始扇区
Last sector (2048-4194270, default = 4194270) or {+-}size{KMGTP}: +1G //终止扇区
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): //分区类型
Changed type of partition to 'Linux filesystem'
Command (? for help): w //保存并退出
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y //确认覆盖
OK; writing new GUID partition table (GPT) to /dev/sdb.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot. //提示在下次重启后生效
The operation has completed successfully.