[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find for shared extents
From: |
Philip Rowlands |
Subject: |
find for shared extents |
Date: |
Sat, 18 Nov 2023 22:02:27 +0000 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-1108-g3a29173c6d-fm-20231031.005-g3a29173c |
If files share data by hard link, there's no good API for converting inode
number to path, but we can use
$ find -inum 12345
to identify all hard links to a particular inode.
When file data blocks are shared with FICLONE, it's harder to track down who's
using what. Specifically, if it's desirable to free up space by deleting files,
shared extents can make this task more challenging. With coreutils 9.1
defaulting to --reflink=auto, these are now more common.
Although utilities like filefrag / xfs_bmap can display the fe_physical and
fe_flags values, this is presented inconsistently and isn't amenable to
scripting.
Would there be any interest for a new test for find? By providing a physical
byte offset in the filesystem, all extents using that offset would match.
find -xdev -physicaloffsetnum 3079180288 -ls
# I deliberately chose a bad test name to provoke folks to improve it
To look for shared extents, perhaps "-physicaloffsetnum 3079180288S" could
signify matching on the FIEMAP_EXTENT_SHARED flag.
If this isn't a good idea, suggestions on a postcard please of how to find all
files sharing a given physical_offset, sprinkled around the filesystem.
Cheers,
Phil
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- find for shared extents,
Philip Rowlands <=