From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/4] add super-recover tool to recover bad supers
Date: Wed, 18 Sep 2013 16:27:32 +0800 [thread overview]
Message-ID: <1379492856-30639-1-git-send-email-wangsl.fnst@cn.fujitsu.com> (raw)
Until now if one of device's first superblock is corrupt,btrfs will
fail to mount. Luckily, btrfs have at least two superblocks for
every disk.
In theory, if silent corrupting happens when we are writting
superblocks into disk, we must hold at least one good superblock.
One side effect is that user must gurantee that the disk must be
a btrfs disk. Otherwise, this tool may destroy other fs.(This is
also reason why btrfs only use first superblock in every disk to mount)
This little program will scan devices and find good superblocks
(max generation, checksum matched). And use this superblock to
recover bad superblocks.The process is:
Step1: scan btrfs devices
Step2: find good supers
Step3: open ctree
Step4: writ all supers
We pass the latest good supers into open_ctree() and open_ctree()
will recalucate every superblock's dev_item by searching chunk tree.
Notice: This patchset based on David's dev/rescue branch
Wang Shilong (4):
Btrfs-progs: do not run ioctls in check_mounted_where()
Btrfs-progs: pass flag to control whether run ioctl in
btrfs_scan_for_fsid()
Btrfs-progs: move ask_user() to utils.c
Btrfs-progs: add super-recover to recover bad supers
Makefile | 2 +-
btrfs-find-root.c | 2 +-
chunk-recover.c | 20 +---
cmds-rescue.c | 55 ++++++++++
commands.h | 2 +
disk-io.c | 37 +++++--
disk-io.h | 5 +-
super-recover.c | 323 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
utils.c | 20 +++-
utils.h | 1 +
10 files changed, 437 insertions(+), 30 deletions(-)
create mode 100644 super-recover.c
--
1.8.3.1
next reply other threads:[~2013-09-18 8:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-18 8:27 Wang Shilong [this message]
2013-09-18 8:27 ` [PATCH 1/4] Btrfs-progs: do not run ioctls in check_mounted_where() Wang Shilong
2013-09-18 8:27 ` [PATCH 2/4] Btrfs-progs: pass flag to control whether run ioctl in btrfs_scan_for_fsid() Wang Shilong
2013-09-18 8:27 ` [PATCH 3/4] Btrfs-progs: move ask_user() to utils.c Wang Shilong
2013-09-18 8:27 ` [PATCH 4/4] Btrfs-progs: add super-recover to recover bad supers Wang Shilong
2013-09-18 15:13 ` David Sterba
2013-09-18 15:31 ` Wang Shilong
2013-09-18 16:31 ` David Sterba
2013-09-21 1:16 ` Wang Shilong
2013-09-23 12:10 ` [offlist] " David Sterba
2013-09-18 15:18 ` [PATCH 0/4] add super-recover tool " David Sterba
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=1379492856-30639-1-git-send-email-wangsl.fnst@cn.fujitsu.com \
--to=wangsl.fnst@cn.fujitsu.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).