做一个fdisk -l是一个非常方便的命令,但是如何让fidsk以MB或GB为单位打印分区大小?
你不能。 由于fdisk无用(由于缺lessGPT支持),所以请使用其他的parted -l代替。
而且,总是有man fdisk和man parted 。
我不确定其他操作系统; 但在Debian Jessie中默认显示为MB和GB。
例如:
# fdisk -l /dev/sda Disk /dev/sda: 1 TiB, 1120239009792 bytes, 2187966816 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: 1D01BF33-C584-4C49-A05F-341CFB8E2D24 Device Start End Sectors Size Type /dev/sda1 34 2047 2014 1007K BIOS boot /dev/sda2 2048 262143 260096 127M EFI System /dev/sda3 262144 234441614 234179471 111.7G Linux LVM /dev/sda4 234442752 2187966782 1953524031 931.5G Linux filesystem
注意第五列“大小”; K = KiB; M = MiB&G = GiB