All of lore.kernel.org
 help / color / mirror / Atom feed
* Unmountable / uncheckable Fedora 34 btrfs: failed to read block  groups: -5 open_ctree failed
@ 2021-09-12 10:27 Niccolò Belli
  2021-09-12 10:44 ` Niccolò Belli
  2021-09-12 11:14 ` Qu Wenruo
  0 siblings, 2 replies; 14+ messages in thread
From: Niccolò Belli @ 2021-09-12 10:27 UTC (permalink / raw)
  To: linux-btrfs

Unfortunately my Fedora's btrfs partition failed again. Yet no idea of 
the culprit because memtest passes and the drive is good.
The system freezed and I had to reset (magic Sysrq keys didn't work 
either), being welcomed by an unmountable fs.

This is what I get when I try to mount it:

$ sudo mount /dev/nvme0n1p6 /mnt/
mount: /mnt: wrong fs type, bad option, bad superblock on 
/dev/nvme0n1p6, missing codepage or helper program, or other error.

[  375.964495] BTRFS info (device nvme0n1p6): disk space caching is 
enabled
[  375.964499] BTRFS info (device nvme0n1p6): has skinny extents
[  375.977169] BTRFS warning (device nvme0n1p6): checksum verify failed 
on 21348679680 wanted 0xd05bf9be found 0x2874489b level 1
[  375.977179] BTRFS error (device nvme0n1p6): failed to read block 
groups: -5
[  375.978953] BTRFS error (device nvme0n1p6): open_ctree failed

Check fails to run:

$ sudo btrfs check /dev/nvme0n1p6
Opening filesystem to check...
checksum verify failed on 21348679680 wanted 0xd05bf9be found 0x2874489b
checksum verify failed on 21348679680 wanted 0xd05bf9be found 0x2874489b
Csum didn't match
ERROR: failed to read block groups: Input/output error
ERROR: cannot open file system

usebackuproot didn't help either:

$ sudo mount -o rescue=usebackuproot /dev/nvme0n1p6 /mnt/
mount: /mnt: wrong fs type, bad option, bad superblock on 
/dev/nvme0n1p6, missing codepage or helper program, or other error.

I tried btrfs rescue but it didn't lead to a mountable fs:

$ sudo btrfs rescue super-recover /dev/nvme0n1p6
All supers are valid, no need to recover

$ sudo btrfs rescue zero-log /dev/nvme0n1p6
Clearing log on /dev/nvme0n1p6, previous log_root 21344239616, level 0

$ sudo btrfs rescue chunk-recover /dev/nvme0n1p6
Scanning: DONE in dev0
Check chunks successfully with no orphans
Chunk tree recovered successfully

I did manage to recover some data with btrfs restore (no idea how much 
of it):

$ sudo btrfs restore /dev/nvme0n1p6 
/run/media/liveuser/3ea0705c-21c9-4ba9-80ee-5a511cb2a093/nvme0n1p6_restore/
Skipping snapshot snapshot
[...lots of snapper snapshots]
Skipping snapshot root

I really did want to use rescue=skipbg 
(https://lwn.net/Articles/822242/) or rescue=onlyfs 
(https://lwn.net/ml/linux-btrfs/20200701144438.7613-1-josef@toxicpanda.com/) 
but it seems that neither managed to reach upstream :(

btrfs restore really sucks compared to the previous recovery options 
because it gives you no way to list your subvolumes or to recover a 
specific snapshot.

I've also looked at 
https://en.opensuse.org/SDB:BTRFS#How_to_repair_a_broken.2Funmountable_btrfs_filesystem 
to see if I had any other options left, but it seems I will have to 
reinstall from scratch.

We truly need a better way to recovery-mount partitions, along w/ better 
tools to at least *try* fixing them.

Niccolo'

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-09-13 20:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 10:27 Unmountable / uncheckable Fedora 34 btrfs: failed to read block groups: -5 open_ctree failed Niccolò Belli
2021-09-12 10:44 ` Niccolò Belli
2021-09-12 10:46   ` Niccolò Belli
2021-09-12 11:14 ` Qu Wenruo
2021-09-12 11:41   ` Niccolò Belli
2021-09-12 13:35     ` Qu Wenruo
2021-09-12 15:51       ` Niccolò Belli
2021-09-13 14:50         ` Zygo Blaxell
2021-09-13 20:40           ` Niccolò Belli
2021-09-12 21:23   ` Niccolò Belli
2021-09-12 23:55     ` Qu Wenruo
2021-09-13  7:16       ` Niccolò Belli
2021-09-13  8:05         ` Qu Wenruo
2021-09-13 11:58           ` Niccolò Belli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.