-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting a file on NTFS formatted dedup-enabled zvol does not reduce the dedup ratio #306
Comments
@lundman any insights on how to fix or investigate this? Really appreciate your help on this one. |
zvol can't know about deletions on NTFS (at least until openzfs2/TRIM support) - NTFS isn't physically overwriting the data on the deleted blocks - so at the block level the data is still there and still dedup'd. Eventually NTFS will overwrite those blocks with new data, which is when they'll be un-dedup'd. |
(Also FYI dedup is always a bad idea for performance, if that's a factor you care about.) |
We have TRIM support, but I don't remember if I filled in the parts that call unmap in zvol.c for Windows yet. https://github.com/openzfsonwindows/ZFSin/search?q=zvol_unmap |
That's great news - but my win10 doesn't seem to believe that the zvol virtual device supports TRIM, last time I checked using instructions such as https://www.howtogeek.com/257196/how-to-check-if-trim-is-enabled-for-your-ssd-and-enable-it-if-it-isnt/ . Maybe I was using an ancient build; will test again shortly. |
Nah, I mean - I think we are missing the bit in storport that advertise that we do trim, then relays the discard request to zvol_unmap(). The pieces are there, they just aren't connected yet.... |
@lundman I did try sending explicit scsi commands with sg3_utils (windows port). I didnt see scsiop_unmap being intercepted by zfsin. Alternatively, I tried passing scsi_write_same16 which was intercepted (the command line tool is sg3_write_same; Need to provide starting lba and number of blocks), from there I called zvol_unmap eventually but I did not see the reclaimation happening at zvol (when checked zfs list output) after deleting a file. |
Finally got around to looking deeper into this should hopefully take the incoming requests and pass them along to zvol_os_unmap. I need to figure out what you did to test it though, or see if I can fool vmware into saying it has an SSD instead of HDD |
I created dedup and compression enabled zvol and formatted it with NTFS.
After copying a file (of size ~1GB) 3 times,
After deleting (permanent delete) one file, the dedup ratio remains unchanged. The REFER'ed space is not reclaimed.
Is there a way to update the dedup ratio using UNMAP/TRIM?
The text was updated successfully, but these errors were encountered: