的最新版本fdisk
确实支持GPT,请参见此处。
例如,在具有GPT的磁盘上,我得到以下信息:
fdisk
从util-linux 2.23.2
RedHat / CentOS 7.2中说:
# fdisk -l /dev/sdb
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/sdb: 1000.0 GB, 999989182464 bytes, 1953103872 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
# Start End Size Type Name
1 2048 1953103838 931,3G Linux filesyste Linux filesystem
fdisk
从util-linux 2.27.1
Linux Mint 18 / Ubuntu 16.04 LTS(Xenial Xerus)中说:
# fdisk -l /dev/sda
Disk /dev/sda: 223,6 GiB, 240057409536 bytes, 468862128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 36CB5C9A-A274-43A0-9EBF-A4C457FFC56F
Device Start End Sectors Size Type
/dev/sda1 2048 526335 524288 256M EFI System
/dev/sda2 526336 468862094 468335759 223,3G Linux filesystem
并且不抱怨。
但是,我还是会gdisk
按照mikeserv的建议使用。
sudo parted -l
如果您不是root用户,则可能需要。否则,输出将变为空白,这可能会造成混淆。