Troubleshooting
The failures a btrfs keeper actually meets, in the order they tend to arrive. Each names its check before its cure; filesystem trouble is misdiagnosed more often than it is misrepaired.
"No space left" while df shows space
Check: btrfs filesystem usage
/mnt/data and btrfs filesystem df.
Cause: the gap between chapters 2
and 14 — free bytes exist, but no free
chunk of the needed profile, usually
because data chunks are allocated and
mostly empty.
Cure: a gentle balance
(btrfs balance start -dusage=50 …,
chapter 9). If the filesystem is truly
full, delete or add a device first;
balance needs working room.
The kernel log reports checksum errors
Check: btrfs device stats (chapter
11) — which device, how many, and whether
the counter is growing.
Cause: rotting media, a failing disk,
occasionally a bad cable or RAM. On a
mirrored profile the good copy usually
repaired the read silently; the counter
is your only notice.
Cure: scrub (chapter 9) to find every
affected block; then treat the hardware
as a suspect, not the messenger. A
growing counter on one device is a disk
asking to be replaced. Transcript t04
is this error, manufactured on a copy so
you can see its exact shape.
The filesystem mounted read-only by itself
Check: the kernel log (dmesg) around
the moment it happened — btrfs goes
read-only to protect itself when it meets
metadata it cannot reconcile.
Cause: corruption, a device dropping
out mid-write, or a bug; the read-only
flip is the symptom, never the disease.
Cure: copy everything readable off
(chapter 11's restore if it will not stay
mounted), check offline, and only then
decide about repair. Do not remount
read-write and carry on; the filesystem
just told you something.
A tool crashed but the filesystem seems fine
The lab lived this one: btrfs filesystem
show segfaulted on a multi-device image
set while check and dump-super read
the same filesystem cleanly (transcript
t02b).
Check: ask a second reader
(btrfs check --readonly) before
believing the first one's dying words.
Cure: upgrade btrfs-progs; report the
crash upstream; do not "fix" a filesystem
that a check says is healthy.
Restore finds nothing — or nowhere to put it
The lab's first btrfs restore failed
because the destination directory did not
exist (transcript t03): mkdir it
first. And a restore that reports success
but yields few files may be reading a
subvolume other than the one you want;
btrfs restore -r <id> selects the tree
by subvolume ID from btrfs subvolume
list — or, offline, from
btrfs inspect-internal dump-tree.
Send asks for a parent you deleted
Chapter 7's bookkeeping, come due: an incremental stream names its parent, and the parent must exist at the receiving end. There is no cure but a full send. Prevention is the routine: parents are deleted last, at both ends, together.
Everything is slow after enabling quotas
Usually cause and effect, chapter 10:
disable quotas (btrfs quota disable)
and let the rescan go. If a balance or
rescan was interrupted, btrfs balance
status and btrfs qgroup show say what
is still pending; an interrupted balance
left alone will simply not have happened,
by design.