Expanding an Ubuntu Hard Drive

Tailored to Ubuntu Server 20.04 VM's managed in ESXi or vSphere.

  1. Open vSphere > Right Click VM > Edit Settings a. Make sure that all snapshots are deleted.
  2. Expand hard disk to whatever is needed.
  3. Attach gparted live iso and reboot system into gparted (ESC for boot menu)
  4. Expand the volume by dragging the thing over; hit apply.
  5. Reboot the device and SSH in.
  6. Run the following commands, make sure to change the 20G to whatever you added. a. Run df-h to see the name of volume group and know what to expand. b. You can run sudo fdisk -l to see how much available storage to expand. c. sudo lvextend -L+20G /dev/ubuntu-vg/ubuntu-lv d. sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

Note: I used cockpit to find the storage device file path

Back to Ubuntu Guides

Add a comment