Filesystem defragmentation
Reorganizing a file's storage extents to reduce fragmentation while preserving its logical contents.
Btrfs defragmentation can break extent sharing with reflink copies or snapshots, increasing data-space use. [1]
The recursive command in btrfs-progs v6.16 skips nested subvolumes, mount points and directory symlinks; its requested extent size is only a target. Rewriting also needs space reservations. [2]
Relations
- related
- file-extent, free-space-fragmentation, reflink, copy-on-write, transparent-compression
Citations
- Btrfs-progs v6.16: Defragmentation, extent sharing and compression
- Btrfs-progs v6.16: filesystem defragment, traversal, extent targets and reservations
Further reading
Sources & caveats
- Btrfs behavior follows pinned btrfs-progs v6.16 documentation; other filesystems can have different sharing and traversal contracts.