Skip to content

Use BTRFS reflink for safer deduplication #201

@DADA30000

Description

@DADA30000

tldr;
BTRFS can copy a file without using additional space on disk, and it's safe to delete a file that it was copied from, basically symlinks but show up as a file, and source file can be deleted safely.

https://youtu.be/15_-hgsX2V0?t=409 I've noticed this video in my recommendations and decided to watch it, but on timecode the guy was talking about deduplication being dangerous, as external modification of actual files can break the symlink. Then I immediatly thought about reflinks in BTRFS
BTRFS supports a feature named "reflinks", it's basically like a symlink, but to a user it shows up as a completely regular file, even if you delete the source file that it was copied from, the copy of the file will still be valid, as the source file is like a "link" to the actual data of file, and only the link gets deleted, the actual data is deleted only if there are no "links" to the data.
So this can be used for safe deduplication, maybe a check for this, or an additional flag for deduplication config.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions