Follow up from my previous BTRFS issue, it seems the culprit was ailing RAM because I had another BTRFS issue, but worse.
As before, GRUB loaded but failed to mount root, rebooted on EnOS live USB, ddrescue’d the whole nvme0n1 disk to img file then ran a check on imaged partition loop mounted ro:
sudo btrfs check --readonly /dev/loop1p2
Opening filesystem to check…
Checking filesystem on /dev/loop1p2
UUID: 981f6265-bd51-4cdb-ab52-216221398977
[1/8] checking log skipped (none written)
[2/8] checking root items
[3/8] checking extents
ref mismatch on [33776766976 4096] extent item 0, found 1
data extent[33776766976, 4096] referencer count mismatch (parent 85782183936) wanted 0 have 1
backpointer mismatch on [33776766976 4096]
ref mismatch on [103479214080 16384] extent item 0, found 1
tree extent[103479214080, 16384] root 10 has no backref item in extent tree
backpointer mismatch on [103479214080 16384]
ERROR: errors found in extent allocation tree or chunk allocation
[4/8] checking free space tree
there is no free space entry for 33776766976-33776771072
cache appears valid but isn’t 33316405248
there is no free space entry for 103479214080-103479246848
cache appears valid but isn’t 103109623808
[5/8] checking fs roots
[6/8] checking only csums items (without verifying data)
there are no extents for csum range 33776766976-33776771072
csum exists for 33775079424-33777664000 but there is no extent record
ERROR: errors found in csum tree
[7/8] checking root refs
[8/8] checking quota groups skipped (not enabled on this FS)
found 97986568192 bytes used, error(s) found
total csum bytes: 86341584
total tree bytes: 6481248256
total fs tree bytes: 6192021504
total extent tree bytes: 178110464
btree space waste bytes: 958113530
file data blocks allocated: 305108484096
referenced 181554528256
smartctl shows the disk has 0 critical errors / bad sectors & 100% spare capaicity remaining, so I booted to MemTest86 & yep - errors detected.
After a few days I finally have 2 replacement sticks of RAM (MemTest86 passed) and I’m looking at skipping btrfs check --repair and just reformatting nvme0n1p2 to EXT4 then rsync from backup of root to the new partition using:
rsync -aAXHv --numeric-ids \
--exclude={"/dev/*","/proc/*","/sys/*","/run/*","/tmp/*","/mnt/*","/media/*","/lost+found","/var/tmp/*","/var/cache/*","/.swapfile"}
then updating GRUB & FSTAB in chroot with the new UUID.
But I’m open to advice.
- Repair BTRFS or wipe?
- Stick with BTRFS or switch to EXT4?
- Copy root back into new filesystem or start from scratch? (I had oauth tokens & config & kdewallet & known hosts etc etc)