After seeking advice on reddit I've been advised to post this problem
here. See
https://www.reddit.com/r/btrfs/comments/bp0awe/broken_btrfs_filesystem_following_a_reboot/
I have a root btrfs filesystem on top of mdadm raid10 and lvm. The
raid and lvm appear to be ok but the btrfs partition will not mount.
I have booted a live recovery and tried to mount/repair the
filesystem. This is the result.
% mount /dev/mapper/vg-root /mnt/gentoo
mount: /mnt/gentoo: wrong fs type, bad option, bad superblock on
/dev/mapper/vg-root,
missing codepage or helper program, or other error.
Trying to mount with recovery gives the same result:
% mount -o ro,recovery /dev/mapper/vg-root /mnt/gentoo
mount: /mnt/gentoo: wrong fs type, bad option, bad superblock on
/dev/mapper/vg-root,
missing codepage or helper program, or other error.
And a btrfs check gives the following:
% btrfs check --repair /dev/mapper/vg-root
enabling repair mode
bytenr mismatch, want=898031484928, have=898006728704
ERROR: cannot open file system
% dmesg | grep -i btrfs [ 5.562419] Btrfs loaded, crc32c=crc32c-generic
[ 14.381989] BTRFS: device fsid
1fb019f1-a8cc-46ef-8122-ac6b1bedd522 devid 1 transid 51979 /dev/dm-1
[ 14.382647] BTRFS info (device dm-1): disk space caching is enabled
[ 14.382652] BTRFS info (device dm-1): has skinny extents
[ 15.777186] BTRFS error (device dm-1): bad tree block start 0 898031337472
[ 15.777334] BTRFS error (device dm-1): bad tree block start 0 898031353856
[ 15.777486] BTRFS error (device dm-1): bad tree block start 0 898031370240
[ 15.864239] BTRFS error (device dm-1): bad tree block start
898006728704 898031484928
[ 15.871367] BTRFS error (device dm-1): bad tree block start
898003812352 898031484928
[ 15.871382] BTRFS error (device dm-1): failed to read block groups: -5
[ 15.892051] BTRFS error (device dm-1): open_ctree failed
[ 16.016182] BTRFS info (device dm-1): disk space caching is enabled
[ 16.016186] BTRFS info (device dm-1): has skinny extents
[ 17.319016] BTRFS error (device dm-1): bad tree block start 0 898031337472
[ 17.319157] BTRFS error (device dm-1): bad tree block start 0 898031353856
[ 17.319303] BTRFS error (device dm-1): bad tree block start 0 898031370240
[ 17.422706] BTRFS error (device dm-1): bad tree block start
898006728704 898031484928
[ 17.429831] BTRFS error (device dm-1): bad tree block start
898003812352 898031484928
[ 17.429845] BTRFS error (device dm-1): failed to read block groups: -5
[ 17.450035] BTRFS error (device dm-1): open_ctree failed % uname
-r 4.14.70-std531-amd64
% wipefs /dev/mapper/vg-root
DEVICE OFFSET TYPE UUID LABEL
vg-root 0x10040 btrfs 1fb019f1-a8cc-46ef-8122-ac6b1bedd522
I was asked to try with a more recent kernel. I booted archiso which
showed similar results.
# uname -r
5.0.10-arch1-1-ARCH
# mount /dev/mapper/vg-root /mnt/funtoo
[ 208.724214] BTRFS error (device dm-1): bad tree block start,
want 898031337472 have 0
[ 208.724343] BTRFS error (device dm-1): bad tree block start,
want 898031353856 have 0
[ 208.724556] BTRFS error (device dm-1): bad tree block start,
want 898031370240 have 0
[ 208.805279] BTRFS error (device dm-1): bad tree block start,
want 898031484928 have 898006728704
[ 208.812412] BTRFS error (device dm-1): bad tree block strat,
want 898031484928 have 898003812352
[ 208.812451] BTRFS error (device dm-1): failed to read block groups: -5
[ 208.840576] BTRFS error (device dm-1): open_ctree failed
mount: /mnt/funtoo: wrong fs type, bad option, bad superblock on
/dev/mapper/vg-root, missing codepage or helper program, or other
error.
32
# dmesg|grep -i btrfs [ 23.028283] Btrfs loaded, crc32c=crc32c-intel
[ 23.061402] BTRFS: device fsid
1fb019f1-a8cc-46ef-8122-ac6b1bedd522 devid 1 transid 51979 /dev/dm-1
[ 207.437375] BTRFS info (device dm-1): disk space caching is enabled
[ 207.437379] BTRFS info (device dm-1): has skinny extents
[ 208.724214] BTRFS error (device dm-1): bad tree block start,
want 898031337472 have 0
[ 208.724343] BTRFS error (device dm-1): bad tree block start,
want 898031353856 have 0
[ 208.724556] BTRFS error (device dm-1): bad tree block start,
want 898031370240 have 0
[ 208.805279] BTRFS error (device dm-1): bad tree block start,
want 898031484928 have 898006728704
[ 208.812412] BTRFS error (device dm-1): bad tree block start,
want 898031484928 have 898003812352
[ 208.812451] BTRFS error (device dm-1): failed to read block groups: -5
[ 208.840576] BTRFS error (device dm-1): open_ctree failed
Any idea if this can be fixed?
Cheers
Lee