TSF – Giải pháp IT toàn diện cho doanh nghiệp SMB | HCM

P19 - Resize Partition Local And Local-LVM On Proxmox

🗄️ Proxmox – P19: How To Resize Local and Local-LVM on Proxmox VE (Step-by-Step Guide)

Managing storage efficiently is a critical task for maintaining a stable, flexible, and scalable Proxmox VE environment. As virtual machines, backups, and ISO files grow over time, system administrators often need to adjust storage allocation between local and local-lvm without reinstalling Proxmox or disrupting running workloads.

In this step-by-step tutorial, you will learn how to resize Local and Local-LVM storage on Proxmox VE safely, using real-world scenarios commonly faced by IT administrators and homelab users.

By following this guide, you will be able to:

  • ✅ Understand the Proxmox disk and LVM layout

  • ✅ Increase Local storage by reducing Local-LVM

  • ✅ Increase Local-LVM by reducing Local storage

  • ✅ Avoid common mistakes that can cause data loss

  • ✅ Resize storage without reinstalling Proxmox VE

This guide is suitable for beginners, system administrators, and Proxmox users who want more control over their storage layout.


🧪 Lab Environment

Initial storage layout:

  • Local: 27.21 GB

  • Local-LVM: 21.88 GB

Two common use cases will be demonstrated:

  1. Reduce local-lvm to increase local

  2. Reduce local to increase local-lvm


🔁 Case 1: Reduce Local-LVM to Increase Local Storage

Scenario:
You want to increase Local storage by 10 GB for ISO files or backups by reducing Local-LVM.


🧹 Step 1: Remove Local-LVM Storage

Remove Local-LVM from GUI

  • Go to Datacenter → Storage

  • Select local-lvm

  • Click Remove

Remove the logical volume from shell

 
lvremove pve/data

⚠️ Ensure no VM disks are stored on local-lvm before removing it.


📈 Step 2: Increase Capacity for Local

Resize the root logical volume and filesystem:

 
lvresize -L +10GB pve/root --resizefs resize2fs /dev/pve/root

This operation expands the local storage without affecting system data.


🔄 Step 3: Recreate Local-LVM (Thin Pool)

Recreate a small local-lvm thin pool:

 
lvcreate -L 5G -ndata pve

Create metadata for the thin pool:

 
lvconvert --type thin-pool --poolmetadatasize 1G pve/data

🧩 Re-add Local-LVM in GUI

  • Go to Datacenter → Storage

  • Add LVM-Thin storage

  • Select pve/data

Expand the thin pool to use remaining free space:

 
lvresize -l +100%FREE pve/data

✅ Local storage is now larger and Local-LVM is recreated successfully.


🔁 Case 2: Reduce Local to Increase Local-LVM

Scenario:
You need to increase Local-LVM by 10 GB, but Local is currently using most of the space.

⚠️ This process cannot be done while the root filesystem is mounted, so we must boot from a live environment.


💿 Step 1: Attach Ubuntu Desktop ISO

  • Attach Ubuntu Desktop ISO as a CD

  • Or boot from a USB containing Ubuntu Desktop installer


🖥️ Step 2: Enter Ubuntu “Try” Mode

From Ubuntu Desktop:

  • Open Terminal

  • Check filesystem integrity:

 
sudo e2fsck -f /dev/pve/root

📉 Step 3: Reduce Filesystem Size

⚠️ Always resize filesystem before resizing the logical volume

Example: Reduce Local from 27 GB to 17 GB:

 
sudo resize2fs /dev/pve/root 17G

Note: You must specify the remaining size, not the size to subtract.


📉 Step 4: Reduce Logical Volume

 
sudo lvreduce -L 17G /dev/pve/root

This frees space for Local-LVM expansion.


📈 Step 5: Expand Local-LVM (pve/data)

 
sudo lvextend -l +100%FREE /dev/pve/data

🔄 Step 6: Reboot and Verify

  • Remove the Ubuntu ISO

  • Shutdown the system

  • Boot back into Proxmox

Verify disk layout:

 
lsblk

You should now see increased capacity on local-lvm.


⚠️ Important Notes – When NOT to Resize

Do NOT resize storage in the following situations:

  • ❌ A VM disk is actively using local-lvm

  • ❌ LVM-thin pool is busy or in use

  • ❌ Root filesystem (/var/lib/vz) is mounted and active

  • ❌ System is running and booted normally (use live environment instead)

➡️ In these cases, use Case 2 with a live OS to avoid data corruption.


✅ Conclusion

In this tutorial, you have learned how to:

  • Resize Local and Local-LVM on Proxmox VE

  • Safely reallocate storage without reinstalling the system

  • Handle both online and offline resize scenarios

  • Avoid common LVM and filesystem resizing mistakes

Proper storage management allows your Proxmox server to:
✔ Scale with growing workloads
✔ Optimize disk usage
✔ Reduce downtime
✔ Increase long-term stability

Whether you are managing a homelab or a production Proxmox cluster, understanding how to resize Local and Local-LVM is an essential system administration skill.

🎯 Follow this guide carefully, and your Proxmox environment will remain flexible, efficient, and future-ready.

See also related articles

P15 – Backup and Restore VM in Proxmox VE

P15 – Backup and Restore VM in Proxmox VE 🚀 Proxmox VE P15 – Backup and Restore VMs (Full Step-by-Step Guide) Data protection is one of the most critical responsibilities of any system administrator.In Proxmox VE, having a proper backup and restore strategy ensures your infrastructure can quickly recover from...

Read More

P14 – How to Remove Cluster Group Safely on Proxmox

Proxmox VE 9 P14: How to Remove Cluster Group Safely In Proxmox (Step-by-Step Guide) 🚀 Proxmox VE 9 – How to Remove Cluster Group (Step-by-Step) In some scenarios, you may need to remove a Proxmox cluster configuration completely, especially when: ❌ A node failed permanently ❌ The cluster was misconfigured...

Read More