Thin Provisioning

necromonger

New Member
Jul 16, 2020
4
0
1
41
Hello forum users,

do I especially need hardware (SSD) for thin provisioning or is the software controlled on the side?

Kind regards
 
Hello,

Thank you for your prompt reply. I also have a folder "Data" under LVM-thin and I can take snapshots of the VM. It also seems to be heard. Debian 10 is running in the two VMs. Do I run the fstrim.timer for the weekly marking of the no longer solving blocks?

Best regards
 
Either run fstrim periodic or enable discard within the vm.

I prefer discard, enable it with (for debian 10 only):
sed -i "s/errors=remount-ro/errors=remount-ro,discard/g" /etc/fstab

And then do a reboot of the vm

Afterwards space should be freed instantly. Test it by creating a random file and remove it, monitor storage space on the hypervisor.

You also have to check "discard" and "ssd emulation" in the vm disk settings for TRIM to work.
 
Hello,

Thanks for the brief introduction. Thank you very much for that. I have a short question. Discard is not entered in fstab on the host, of course I have to do that there too, right?

/etc/fstab
----------------------------------------------------
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/pve/root / ext4 errors=remount-ro 0 1
UUID=CD13-962D /boot/efi vfat defaults 0 1
/dev/pve/swap none swap sw 0 0
proc /proc proc defaults 0 0
----------------------------------------------------

Do I actually have to activate fstrim as a systemd service?

Please excuse the many questions.
 
Its not needed on the hypervisor for thin-provisioning.

You could enable it to get better performance out of your SSD's once they fill up. But do not enable it for HDD or SSD's that have no Trim support, otherwise data loss can occur. You can check support using "lsblk --discard" if "Disc-Gran" is not 0, trim is supported.

If you use discard within the vm, a fstrim service is not needed, its either one of them.
 

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!