folbricht / desync

Alternative casync implementation
BSD 3-Clause "New" or "Revised" License
326 stars 44 forks source link

Reflink when building store #137

Open fhackenberger opened 4 years ago

fhackenberger commented 4 years ago

When building a store from a directory tree in uncompressed mode, it would be great if desync could also use reflink, as that would reduce the size of the store on disk dramatically.

Use case is: updating filesystems using images and re-using the chunks of the files which are already there.

folbricht commented 4 years ago

Do you mean reflinking of parts of chunks within the chunk store?

Chunk-stores dedup already de-dup whole chunks by their hash basically. There's currently no other/smaller hash that is performed on parts of chunks that could be used for reflinks. Also, given the way chunks are created based on split points in the content, I suspect it's very unlikely to align to block boundaries (typically 4k) which is necessary for reflinks. The only parts of chunks that could be reflinked would be blank/0-byte sections within chunks but the tool would still need to know where and how large those are.