resize LVM partitions

Aug 20, 2021
25
0
6
34
Hi i would like to resize the root and LVM partitions. I am using larger disks but on install proxmox takes up so much space. I keep all my templates, ISOs, etc on a network drive so i would like to reduce the size of the root partition.
How do i go about doing this and what is the safe limit? is 32GB plenty for this?
 
I'd recommend the below:
  1. Backup any data/configuration on these partitions
  2. Boot into a live CD
  3. Use tools there to resize
That might look like:

Bash:
lsblk #Figure out your devices
lvreduce -L 60G /dev/<VG>/<LV> #Resize the LV to 60G in this example
resize2fs /dev/<VG>/<LV> #Resize the FS


I think 16-32G would work, but your setup does not sound like a simple throwaway lab/tester. I would not personally go under 50-60G on my root partition to give some growth for logs/additional applications/etc.
 
I'd recommend the below:
  1. Backup any data/configuration on these partitions
  2. Boot into a live CD
  3. Use tools there to resize
That might look like:

Bash:
lsblk #Figure out your devices
lvreduce -L 60G /dev/<VG>/<LV> #Resize the LV to 60G in this example
resize2fs /dev/<VG>/<LV> #Resize the FS


I think 16-32G would work, but your setup does not sound like a simple throwaway lab/tester. I would not personally go under 50-60G on my root partition to give some growth for logs/additional applications/etc.
lvm partitions can be resized live with no data loss. However given the very low usage will these commands work the same way? Only thing on the OS partition is just proxmox and a few softwares to do with monitoring and testing, plenty of space, or rather too much space.
I used xfs. Would it work with the OS running on the OS partition?
 
>lvm partitions can be resized live with no data loss.

Correct, I like to side with over-prepared on storage matters just in case.

>Only thing on the OS partition is just proxmox and a few softwares to do with monitoring and testing, plenty of space, or rather too much space.

Understood, feel free to size accordingly, I do not have insight into your workload/needs.

> However given the very low usage will these commands work the same way? | I used xfs.

It sounds like you are aware of how this changes things. You can't shrink xfs, only grow it, so things get a little more complicated.



Your options start leaning towards either:

A)
  • Back up all data
  • Destroy the existing XFS filesystem
  • Shrink the LVM volume
  • Create a new, smaller XFS filesystem
  • Restore data from backup

B)
  • Create a new, smaller LVM volume (if you have unallocated space in your volume group)
  • Make a new XFS filesystem on it
  • Copy data to the new filesystem
  • Update system to boot from new volume
  • Eventually remove old, larger volume
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!