Proxmox - Resize Debian VM Disk


In Proxmox Virtual Environment, resizing a Debian virtual machine disk involves a few steps. Follow the instructions below

Open a terminal or SSH into your Proxmox VE host. Run the following command to check the current disk size configuration for the VM:

qm config VM_ID

Example result:
 scsi0: local-zfs:vm-108-disk-0,size=65G

Run the following command to resize the VM disk:

qm resize VM_ID scsi0 +SIZE

qm resize 108 scsi0 +15G

Replace VM_ID with the actual ID of your Debian VM and SIZE with the amount by which you want to increase the disk size. For example, to add 15GB:

SSH to your Debian VM:

Run the following commands to confirm the change in disk size:

lsblk
sudo dmesg | grep sda

Use the following command to view the current partition table:

sudo sfdisk -uS -d /dev/sda

Resize the partition using the following commands:

sudo echo "2048,,83,-" | sudo sfdisk --force -uS /dev/sda
sudo resize2fs /dev/sda1

Reboot your Debian VM to apply the changes:

sudo reboot

After completing these steps, your Debian VM should have a resized disk. Ensure that you have backed up important data before making any changes to your VM.

ex.
qm snapshot 108 test-resize