pauldreik / rdfind

find duplicate files utility
Other
980 stars 79 forks source link

Add reflinking mode for deduplication #70

Closed lvd2 closed 3 years ago

lvd2 commented 3 years ago

cp command has an option to make reflinks (for example: cp -ra --reflink=always) instead of hardlinks. Reflinks are only available on copy-on-write filesystems like btrfs or zfs.

Reflinking means that two files will have identical data blocks up to the moment when any of them will be changed, then copy-on-write mechanins will duplicate changed data blocks for each file.

Hardlinking is just when two filenames point to same physical file, changing one of them means changing another 'magically'

So the issue is about adding reflinking deduplication mechanism to the rdfind.

thlor commented 3 years ago

This would be very useful!

pauldreik commented 3 years ago

I agree this would be useful. I looked into how cp implemented it, a few years ago. I think it was a bit complicated. I will put this as a duplicate of https://github.com/pauldreik/rdfind/issues/17 as it is closely related.