Btrfs
Cheat sheet · https://pcornel.dk/topic.php?topic=3952
Answer
Btrfs uses copy-on-write B-trees for metadata and data extents, maintains checksums, and allocates space through chunks/block groups. Logical free space, device free space and metadata/data allocation can therefore diverge.
Remember
- Btrfs snapshot ≠ independent backup.
- Checksum error ≠ automatic repair without another valid copy.
- df free space ≠ complete Btrfs allocation picture.
- Btrfs RAID profile ≠ traditional RAID implementation semantics in every case.
First checks
btrfs filesystem usage <mount>— allocation (data/metadata)btrfs device stats <mount>— error countersbtrfs scrub status <mount>— scrub result
Verify in this order
file → COW B-trees → chunks → devices
Where it usually breaks
First mismatch in media/provider → controller/pool → logical object → path/protocol → filesystem/share/object namespace → consumer workload; preserve identity/pre-state before mutation.
Filesystems → Btrfs filesystem map
| Filesystem boundary | What to verify | Proof limit |
|---|---|---|
| Identity / attachment | Filesystem type, source/backing object, mount/attachment target and effective options | Presence or mount state alone does not prove consistency or lower-layer health |
| Capacity / metadata | Data space, metadata/inodes, quotas/reservations and filesystem state | Free bytes at one layer do not prove allocation can succeed end to end |
| Failure boundary | A mounted Btrfs filesystem proves current logical access; it does not prove every checksum is validated, redundant repair copies exist or allocation pressure is absent. | Correlate filesystem evidence with the backing volume/path/backend before repair |
| Acceptance | Healthy evidence: expected devices and profiles are present, data/metadata space is available, scrub/checksum state is clean and representative reads/writes succeed. | Close only after the original path/workload and read-back check succeeds |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3952