Increase VM Storage 💾¶
Expanding your storage of your Debian 12 VM requires resizing both the volume and the filesystem. This guide provides step-by-step instructions.
Prerequisites¶
- Proxmox VE access with permissions to manage VMs.
- VM running Debian 12 (documentation for other OS would be useful later on as well)
- Root or sudo access inside the VM.
- [recommended] Backup your VM or take a Proxmox snapshot.
1. Resize the Volume in Proxmox 🛠️¶
Follow these steps to increase the virtual machine's storage volume:
- Turn off the VM.
- Open Proxmox, and select your VM.
- Navigate to Hardware.
- Select Hard Disk.
- Click Disk actions → Resize.
- Enter the size increment, then click Resize disk.
- 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
🧱¶
-
Open
cfdisk
:- Run the following command to see the free space allocated.
-
Resize your main storage partition:
- Select your storage partition (take note of the name, e.g. on my case it's
/dev/sda3
). - Select Resize (Set it to the TOTAL storage capacity you want, 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
cfdisk
.
- Select your storage partition (take note of the name, e.g. on my case it's
2.2 Resize the Physical Volume (pvresize
) 📦¶
-
Use
pvresize
to expand the partition.Storage Partition Path
Storage partition paths vary; in this guide, we use
/dev/sda3
.Templated Command:
Example:
-
Verify the changes:
- The
Free PE / Size
row should reflect the increased storage.
- The
2.3 Extend the Logical Volume (lvextend
) 🧮¶
-
Find your
<lv-path>
:- Look for
LV Path
, e.g.,/dev/debian-test-vg/root
.
- Look for
-
Extend the Logical Volume using
lvextend
.Logical Volume Path
Logical Volume paths vary; in this guide, we use
/dev/debian-test-vg/root
.Templated Command:
Example:
-
Verify the change:
- The
LV Size
should now reflect the increased storage.
- The
2.4 Resize the Root Filesystem 🧬¶
-
Identify the Logical Volume:
- Look for your mounted logical volume, e.g.,
/dev/mapper/debian--test--vg-root
.
- Look for your mounted logical volume, e.g.,
-
Resize the root filesystem:
Logical Volume Path
Logical Volume paths vary; in this guide, we use
/dev/mapper/debian--test--vg-root
.Templated Command:
Example:
-
Verify the new storage size:
- The available storage should now be increased.