Pcornel
Linux · Filesystems & Mounting

Btrfs

Cheat sheet · https://pcornel.dk/topic.php?topic=2756

Back to the Topic

Answer

Btrfs is a copy-on-write filesystem with subvolumes, snapshots, checksums, compression and built-in multi-device RAID. It is the default on SUSE and Fedora desktops.

Remember

Btrfs can be "full" while df shows space (metadata exhaustion) — check btrfs filesystem usage and balance. Avoid its RAID5/6 for important data. Scrub regularly to detect corruption.

First checks

  • findmnt — mount tree with options
  • df -hT — usage and filesystem types
  • findmnt --verify — check /etc/fstab
  • dmesg -T | grep -iE 'ext4|xfs|btrfs' — filesystem kernel messages

Verify in this order

subvolumes and snapshots share CoW extents → checksums verify data → balance redistributes chunks

Where it usually breaks

First mismatch in hardware/block device → kernel driver/mapper/RAID/LVM → filesystem → mount namespace/options → path permissions/MAC → consumer I/O; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2756

Confirmation

Confirm action

Continue?