LVM thin oversized, trying to understand ideal discard and trim options

luison

Renowned Member
Feb 22, 2010
151
5
83
Spain
elsurexiste.com
Hi, after a long time and due to an increase in used size of our main thinpool we realised we were having an issue like these:

https://forum.proxmox.com/threads/l...-actual-vm-disk-usage-low.108218/#post-464967
https://forum.proxmox.com/threads/lvm-thin-storage-filling-up-why.104327/#post-449704

We mainly have CT running but also 2 KVMs and we obviously have not had this correctly setup.
The host system is triming correctly via fstrim.timer but we have now realised this does not necessarily trim none of the thin disks mounted on the containers.

I found this clarifying how to check, activate for KVM and I understand I can discard or not when mounting disks there:

https://gist.github.com/hostberg/86bfaa81e50cc0666f1745e1897c0a56

But I am not so certain of the recommended procedure for the LXC containers, this is, if i want to trim immediately I understand I should flag discard on fstab but in case I don't (which I understand is better for the disks lifespan):

  • should i use fstrim.timer (via systemctl status fstrim.timer) on each container
  • or should I cron manually with: pct fstrim <vmid> instead?
  • do I need to set any special flag in LVMs conf for the thin pool?
I've red some issues with freezed containers when triming. Also does this affect or differ in case of using NVM disks?

Thanks.
 

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!