In this tutorial, we will look at how to increase VM disk size in Proxmox.
As time goes on, you might need more space in a virtual machine than you initially thought. Fortunately, increasing the size of a VM in Proxmox is extremely easy, but reducing the size of a VM disk is not. For that reason, it’s a good idea to err on the side of caution and keep size increases incremental.
I’d also suggest taking a backup of the virtual machine before proceeding as you can restore the disk to a backup and revert the size. With that said, needing to do that is most likely an edge case for most users.
How to Increase VM Disk Size in Proxmox
We will look at how to increase VM disk size in Proxmox below. I will be using a Windows virtual machine, but please keep in mind that the process will be slightly different based on the OS that you’re using. There are changes that must be made on the VM, so keep that in mind as well.
1. Open Proxmox, select the VM that you’d like to resize, then select Hardware.
2. Take note of the hard disk name (in the example below, it’s sata0) and the VM ID (101 in the example below).
3. Open the Shell, then run the command below substituting the disk name, VM ID and how many GB you’d like to increase this VM disk.
qm resize [VM_ID] [DISK_NAME] +[SIZE_INCREASE]G
Using the information above, this is the command that I will be running:
qm resize 101 sata0 +20G
4. If you navigate to the hardware tab of the VM again, the disk size should be increased.
Virtual Machine Changes
While the command above has technically increased the size of the disk, the guest OS that you’re using must also make changes.
Windows VM Changes
As an example, you’ll see that the disk size above was increased to 120GB but the VM still only has 100GB available.
1. After opening Disk Management, you’ll see that the C: drive still only shows 100GB. Restart the VM (if it was still running and you don’t see the newly allocated space).
2. After restarting the VM, you’ll see that there is 20GB of unallocated space.
3. As soon as you see the unallocated space, right-click the C: drive (or the drive you’re looking to extend), and select Extend Volume.
4. Select Next to start the Extend Volume Wizard.
5. Move the disk from Available to Selected, then select Next (confirm all other settings as well).
6. Select Finish!
7. The disk should now be extended and the disk will be utilizing the full storage space!
Linux VM Changes
Before proceeding, the main point that I want to make is that using GParted is the easiest way to complete this. GParted provides a GUI very similar to the Disk Management tool in Windows above but works on Linux. This can be done via the CLI, but the process is a little tougher.
Before proceeding, take a backup of your VM! This process will be entirely different for everyone, so use the information below as a guideline rather than a tutorial!
Run the commands below to find the partition you’d like to expand, delete it (yes, it must be deleted using this process), then recreate.
1. Find the disk (/dev/sda3 is the disk I am using, but we will only use /dev/sda in the next step)
sudo fdisk -l
2. Run fdisk.
sudo fdisk [PATH]
3. Run the commands below to delete the partition, set the partition number (3 in my case for /dev/sda3), create a new partition, then write the partition.
d [PARTITION_NUMBER] default default n (if there's a signature) w
4. After making the changes above, the disk should now be the new size!
Conclusion & Final Thoughts
This tutorial looked at how to increase VM disk size in Proxmox. Overall, the process is simple from a Proxmox perspective but slightly more complicated on the VM side. As mentioned above, it’s easier to expand a disk than it is to shrink a disk. While both are possible, the steps are backward (VM changes after Proxmox changes when extending, VM changes before Proxmox when shrinking). As mentioned above, make sure you take backups before attempting this.
Thanks for checking out the tutorial on how to increase VM disk size in Proxmox. If you have any questions on how to increase VM disk size in Proxmox, please leave them in the comments!