After I ran a balance which resulted in a error message about balancing and read only filesystem, now the filesystem is stuck in read only. A new scan still gives errors:
~ sudo btrfs check --repair /dev/sda2 ✔
enabling repair mode
WARNING:
Do not use --repair unless you are advised to do so by a developer
or an experienced user, and then only after having accepted that no
fsck can successfully repair all types of filesystem corruption. Eg.
some software or hardware bugs can fatally damage a volume.
The operation will start in 10 seconds.
Use Ctrl-C to stop it.
10 9 8 7 6 5 4 3 2 1
Starting repair.
Opening filesystem to check...
Checking filesystem on /dev/sda2
UUID: 17243299-2eab-4c05-9d27-76b0968b95e5
[1/7] checking root items
Fixed 0 roots.
[2/7] checking extents
No device size related problem found
[3/7] checking free space cache
cache and super generation don't match, space cache will be invalidated
[4/7] checking fs roots
[5/7] checking only csums items (without verifying data)
[6/7] checking root refs
[7/7] checking quota groups
Counts for qgroup id: 0/1809 are different
our: referenced 61069459456 referenced compressed 61069459456
disk: referenced 61069459456 referenced compressed 61069459456
our: exclusive 190246912 exclusive compressed 190246912
disk: exclusive 108769280 exclusive compressed 108769280
diff: exclusive 81477632 exclusive compressed 81477632
Repair qgroup 0/1809
Repair qgroup status item
found 202921086976 bytes used, no error found
total csum bytes: 187146520
total tree bytes: 3108896768
total fs tree bytes: 2685730816
total extent tree bytes: 204095488
btree space waste bytes: 506857030
file data blocks allocated: 727317250048
referenced 312141459456
~ sudo btrfs rescue chunk-recover -v /dev/sda2 1 ✘
All Devices:
Device: id = 1, name = /dev/sda2
Scanning: 100533354496 in dev0cmds/rescue-chunk-recover.c:130: process_extent_buffer: BUG_ON `exist->nmirrors >= BTRFS_MAX_MIRRORS` triggered, value 1
btrfs(+0x4eb62)[0x55e9ac8edb62]
btrfs(+0x4f9d7)[0x55e9ac8ee9d7]
/usr/lib/libpthread.so.0(+0x9259)[0x7f3a83017259]
/usr/lib/libc.so.6(clone+0x43)[0x7f3a82f405e3]
zsh: abort sudo btrfs rescue chunk-recover -v /dev/sda2
~ sudo btrfs rescue zero-log /dev/sda2 ABRT ✘ 3m 11s
Clearing log on /dev/sda2, previous log_root 0, level
~ sudo btrfs rescue super-recover -v /dev/sda2 ✔
All Devices:
Device: id = 1, name = /dev/sda2
Before Recovering:
[All good supers]:
device name = /dev/sda2
superblock bytenr = 65536
device name = /dev/sda2
superblock bytenr = 67108864
device name = /dev/sda2
superblock bytenr = 274877906944
[All bad supers]:
All supers are valid, no need to recover
~ sudo btrfs rescue fix-device-size /dev/sda2 1 ✘
No device size related problem found
~ sudo mount -w /dev/sda2 32 ✘
~ sudo btrfs quota disable /mnt/17243299-2eab-4c05-9d27-76b0968b95e5 ✔
ERROR: quota command failed: Read-only file system
My best guess is that there is still a non recoverable problem with the filesystem, some corruption, that triggers a read only behavior. Have read somewhere that this is normal in such case to prevent further corruption. Bottom line is that my system is most likely non recoverable (hence the warning message at check --repair) and al the hours I have spend solving this problem would be better spend if I did a clean install of 21.1 with inproved btrfs support. Some feedback is still appreciated btw.
p.s. fsarchiver was unsuccessful restoring the image backup…