Btrfs filesystem du
A Btrfs command that uses FIEMAP to report extent usage and sharing for selected files and directory trees.
Each argument has its own accounting set, with overlapping shared ranges deduplicated within that set. A shared range can also be referenced outside it, so set-shared bytes do not establish deletion savings. [1]
In v6.16, UNKNOWN, DELALLOC and DATA_INLINE extents are skipped. Some inaccessible children generate warnings while traversal continues, so zero exit status alone does not establish coverage. [2]
Relations
- related
- fiemap, reflink, file-extent, filesystem-defragmentation, transparent-compression
Limitations
- A changing filesystem does not provide one atomic observation across the whole walk.
Citations
- Btrfs-progs v6.16: filesystem du, per-argument sets and traversal scope
- Btrfs-progs v6.16: filesystem-du.c, extent exclusions, set accounting and traversal warnings
Further reading
- Linux FIEMAP documentation: request flags and mappings changing between calls
- Hesela: file-clone costs and shared-space accounting
Sources & caveats
- Behavior is scoped to btrfs-progs v6.16 source, not a claim about every release.
- Source review only; no Btrfs filesystem or compression experiment is reported.