public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Niccolò Belli" <darkbasic@linuxsystems.it>
To: linux-btrfs@vger.kernel.org
Subject: Unmountable / uncheckable Fedora 34 btrfs: failed to read block  groups: -5 open_ctree failed
Date: Sun, 12 Sep 2021 06:27:21 -0400	[thread overview]
Message-ID: <0303d1f618b815714fe62a6eb90f55ca@linuxsystems.it> (raw)

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'

             reply	other threads:[~2021-09-12 10:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-12 10:27 Niccolò Belli [this message]
2021-09-12 10:44 ` Unmountable / uncheckable Fedora 34 btrfs: failed to read block groups: -5 open_ctree failed 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0303d1f618b815714fe62a6eb90f55ca@linuxsystems.it \
    --to=darkbasic@linuxsystems.it \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox