linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthias Urlichs <matthias@urlichs.de>
To: linux-raid@vger.kernel.org
Subject: [PATCH] Re: raid6 recovery with read errors
Date: Tue, 22 Sep 2009 10:56:58 +0000 (UTC)	[thread overview]
Message-ID: <h9aahq$e1m$1@ger.gmane.org> (raw)
In-Reply-To: h5ttls$g3u$1@ger.gmane.org


>> [ block-level restoration of RAID6 data ] Is there a standalone program
>> that can do that?
> 
> Seems that the answer is "no", at least as far as anybody on this list
> is concerned.
> 
> *Sigh* So I'll have to write one, it seems.

The code is available from http://netz.smurf.noris.de/git/mdadm.git 
(branch "repair"). This is off mdadm's 3.1 development branch; the bugfix 
changes since 3.0 have been merged in.

Restoration of RAID5 and RAID6 partitions is tested, given a workable 
badblock list (i.e. ddrescue's log). Restoration of RAID6 and purging 
unrecoverable ranges (plus restoring the parity sectors) is untested.

The test suite includes a helper program which can find bad parity or 
inconsistent RAID1. I didn't add an option to mdadm to do that, because 
I'm lazy :-P besides, the kernel can do that already.

Also included are some changes in the test suite which ensure that the 
test suite works on a machine which has udev running -- or loopback or 
raid drivers in use. :-/

Usage: mdadm --repair-blocks=0:bad-sda1.log,1:bad-sdb1.log /dev/sd[a-d]1
(The numbers correspond to the disk numbers within the RAID, not to the 
n'th non-option argument.) Specifying a UUID instead of a bunch of 
devices should also work, but is untested.

Any feedback is of course welcome.

Now for the difficult part -- how to do automagic remapping. I tend to 
think that extending the staging/cowloop (copy-on-write) driver to be a 
coeloop (copy-on-error) driver would be a good idea. (It should also be 
possible to force a copy of the RAID superblocks, and overwrite that with 
some sort of cowloop metadata on the original disk, so that the kernel 
doesn't mount the underlying device with its obsolete blocks. :-/ )

TODO: (a) containers. Somebody else please uncomment and re-enable the 
code in Repair.c; (b) testing of RAID1 and uuid-etc.-based RAID selection,
(c) auto-selection among 'identical' RAID partitions, if scanning finds 
more than one (the idea is to choose the partition that's _not_ on the 
device where the superblock says it should be, assuming identical event 
numbers).

I haven't tested this on my production system yet -- that's the next 
step. But the test suite says it should work. Famous last words. :-P


      reply	other threads:[~2009-09-22 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03  8:36 raid6 recovery with read errors Matthias Urlichs
2009-08-12  8:14 ` Matthias Urlichs
2009-09-22 10:56   ` Matthias Urlichs [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='h9aahq$e1m$1@ger.gmane.org' \
    --to=matthias@urlichs.de \
    --cc=linux-raid@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).