1

I have installed a new hard drive into my pc and followed this guide to extend the logical volume but I have barely gained any space?

http://support.cloud.eduserv.org.uk/entries/21157521-extending-an-ubuntu-vm-s-disk-space-using-lvm

I started out like this

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

I installed a 250GB hdd and followed the above guide and now i have:

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 shows this:

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

where is all the space and how can i fix it?

EDIT Can see the 530GB here

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
  • do i need to mount the new disk somewhere?
    – Vince Lowe
    Dec 24, 2012 at 19:39

1 Answer 1

1

fixed

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

what was missing... Find Free PE / Size 57574 / 224.90 GiB

and run

sudo lvresize -l +57574 ubuntu/root

then

sudo resize2fs /dev/ubuntu/root

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .