Unable to write then failed boot

Suddenly started getting “unable to write” error windows appearing in KDE after a full day of normal computer use. I restarted the PC and now it won’t boot.

Relevant errors during boot:

BTRFS error (device nvme0n1p4) incorrect extent count for 2177892352; counted 1751, expected 1750

assertion failed: 0, in fs/btrfs/free-space-tree.c:1547

kernel BUG at fs/btrfs/free-space-tree.c:1547!

invalid opcode: 0000 [#1] PREEMPT

Tumbleweed will eventually drop to a maintenance command prompt.

What are next steps to repair?

Unable to write errors are a common result of a full root filesystem. You may have too many saved snapshots and need to remove some older ones. SDB:BTRFS - openSUSE Wiki addresses this. If the root filesystem is old, you may have accumulated too many journal logs in /var/log/journal/<longlongstring>/ and need to use sudo journalctl --vacuum. See man journalctl. sudo systemctl edit systemd-journald may be used to configure various limits on journal size, and whether a persistent journal is even kept - /var/log/journal/ may not even exist.

No, the disk was only 1/2 full.

It was caused by BTRFS shitting the bed.

The solution was to erase the partition and restore from backup.

BTRFS can never be repaired. Just erase and restore from backup. Don’t waste the hours trying to search for a fix.

I had a similar issue - turned out to be too many snapshots and journal entries going back too far into the past.

After a -journalctl vacuum-, a snapper cleanup, and reboot, all is better.

How did you check the filesystem size - something like a:

:~> df -h’