
Running Out of Space? How to Safely Extend Your Proxmox Root Partition
If you manage a Proxmox VE server, you’ve likely encountered this dreaded scenario: a warning message pops up, or services become unstable, all because the root (/) partition is full. This is a common issue, as the default Proxmox installation often allocates a relatively small amount of space for the root filesystem, which can quickly fill up with logs, package updates, and temporary files.
Fortunately, if your Proxmox installation uses the default LVM (Logical Volume Management) setup, extending the root partition is a straightforward and safe process. This guide will walk you through the exact steps to reclaim your disk space and restore your server’s stability.
Before You Begin: A Quick Safety Check
While these LVM operations are generally very safe and can be performed on a live system, it is always best practice to have a complete and recent backup of your critical VMs and containers. Murphy’s Law applies to servers, too. A quick backup provides peace of mind before making any changes to your storage configuration.
Step 1: Check Current Disk Usage and Available Space
First, you need to understand your current situation. Log in to your Proxmox host’s shell (via SSH or the web console) and check your disk usage.
df -h
Look for the line corresponding to /dev/mapper/pve-root. You’ll likely see that the “Use%” is at 90% or higher. This confirms the root partition is the problem.
Next, you need to see if you have any free space in your LVM Volume Group (VG) that you can allocate to the root partition. The default Proxmox VG is typically named pve.
vgdisplay
Look for the Free PE / Size line in the output. This tells you exactly how much unallocated space is available in your volume group. If you have a healthy amount of free space here, you’re ready to proceed.
Step 2: Extend the Logical Volume
Now it’s time for the main event: extending the logical volume (LV) that holds your root filesystem. The command for this is lvextend.
You have two primary options:
Extend by a specific amount: If you want to add a fixed amount of space (e.g., 20 Gigabytes), you can use the
-Lflag. This is a good, conservative approach.lvextend -L +20G /dev/pve/rootExtend to use all available free space: If you want to allocate all the remaining free space in the volume group to your root partition, you can use the
-l +100%FREEflag. This is often the most practical choice for solving the problem long-term.lvextend -l +100%FREE /dev/pve/root
After running the command, you should see a success message confirming that the logical volume was successfully resized.
Important: At this point, you have only expanded the logical volume—the “container” for your data. The filesystem inside that container doesn’t know about the new space yet.
Step 3: Resize the Filesystem to Use the New Space
This is the final and most critical step. You must command the filesystem itself (likely ext4) to expand and occupy the new space you just allocated. If you skip this step, you won’t see any change in your disk usage.
The command for this is resize2fs. It will safely resize the filesystem online without interrupting your server’s operation.
resize2fs /dev/mapper/pve-root
The command will run for a few moments and then complete, automatically expanding the filesystem to fill the entire logical volume.
Step 4: Verify the Result
To confirm that everything worked, run the df -h command again.
df -h
You should now see that your /dev/mapper/pve-root partition has a much larger total size and a significantly lower usage percentage.
Proactive Tips for Storage Management
- Regular Monitoring: Periodically run
df -hto keep an eye on your disk usage. Don’t wait for warning messages. - Log Management: A primary cause of a full root partition is runaway log files. Ensure
logrotateis configured correctly on your system to compress and cycle old logs automatically. - Future Installations: When setting up new Proxmox nodes, consider manually partitioning during installation to allocate a more generous size for the root partition from the beginning.
By following these steps, you can quickly and safely resolve low disk space issues on your Proxmox root partition, ensuring your server remains stable, secure, and ready for action.
Source: https://nolabnoparty.com/estendere-root-partition-in-proxmox-con-lvm/


