This guide details the steps to successfully resize the disk space allocated to your Ubuntu VM within the Proxmox VE environment.
- Proxmox VE server with an Ubuntu VM
- Basic understanding of Linux commands
- Backup of your VM data (strongly recommended)
- Shut down your Ubuntu VM
- Navigate to the Proxmox VE web interface
- Select your VM
- Go to the "Hardware" tab
- Select the virtual disk you want to resize
- Click "Resize" under "Disk Actions"
- Enter the desired new size (e.g., +10G for additional 10GB)
- Click "Resize" to confirm
- Start the VM and login
- Check current disk layout:
lsblk
df -h
- Install required tools:
sudo apt update
sudo apt install cloud-guest-utils
- Extend the partition (replace X with your partition number):
sudo growpart /dev/sda X
sudo resize2fs /dev/sdaX
sudo pvresize /dev/sdaX
sudo lvextend -l +100%FREE /dev/mapper/vg-name
sudo resize2fs /dev/mapper/vg-name
Check the new disk size:
df -h
lsblk
- If you get errors about partition overlap, ensure the VM is completely powered off before resizing in Proxmox
- For LVM setups, verify volume group names using
vgs
command - If resize2fs fails, try running
e2fsck -f /dev/sdaX
first
- Always backup your data before performing disk operations
- Different Ubuntu versions might have slightly different partition layouts
- If using LVM, the steps might need to be adjusted accordingly
- For systems using ZFS or other filesystems, different commands may be required