Hello,
After a BTRFS partition becoming read-only under use, it cannot be
mounted anymore.
The output is:
# mount /dev/sdb5 /mnt/disk1
mount: /mnt/disk1: wrong fs type, bad option, bad superblock on
/dev/sdb5, missing codepage or helper program, or other error.
Kernel output:
[ 2042.106654] BTRFS info (device sdb5): disk space caching is enabled
[ 2042.799537] BTRFS critical (device sdb5): corrupt leaf: root=2
block=199940210688 slot=31, unexpected item end, have 268450090 expect 14634
[ 2042.807879] BTRFS critical (device sdb5): corrupt leaf: root=2
block=199940210688 slot=31, unexpected item end, have 268450090 expect 14634
[ 2042.807947] BTRFS error (device sdb5): failed to read block groups: -5
[ 2042.832362] BTRFS error (device sdb5): open_ctree failed
# btrfs check /dev/sdb5
Opening filesystem to check...
incorrect offsets 14634 268450090
incorrect offsets 14634 268450090
incorrect offsets 14634 268450090
incorrect offsets 14634 268450090
ERROR: cannot open file system
Giving -s and -b options to "btrfs check" made no difference.
The usebackuproot mount option made no difference.
"btrfs restore" was successful in recovering most of the files, except
for a couple instances of "Error copying data".
System information:
OS: Arch Linux
$ uname -a
Linux rescue 5.1.4-arch1-1-ARCH #1 SMP PREEMPT Wed May 22 08:06:56 UTC
2019 x86_64 GNU/Linux
$ btrfs --version
btrfs-progs v5.1
I have since updated the kernel, with no difference:
$ uname -a
Linux rescue 5.1.5-arch1-2-ARCH #1 SMP PREEMPT Mon May 27 03:37:39 UTC
2019 x86_64 GNU/Linux
Before making any recovery attempts, or even restoring from backup, I
would like to ask for the best option to proceed.
Thanks,
Cesar