This guide covers how to resize a VM disk in Proxmox and extend the filesystem within the VM to use the additional space.
- VM is powered off (recommended) or has hot-plug support enabled
- Backup of the VM (strongly recommended before any disk operations)
- SSH access to the VM
- Root/sudo access on the VM
- In Proxmox web interface, navigate to your VM
- Go to Hardware tab
- Select the disk you want to resize
- Click Resize disk
- Enter the additional size (e.g., +48 to add 48GB)
- Click Resize disk
- Restart the VM if it was powered off
SSH into your VM and check the current disk usage:
df -hCheck if the disk size has increased:
sudo fdisk -l /dev/sdaCheck partition table:
sudo parted /dev/sda printIf there's unallocated space, extend the partition:
sudo parted /dev/sda resizepart 3 100%When prompted:
- Fix/Ignore? → Type
Fix - Partition number? → Type
3(or the appropriate LVM partition number) - End? → Type
100%
Resize the physical volume to use the extended partition:
sudo pvresize /dev/sda3Verify the change:
sudo pvdisplayExtend the logical volume to use all available space:
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lvReplace ubuntu--vg-ubuntu--lv with your actual logical volume path (visible in df -h output).
Verify the change:
sudo lvdisplayResize the filesystem to use the extended logical volume:
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lvCheck the final disk usage:
df -hYou should now see the full allocated space available.
Solution: Services may need to be restarted after disk expansion:
sudo systemctl restart [service-name]Solution: Reboot the VM to ensure the kernel recognizes the new disk size:
sudo rebootSolution: Check if the correct physical volume device is being used:
sudo pvdisplay
sudo vgdisplay
sudo lvdisplayIf your system doesn't use LVM, the process is simpler:
- Extend partition:
sudo parted /dev/sda resizepart 1 100% - Resize filesystem:
sudo resize2fs /dev/sda1
- Always backup your VM before performing disk operations
- Test in a non-production environment first
- Partition operations can be destructive - double-check device names
- Consider using VM snapshots before starting the resize process
Use these commands to verify each step:
# Check disk hardware size
sudo fdisk -l /dev/sda
# Check partition table
sudo parted /dev/sda print
# Check physical volumes
sudo pvdisplay
# Check volume groups
sudo vgdisplay
# Check logical volumes
sudo lvdisplay
# Check filesystem usage
df -h