How to Quickly Resize Proxmox VM Disk: A Step-by-Step Guide

Resizing a disk in Proxmox VM involves a few steps: resizing the virtual disk in Proxmox, then resizing the filesystem within the guest OS. Here’s how you can do it:

Step 1: Resize the Disk in Proxmox

  1. Shut down the VM:
qm shutdown <VMID>
  1. Resize the disk:
qm resize <VMID> <DISK> +<SIZE>

Replace <VMID> with your VM ID, <DISK> with the disk you want to resize (e.g., scsi0), and <SIZE> with the amount you want to add (e.g., 10G for 10 GB).

Step 2: Resize the Filesystem within the Guest OS

  1. Start the VM:
qm start <VMID>
  1. Log into the VM and open a terminal.
  2. Rescan the partition table (if using parted):
sudo parted /dev/<DISK> resizepart <PARTITION_NUMBER> 100%

Replace <DISK> with the disk name (e.g., sda), and <PARTITION_NUMBER> with the partition number (e.g., 1).

  1. Resize the filesystem (for ext4):
sudo resize2fs /dev/<DISK><PARTITION_NUMBER>

Replace <DISK> with the disk name (e.g., sda), and <PARTITION_NUMBER> with the partition number (e.g., 1).