r/zfs • u/alatteri • Jun 18 '26
offline ZFS native dedup
has anyone used this newish ZFS native dedup app? Looks very interesting. Better than jdupes or hardlink.
19
Upvotes
r/zfs • u/alatteri • Jun 18 '26
has anyone used this newish ZFS native dedup app? Looks very interesting. Better than jdupes or hardlink.
2
u/GameCounter Jun 19 '26
I've used fclones --dedupe and it works reasonably well.
https://github.com/pkolaczk/fclones
This does file based deduping, so somewhat different.
1
u/alatteri Jun 19 '26
I like the fact that it uses O_DIRECT while scanning so it doesn't burn ARC/L2ARC. Also uses a persistent cache file so subsequent non dry-runs are fast.
6
u/autogyrophilia Jun 19 '26
It's not an unproven concept, but I think time would be better spent by trying to adapt established tools like duperemove or rmlint to the limitations of ZFS block cloning.
The name isn't the best either, as it is using block cloning, not deduplication , which in ZFS are different concepts.
3
u/TheG0AT0fAllTime Jun 19 '26
I wrote a proof of concept earlier in the year (Yes me, not an LLM) in python for full/partial block cloning of (/partially) duplicate files. As long as the data of two files is record-aligned block cloning will work piece for piece if you clone over the other file in-place - allowing for partial block cloning as long as they're aligned. If there's a small difference in the middle the responsible record won't be block cloned but the rest of them left and right can be. Or just the whole file if they match as traditionally.
I dislike that being a single byte offset off makes cloning not work for two very similar files because their records simply aren't the same. It would be interesting if new records could be created of different sizes that both files can reference without having to create brand new files to split among their differences (Even then ZFS will optimize writes into larger records still making them different when written and observed with zdb).
It's a useful feature for offline deduplicating (actually block cloning) in the right use-cases but the limitations disappointed me in testing. And yet, they're totally understandable given the way records work. If I could partial block clone for binary/files that have a lot of common data between them but not perfectly aligned. That would be really cool, but thinking about it for more than 5 seconds it would be terrible for anything production.
1
u/nicman24 Jun 19 '26
would zfs rewrite work for dedup ?