Checking if two files share extents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: pgpdBUH4ei2Cr.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux