我已经安装了一个新的硬盘驱动器到我的电脑,并遵循本指南来扩展逻辑卷,但我几乎没有获得任何空间?
http://support.cloud.eduserv.org.uk/entries/21157521-extending-an-ubuntu-vm-s-disk-space-using-lvm
我是这样开始的
Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu-root 292G 107G 171G 39% / udev 961M 4.0K 961M 1% /dev tmpfs 388M 492K 388M 1% /run none 5.0M 0 5.0M 0% /run/lock none 970M 0 970M 0% /run/shm none 100M 0 100M 0% /run/user /dev/sda1 228M 53M 164M 25% /boot
我安装了一个250GB的硬盘,并按照上述指南,现在我有:
Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu-root 300G 107G 178G 38% / udev 961M 4.0K 961M 1% /dev tmpfs 388M 492K 388M 1% /run none 5.0M 0 5.0M 0% /run/lock none 970M 0 970M 0% /run/shm none 100M 0 100M 0% /run/user /dev/sda1 228M 53M 164M 25% /boot
fdisk显示了这个:
vince@ubuntu:~$ sudo fdisk -l Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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 identifier: 0x0009d252 Device Boot Start End Blocks Id System /dev/sda1 * 2048 499711 248832 83 Linux /dev/sda2 501758 625141759 312320001 5 Extended /dev/sda5 501760 625141759 312320000 8e Linux LVM Disk /dev/sdb: 250.1 GB, 250059350016 bytes 81 heads, 63 sectors/track, 95707 cylinders, total 488397168 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 identifier: 0x56d656d6 Device Boot Start End Blocks Id System /dev/sdb1 2048 488397167 244197560 8e Linux LVM Disk /dev/mapper/ubuntu-root: 326.3 GB, 326308462592 bytes 255 heads, 63 sectors/track, 39671 cylinders, total 637321216 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 identifier: 0x00000000 Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table Disk /dev/mapper/ubuntu-swap_1: 2076 MB, 2076180480 bytes 255 heads, 63 sectors/track, 252 cylinders, total 4055040 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 identifier: 0x00000000 Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition table
所有的空间在哪里,我如何解决它?
编辑可以在这里看到530GB
vince@ubuntu:~$ sudo vgdisplay --- Volume group --- VG Name ubuntu System ID Format lvm2 Metadata Areas 2 Metadata Sequence No 5 VG Access read/write VG Status resizable MAX LV 0 Cur LV 2 Open LV 2 Max PV 0 Cur PV 2 Act PV 2 VG Size 530.73 GiB PE Size 4.00 MiB Total PE 135867 Alloc PE / Size 78293 / 305.83 GiB Free PE / Size 57574 / 224.90 GiB VG UUID f95YTC-DgAC-lcDq-IOUA-TmEX-JrEU-hkhxcU
固定
Filesystem Size Used Avail Use% Mounted on /dev/mapper/ubuntu-root 521G 108G 389G 22% / udev 961M 4.0K 961M 1% /dev tmpfs 388M 492K 388M 1% /run none 5.0M 0 5.0M 0% /run/lock none 970M 0 970M 0% /run/shm none 100M 0 100M 0% /run/user /dev/sda1 228M 53M 164M 25% /boot
什么是失踪…查找免费PE /大小57574 / 224.90 GiB
并运行
sudo lvresize -l +57574 ubuntu/root
然后
sudo resize2fs /dev/ubuntu/root