Ubuntu 22.04 VM - Resize Disk

"You bunt, me bunt, he, she, we buntu. The art of ubuntu'ing" - Patrick Star's IT Cousin, probably...
Photo by Gabriel Heinzer / Unsplash
  1. Resize disk from ProxMox GUI
    1. Go to your VM, select Hardware
    2. Select the Hard Disk you wish to resize
    3. Select Disk Action in the top ribbon and then 'Resize'
    4. In the 'Resize Disk' window that appears, enter the amount of GiB you wish to INCREASE your existing disk
      NOTE: There is no option to shrink here and you are only specifying what you wish to ADD in addition to your existing disk size.
    5. Alternatively this can be achieved via the Host's Shell with the following: qm resize <vmid> <disk> <size>
  2. Extend physical drive partition```
sudo fdisk -l
sudo growpart /dev/sda 3
sudo pvdisplay
sudo pvresize /dev/sda3
sudo pvdisplay
  1. Extend the Logical Volume
sudo lvdisplay
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
sudo lvdisplay
  1. Resize Filesystem
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
sudo fdisk -l