* Checking if two files share extents
@ 2016-04-28 14:33 Roman Mamedov
0 siblings, 0 replies; only message in thread
From: Roman Mamedov @ 2016-04-28 14:33 UTC (permalink / raw)
To: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 868 bytes --]
Hello,
I'm writing a simple custom deduplication script, and faced a problem with how
to make it skip already deduped files. E.g., if I do
cp -a --reflink fileA fileB
...after this, how to check if fileA and fileB refer to the same extents on
disk? I tried comparing the outputs of "filefrag -e", but this doesn't seem to
be very reliable (and e.g. instantly after such copying and until some time
later, the extent maps WILL differ).
The script I'm writing is in a scripting language, so ideally this should be
obtainable via some command-line text based tool, without kernel API calls or
the like.
Perhaps ideally something that would print a list of a given file's extents
with their absolute block numbers. Looked at what's available in "btrfs
inspect", but there doesn't seem to be any command of that sort.
--
With respect,
Roman
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-28 14:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-28 14:33 Checking if two files share extents Roman Mamedov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).