How to shrink Windows/Linux VM disks stored on LVM

eds89

New Member
Nov 12, 2024
13
3
3
Hello.

I have tried to find some guidance on this online already, but have not come across anything I thought was clear or relevant enough for what I want to do;

I have a number of mostly Windows VMs, running in my PVE cluster. They are stored on an LVM on iSCSI storage.
I'd like to shrink some of the disks, to save some space, and am looking for a procedure to achieve this.

Within Windows, I know I can defrag the disk to try and increase the amount of shrinkable free space, then shrink the partition in disk management. What I'm not sure about, is how to then shrink the actual LVM stored disk in Proxmox?
I've seen some reference to lvresize or lvshrink commands, but the psots where people have been using these then report disk corruption.

Is this a supported process, and if so, is there any documentation or guidance on how to complete this?

Thanks
Eds
 
I've switched to using ZFS over iSCSI, which helps my situation, as I now have the ability to use thin provisioning.

I'm still curious if shrinking the disks is possible though.

Thanks
Eds
 
Just restore your freshest made backup from last night. It then should occupy only the required space on a sparse filesystem or on "thin LVM"...?
That's a reasonable suggestion.

The storage in question was a normal LVM, not LVM-thin, so I am not sure this would have had the desired outcome.
I will however try it for some other VMs I have on a local LVM-thin, but I was just curious if possible to do on a normal LVM.

Given I'm not using a normal LVM storage anymore, I suppose it doesn't really matter

Thank you
 

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!