I will be resizing a virtual disk for a VM that is running Debian 10.
1. Login as root
to your Proxmox host
2. To resize your disk while the VM is online or offline. (Depending on what kernel version you are running, the VM block device should update without a reboot)
qm resize <vmid> <disk> <size>
In my environment, I resized VM 109's SCSI0 disk by 32GB.
qm resize 109 scsi0 +32G
1. Boot into GParted (only if you are resizing your root partition. The partition has to be unmounted to resize)
2. Use the ‘GParted Live (Default Settings)’ option
3. Select the default options to start GParted unless you're sure you need something different.
4. Once booted, a system window should open talking about ‘not all of the free space on…’. Select the ‘Fix’ button.
5. This window should appear:
6. Right click your root partition (In my case, /dev/sda4). Select ‘Resize/Move’
7. A new window will open. Use your cursor to resize the root partition. I'm going to use all the free space for mine.
8. Click ‘Resize/Move’ to submit your change.
9. Apply your change(s) by selecting the green checkmark in the top menu bar.
10. Double click the ‘Exit’ button on the desktop screen and select reboot.
If you aren't using LUKS disk encryption, skip to the next section.
1. Login to the VM guest as root.
2. Use cryptsetup to resize the LUKS portion of the volume. (My LUKS device is ‘sda4_crypt’)
cryptsetup resize sda4_crypt -v
By using the lsblk
command, we can see that the crypt device has been resized from the 32GB it used to be.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 64G 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 954M 0 part /boot
├─sda3 8:3 0 5.6G 0 part
│ └─sda3_crypt 254:1 0 5.6G 0 crypt [SWAP]
└─sda4 8:4 0 57.5G 0 part
└─sda4_crypt 254:0 0 57.5G 0 crypt /
1. Resize the filesystem
resize2fs /dev/mapper/sda4_crypt