Expanding an Ubuntu Hard Drive
Tailored to Ubuntu Server 20.04 VM's managed in ESXi or vSphere.
- Open vSphere > Right Click VM > Edit Settings
a. Make sure that all snapshots are deleted.
- Expand hard disk to whatever is needed.
- Attach gparted live iso and reboot system into gparted (ESC for boot menu)
- Expand the volume by dragging the thing over; hit apply.
- Reboot the device and SSH in.
- 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
Add a comment