LVM thin doesn't show real values

5k7

New Member
Sep 28, 2022
16
0
1
Hello,

I have a problem with LVM thin configuration especially with free space.
In GUI i have:

LVM thin:
Screenshot from 2022-10-23 13-42-45.png

LVM:
Screenshot from 2022-10-23 13-43-13.png


It is the same like form pve shell lvs -a form pve directly:
Screenshot from 2022-10-23 13-44-27.png

Taking 303 as an exmaple lvs shows that 89% of space is occupied but in fact there is only 50% of occupied space:

Screenshot from 2022-10-23 13-45-31.pngScreenshot from 2022-10-23 13-46-49.png

It is the same for different containers. Once this values were correct while moving data from original server. Initially I had 20 GB repo and and after unpacking everything it was like it is now - 89% occupied space, but after removing original compressed archive - numbers are still the same.

Probably I'm missing something trivial here ;)

Thanks in advance.
 
You could check if your discard isn't working or if there are any snapshots. Both of it could prevent LVM-Thin from freeing up deleted/overwritten data, so your guests filesystems reported size can mismatch the real size it needs on the thin pool.
 
Hi,
does running pct fstrim 303 help?
 
Thanks it works perfectly. Now it looks like it should:

Screenshot from 2022-10-27 15-57-07.png

Screenshot from 2022-10-27 16-09-12.png

Can proxmox manage it automatically ? Or this is normal and should be invoked from time to time for example before backup ?
 
Last edited:
I've set up a cronjob running a one-liner every hour that trims all LXCs. Can post that later when I"m back home. But be aware that a pct fstrim will lock the LXC causing a backup job to fail. So you need to make sure borh tasks don't eun at the dame time.
 
crontab -e

Then add there something like this:
Code:
# hourly trim of all LXCs, but not at hours backups might run (skipping 06:00)
0 0-5,7-23 *   *   *   /sbin/pct list | awk '/^[0-9]/ {print $1}' | while read ct; do pct fstrim ${ct}; done >/var/log/cron.log 2>&1
 

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!