Hi
Tonight my server was unexpectedly reset (probably a power failure) and
after rebooting, the BTRFS storage fails to mount. Any tips how to
recover the file system?
The initial mount during booting failed with this error:
[ 42.652725] BTRFS info (device dm-10): disk space caching is enabled
[ 42.652727] BTRFS info (device dm-10): has skinny extents
[ 48.391412] BTRFS error (device dm-10): parent transid verify failed
on 83880106754048 wanted 1169790 found 1061077
[ 48.404444] BTRFS error (device dm-10): parent transid verify failed
on 83880106754048 wanted 1169790 found 1061077
[ 48.406191] BTRFS error (device dm-10): failed to read block groups:
-5
[ 48.438823] BTRFS error (device dm-10): open_ctree failed
[ 48.455307] BTRFS info (device dm-10): disk space caching is enabled
[ 48.455310] BTRFS info (device dm-10): has skinny extents
[ 48.605760] BTRFS error (device dm-10): super_total_bytes
70011474444288 mismatch with fs_devices total_rw_bytes 140022948888576
[ 48.606835] BTRFS error (device dm-10): failed to read chunk tree:
-22
[ 49.024105] BTRFS error (device dm-10): open_ctree failed
Subsequent mount attempts fail with:
[49958.728511] BTRFS info (device dm-10): disk space caching is enabled
[49958.728512] BTRFS info (device dm-10): has skinny extents
[49963.631430] BTRFS error (device dm-10): parent transid verify failed
on 83880106754048 wanted 1169790 found 1061077
[49963.631803] BTRFS error (device dm-10): parent transid verify failed
on 83880106754048 wanted 1169790 found 1061077
[49963.631813] BTRFS error (device dm-10): failed to read block groups:
-5
[49964.033692] BTRFS error (device dm-10): open_ctree failed
The filesystem spans multiple devices with all data & metadata stored as
raid1.
$ sudo btrfs check /dev/mapper/b1d1crypt
Opening filesystem to check...
parent transid verify failed on 83880106754048 wanted 1169790 found
1061077
parent transid verify failed on 83880106754048 wanted 1169790 found
1061077
parent transid verify failed on 83880106754048 wanted 1169790 found
1061077
Ignoring transid failure
leaf parent key incorrect 83880106754048
ERROR: failed to read block groups: Operation not permitted
ERROR: cannot open file system
$ sudo btrfs fi show
Label: 'cluster_storage' uuid: 060fc2fb-5742-465f-898c-173b9db4b668
Total devices 13 FS bytes used 20.75TiB
devid 1 size 7.28TiB used 5.64TiB path /dev/mapper/b1d1crypt
devid 3 size 2.73TiB used 1.09TiB path /dev/mapper/b1d3crypt
devid 4 size 2.73TiB used 1.09TiB path /dev/mapper/b1d4crypt
devid 6 size 2.73TiB used 1.09TiB path /dev/mapper/b1d6crypt
devid 7 size 7.28TiB used 5.64TiB path /dev/mapper/b2d1crypt
devid 9 size 2.73TiB used 1.09TiB path /dev/mapper/b2d3crypt
devid 10 size 2.73TiB used 1.09TiB path /dev/mapper/b2d4crypt
devid 12 size 2.73TiB used 1.09TiB path /dev/mapper/b2d6crypt
devid 13 size 2.73TiB used 1.09TiB path /dev/mapper/b2d2crypt
devid 14 size 7.28TiB used 5.64TiB path /dev/mapper/b1d2crypt
devid 15 size 7.28TiB used 5.64TiB path /dev/mapper/b2d5crypt
devid 16 size 12.73TiB used 11.09TiB path
/dev/mapper/b1d7crypt
devid 17 size 2.73TiB used 1.49TiB path /dev/mapper/b1d5crypt
$ uname -a
Linux htpc 5.4.0-37-generic #41-Ubuntu SMP Wed Jun 3 18:57:02 UTC 2020
x86_64 x86_64 x86_64 GNU/Linux
$ btrfs --version
btrfs-progs v5.4.1