扩展 Ubuntu LV - 添加新 HDD

扩展 Ubuntu LV - 添加新 HDD

我已经在我的个人电脑上安装了新的硬盘,并按照本指南扩展了逻辑卷,但几乎没有获得任何空间?

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

答案1

固定的

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

相关内容