LVM horror, proxmox reports LVM thin full when actual VM disk usage low

Aug 20, 2021
25
0
6
34
It looks like i've encountered another LVM horror. I lost a VM to disk corruption (won't boot anymore but i can at least recover files after fsck) and found that proxmox says it is full. I then went around viewing each VM that used that partition and check their free space, even running trim on both the VMs and proxmox but it did not even help. The actual disk usage is 1/4 of the partition by going through and tallying each VM but proxmox still says it is full.
Any way around this? I had an even worse problem when trying out openstack dev whereby for some weird reason VM disks kept having issues (files were all there but they kept panicking and failing to boot citing disk corruption as an issue). I've also had the annoyance of dealing with old servers running older red hat and "full" partitions that significantly shrunk after i expanded the LVM partition.

Is there any way around this other than manually going in and shrinking the proxmox OS partition, expanding the LVM thin, then shrinking the LVM thin then expanding the OS partition?
 
Enable discard checkbox in VMs HDD settings, then run fstrim inside your VM.
...
or mount VMs logical volume on your host and run fstrim from your host.
 
Last edited:
Enable discard checkbox in VMs HDD settings, then run fstrim inside your VM.
...
or mount VMs logical volume on your host and run fstrim from your host.
it won't work since the "discard operation not supported" in guest OS. I did search and it seems that this is because of using virtio all the way. How do i mount the disks to perform it on the host? I read that its possible if the VM is shut down, disk mounted and then run. My current setup for each guest is VDA partitioned into data and swap (default debian)
 
it won't work since the "discard operation not supported" in guest OS.
You need to enable discard checkbox in Proxmox VM HDD settings first (VM->Hardware->HDD).

How do i mount the disks to perform it on the host? I read that its possible if the VM is shut down, disk mounted and then run. My current setup for each guest is VDA partitioned into data and swap (default debian)
It is a bit complicated. You will need to shutdown VM, activate its lvm logical volume, check partition table on this volume for offset and size of data partition, mount data partition with its offset and size limit.
 

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!