[SOLVED] Space not being reclaimed on ZFS over iscsi

jslanier

Well-Known Member
Jan 19, 2019
45
0
46
41
I have a debian VM with a ZFS over iscsi disk that I copied data off of and then back to. The debian guest shows that I have used 44T, while Proxmox shows I have used 81TB on the storage summary. On the ZFS host, I see that the zfs dataset shows 74T used. The VM is configured for discard=on with virtio-scsi, and I have another ZFS over iscsi disk that shows accurate usage on the guest and the ZFS host (but I have not performed a copy/replace operation on it).

The ZFS pools do not have reservations set, lz4 compression is on. What is causing this space to not be reclaimed?

Thanks
 
Have you tried manually triggering a trim via fstrim -av inside the VM?
 
No, you need to either mount the filesystem inside the VM with the discard option or enable fstrim.timer for periodic trims [1]. Iirc fstrim.timer should be automatically activated on newer Debian versions but I'm not 100% sure.

[1] https://wiki.debian.org/SSDOptimization
 
Last edited:
This appears to be freeing space as we speak. I will report back when it finishes. And thank you much!
 
You can check whether the timer is activated by running the following command. It should tell you when it ran last and when it will run next. Periodic trimming should be preferred over the discard mount option for security and performance reasons.

Code:
systemctl status fstrim.timer
 
I get the performance resaon, but why security? I guess immediately discarding would be more secure than waiting.
Iirc the caveat is mostly when using full disk encryption since attackers can deduce which parts of a drive are empty.
 

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!