linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Murphy <lists@colorremedies.com>
To: "Konstantin V. Gavrilenko" <k.gavrilenko@arhont.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: how to recover data from formatted btrfs partition
Date: Sun, 28 Jul 2019 17:07:33 -0600	[thread overview]
Message-ID: <CAJCQCtR2LaLriC7cxFwxxztWZWEZSx-vJP2YLEwpoJWy7ivgdQ@mail.gmail.com> (raw)
In-Reply-To: <1244295486.47.1564331283120.JavaMail.gkos@xpska>

On Sun, Jul 28, 2019 at 10:36 AM Konstantin V. Gavrilenko
<k.gavrilenko@arhont.com> wrote:
>
> Hi list,
>
> I accidentally formatted the existing btrfs partition today with mkfs.btrfs
> Partition obviously table remained intact, while all three superblock 0,1,2 correspond to the new btrfs UUID.
> The original partition was daily snapshotted and was mounted using "compress-force=lzo,space_cache=v2" so I guess the recovery using photorec would be troublesome.
>
> Is there any chance to recover the data?
> Any ideas or advices would be highly appreciated.

mkfs.btrfs doesn't write that much data, but does zero some other
things out to avoid later confusion so it's plausible some of the
previous btrfs has already been damaged by those overwrites. But if
you ignore that, I bet you can reconstruct the old super and at least
do a read only mount of the previous file system, and at least get a
backup.

The hard part is finding the start LBA for all the roots, and the
physical address for the system chunk so that you can populate the
system chunk array field in the super block correctly. It's mainly a
question of time and effort, there's no tool that can do this for you,
it's pretty much a manual process.


-- 
Chris Murphy

  reply	other threads:[~2019-07-28 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-28 16:28 how to recover data from formatted btrfs partition Konstantin V. Gavrilenko
2019-07-28 23:07 ` Chris Murphy [this message]
2019-07-30  9:22 ` Konstantin V. Gavrilenko
2019-08-08 14:23 ` Konstantin V. Gavrilenko

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=CAJCQCtR2LaLriC7cxFwxxztWZWEZSx-vJP2YLEwpoJWy7ivgdQ@mail.gmail.com \
    --to=lists@colorremedies.com \
    --cc=k.gavrilenko@arhont.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).