假设我运行了这个虚拟机:
[root@centos ~]# fdisk -ul
Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 63 417689 208813+ 83 Linux
/dev/sda2 2522205 13799834 5638815 83 Linux
/dev/sda3 13799835 16771859 1486012+ 8e Linux LVM
/dev/sda4 417690 2522204 1052257+ 5 Extended
/dev/sda5 417753 2522204 1052226 82 Linux swap / Solaris
我怎么知道磁盘上有更多分区剩余多少可用空间?
解决方法:
以root用户身份输入shell:
# cfdisk /dev/sdX #Where /dev/sdX is the device
它会告诉你这样的事情:
cfdisk (util-linux-ng 2.18)
Disk Drive: /dev/sdb
Size: 3926949888 bytes, 3926 MB
Heads: 255 Sectors per Track: 63 Cylinders: 477
Name Flags Part Type FS Type [Label] Size (MB)
sdb1 Primary vfat [ABDEL] 1998.75
sdb2 Boot Primary ext3 [linx] 1924.72
如果设备有可用空间,则会显示.
注意:cfdisk实际上是一个基于终端的分区编辑器.