linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mihai Lazarescu <mtlagm@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Re: Recovering suddenly corrupt Btrfs partition?
Date: Sat, 24 Sep 2022 21:58:53 +0200	[thread overview]
Message-ID: <Yy9hfbPwK0yFlNA/@lazarescu.org> (raw)
In-Reply-To: <CAPXZLEraHWJRj+QQ+RRGhEB4K4+_4tuUo+r80mzbfYRkpnhaPA@mail.gmail.com>

On Thursday, September 22, 2022 at 22:16:33 -0700, Daniel Trescott wrote:

> If anyone could please advise me on how to get the partition into a
> usable read-only state, I'd be extremely grateful. Thank you!

> [ 8613.636194] BTRFS error (device sda3): parent transid verify failed
> on 66931867648 wanted 541837 found 541832

Important disclaimer: I'm only a user, not developer. I just 
share my own experience, without any deeper knowledge of BTRFS.

"parent transid verify failed" is what I got (then I discovered 
that the disk also had bad sectors).

First think first, I strongly recommend you to do a byte-by-byte 
copy (image) of the full faulty disk. You can use dd or, if you 
have bad or unreliable sectors, ddrescue is doing a much better 
job (can install it with dnf).

In my case I could not mount the disk, not even with the second 
or third superblock copy.

So I used

btrfs-find-root /dev/...

to discover potential root candidates, then I used

btrfs restore -m -S -i -t <id> /dev/... <some_dir_with_enough_free_space> 2>&1 | grep -v '^trying another mirror$' | tee btrfs-restore.log

with <id> the highest that works.

My BTRFS FS was plain (no snapshots, etc.). Here are some 
additional details: https://btrfs.wiki.kernel.org/index.php/Restore

Hope this helps.

Mihai

      reply	other threads:[~2022-09-24 20:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23  5:16 Recovering suddenly corrupt Btrfs partition? Daniel Trescott
2022-09-24 19:58 ` Mihai Lazarescu [this message]

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=Yy9hfbPwK0yFlNA/@lazarescu.org \
    --to=mtlagm@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).