Skip to content

Increase Storage

Expanding your storage in Proxmox and Debian 12 requires resizing both the volume and the filesystem. This guide provides step-by-step instructions.

1. Resize the Volume in Proxmox

Follow these steps to increase the virtual machine's storage volume:

  1. Turn off the VM.
  2. Open Proxmox, and select your VM.
  3. Navigate to Hardware.
  4. Select Hard Disk.
  5. Click Disk actions → Resize.
  6. Enter the size increment, then click Resize disk.
  7. Turn on the VM.

2. Resize Storage Within the VM

Once the disk has been resized in Proxmox, additional steps are required inside the VM.

2.1 Modify the Partition Using cfdisk

  1. Open cfdisk:

    sudo cfdisk
    

    • You should see the free space allocated in the previous step.
  2. Resize your main storage partition:

    • Select your storage partition (e.g., /dev/sda3).
    • Select Resize (it should default to the max available storage).
    • Press Enter.
    • Select Write, type yes, and press Enter.
    • If you see The partition table has been altered, the process was successful.
    • Press q to exit.

2.2 Resize the Physical Volume (pvresize)

sudo pvresize /dev/sda3

2.3 Extend the Logical Volume

Find your logical volume path:

sudo lvdisplay

Extend it using:

sudo lvextend -l +100%FREE /dev/debian-test-vg/root

2.4 Resize the Root Filesystem

sudo resize2fs /dev/mapper/debian--test--vg-root

2.1 Modify the Partition Using cfdisk

Follow the same steps as above to create or resize the partition.

2.2 Resize the Physical Volume (pvresize)

sudo pvresize /dev/sda3

2.3 Extend Logical Volume to a Specific Size

First, determine how much you want to add (e.g., 20GB):

sudo lvextend -L +20G /dev/debian-test-vg/root

2.4 Resize the Root Filesystem

sudo resize2fs /dev/mapper/debian--test--vg-root

🎉 Congratulations!

Your Debian 12 VM should now have successfully resized storage! 🚀