Ubuntu:如何find未分配的分区/可用空间?

我有一个传统的专用服务器与板载Ubuntu(仅限控制台模式)。 基于文档(价格等),我看到该服务器必须有250 + GB,但我看到less得多:

$ df -h Filesystem Size Used Avail Use% Mounted on /dev/md1 3.7G 1.6G 2.2G 43% / none 2.0G 196K 2.0G 1% /dev none 2.0G 0 2.0G 0% /dev/shm none 2.0G 3.2M 2.0G 1% /tmp none 2.0G 84K 2.0G 1% /var/run none 2.0G 0 2.0G 0% /var/lock none 2.0G 0 2.0G 0% /lib/init/rw /dev/mapper/vg00-usr 4.0G 2.2G 1.9G 55% /usr /dev/mapper/vg00-var 4.0G 1.9G 2.2G 48% /var /dev/mapper/vg00-home 4.0G 1.8G 2.3G 45% /home 

我不知道谁在何时以及如何configuration该服务器。 不幸的是,我无法从头重新安装它。

所以我的问题,我怎么能find免费的partions /未分配的空间

以防万一,这很容易:

 $ fdisk -l Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x4ed88842 Device Boot Start End Blocks Id System /dev/sda1 1 487 3911796 fd Linux raid autodetect /dev/sda2 488 731 1959930 82 Linux swap / Solaris /dev/sda3 732 60801 482512275 fd Linux raid autodetect Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0b9943b0 Device Boot Start End Blocks Id System /dev/sdb1 1 487 3911796 fd Linux raid autodetect /dev/sdb2 488 731 1959930 82 Linux swap / Solaris /dev/sdb3 732 60801 482512275 fd Linux raid autodetect Disk /dev/md1: 4005 MB, 4005560320 bytes 2 heads, 4 sectors/track, 977920 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md1 doesn't contain a valid partition table Disk /dev/md3: 494.1 GB, 494092484608 bytes 2 heads, 4 sectors/track, 120628048 cylinders Units = cylinders of 8 * 512 = 4096 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/md3 doesn't contain a valid partition table 

你有两个500GB的硬盘。 它们被configuration为将第一个分区(4 GB)镜像为//dev/md1 )的/dev/md1 ,两个2 GB分区(每个磁盘上一个)用于交换,另一个RAID镜像占用剩余空间( /dev/md3 )。

我假设/dev/md3被configuration为LVM的物理卷,包含卷组vg00 ,卷组vg00又有三个4GB卷(用于/home/usr/var )。

您可以使用vgdisplay检查LVM的状态,并使用lvextend扩展现有卷,或使用lvcreate在空闲空间中创build新卷。

有关更多信息,请参阅我列出的命令的手册页。

看来你正在磁盘上运行lvm 。 运行vgdisplay命令查看可用空间。

 vgdisplay 

要为逻辑卷添加更多空间,可以使用lvextend