Ubuntu – Resized ubuntu partition not showing properly in VMWare

gpartedpartitionUbuntuvmware-workstation

I have installed ubuntu 14.04 in windows under vmware workstation 11.

I ran out of diskspace on the VM (I had it set it to 30GB). Within the VM Properties – I have expanded the diskspace to 60GB.

I ran gparted on boot and resized the partition /dev/sda2 (ext) to use the unallocated space. and then resize /dev/sda5 (lvm) to take up the space.

When I rebooted the VM I ran df -h and it not showing the proper diskspace increase.

Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root   26G   14G   11G  56% /
none                         4.0K     0  4.0K   0% /sys/fs/cgroup
udev                         2.0G  4.0K  2.0G   1% /dev
tmpfs                        394M  3.3M  391M   1% /run
none                         5.0M     0  5.0M   0% /run/lock
none                         2.0G     0  2.0G   0% /run/shm
none                         100M     0  100M   0% /run/user
/dev/sda1                    236M   78M  146M  35% /boot

I have ran lvextend --size +30G /dev/mapper/ubuntu--vg-root – then lvdisplay

  --- Logical volume ---
  LV Path                /dev/ubuntu-vg/root
  LV Name                root
  VG Name                ubuntu-vg
  LV UUID                wCuSu5-h5eH-3Gvy-IB9N-F1CE-Vrv7-jD6jHm
  LV Write Access        read/write
  LV Creation host, time ubuntu, 2015-06-16 11:09:09 -0400
  LV Status              available
  # open                 1
  LV Size                55.76 GiB
  Current LE             14274
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

I have rebooted. Still no volume change. I'm lost.

Best Answer

The step you've missed is that after you've resized the Logical Volume, you need to then resize the filesystem that is in that LV. For ext[234] filesystems, you can do this "online" (with the filesystem mounted) by running

ext2resize /dev/ubuntu-vg/root

If the LV is formatted with another filesystem, check its documentation for the correct way to resize it.