I had a serious issue with my btrfs setup today. After compiling a linux-ck 4.16.16 I wasn't able to boot. My btrfs partition failed to mount. I actually have two M.2 SSD of 128GB each and I created a 127GB btrfs partition on each (sda3 and sdc3) and then coupled them with
btrfs device add to a RAID0.
~ >>> lsblk -f NAME FSTYPE LABEL UUID MOUNTPOINT sda ├─sda1 vfat 7550-DABB /boot/efi ├─sda2 ext2 302ae0b1-b913-471b-a1ab-3bb4575b4d00 /boot └─sda3 btrfs ea59470a-443b-4dbd-90b9-b6e0e6b32876 /home/eugen/Dat sdb ├─sdb1 btrfs Linux cf269dfd-df9c-4939-a8ff-796a4ced6643 /mnt ├─sdb2 swap swap e487a4eb-8a7f-4196-896e-10ca767c4269 ├─sdb3 vfat 4692-78DF ├─sdb4 crypto_LUK 7b749090-f58c-484e-ae9f-e7415f72da2e ├─sdb5 xfs DATA2 3de85b28-17b3-4a39-bd5e-61b4e118d7fd ├─sdb6 xfs DataHDD bb0e217e-dc93-486c-93f8-c5d73dcf7c4d └─sdb9 ext4 casper-rw 62eb1d2b-5aeb-4bfd-b9df-e89162626a58 sdc ├─sdc1 ├─sdc2 ext2 boot32 bd30fb1c-2107-4489-98df-7d68a02a148b └─sdc3 btrfs ea59470a-443b-4dbd-90b9-b6e0e6b32876
I forgot to write down what the error was, I will post it from browser history on a different system.
EDIT: I'm trying to reconstruct the errors from my browser history because I searched them:
- this happens when I try to mount:
btrfs mount: /mnt: wrong fs type, bad option, bad superblock on /dev/, missing codepage or helper program, or other error.
- this was in dmesg output:
BTRFS critical (device sda3): corrupt leaf: root=1 block=38301958144 slot=199, bad key order, prev (576460795430043648 168 73728) current (43126693888 168 53248)
Anyway, what helped was running a dangerous command from a Manjaro install on a different disk.
sudo btrfs check --init-extent-tree /dev/sda3
I tried to mount the partition and run a normal
btrfs check, but it didn't work and didn't help, then I decided to run a more risky command. I didn't care for https://btrfs.wiki.kernel.org/index.php/Restore because I had a backup of my system an user data.
The --init-extent-tree took very long, 10 hours maybe, it checked about 4 million units of whatever and finally produced a harmless looking summary which I didn't care to save.
After a reboot to the main install the filesystem is back.