Resizing root fs for Ubuntu
I needed to resize one of my VMs. This will serve as some better notes than what I see online.
1. Shutdown VM and open the ESXI WEB UI to resize the virtual disk and check a box to force the bios to open on power up.
2. Attach gparted iso to VM then power it up and adjust boot order to boot iso.
3. Once booted, deactivate LVM root volume and resize both extended and logical partitions to max disk size or as desired.
You should see something like this, with different sizes and uuid.
# vgdisplay
--- Volume group ---
VG Name system
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size <15.52 GiB
PE Size 4.00 MiB
Total PE 3973
Alloc PE / Size 2437 / <9.52 GiB
Free PE / Size 1536 / 6.00 GiB
VG UUID rVuKv3-0fim-f6CQ-4HJs-XqnE-Vaec-xc2jr9
4. Extend LVM Volume
# lvextend -l +1536 /dev/mapper/system-root
5. Extend filesystem.
# resize2fs /dev/mapper/system-root
6. End result. More space. :) Enjoy.
# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/system-root 16G 8.3G 6.3G 57% /
Read other posts