Good morning, I'm working on an offline deduplication script intended to
work around the copy-on-write functionality of BTRFS.
Simply put - is there any existing utility to compare two files (or
dirs) and output if the files share the same physical extents / data
blocks on disk?
- aka - they're CoW copies.
I'm not actively working with BTRFS yet, but for the project i'm working
on it's looking to the be most suitable candidate, and the CoW
functionality avoids issues with file changes that hardlinks would create.
From reading other posts, aware the information could be pulled out via
btrfs-debug-tree, but it would then involve parsing the entire output to
locate the required files inodes and their extents which seems like
quite a roundabout way to retrieve the information.
Also my programming skills aren't up to the task of trying to pull the
tree data directly from the filesystem to do it, and I'd like to avoid
doing byte-by-byte comparisons on all files as it's inefficient if the
file can instead be identified as a CoW copy.
Open to suggestions of other tools that could be used to acheive the
desired result.
Thanks.
Jp.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html