linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <nfbrown@novell.com>
To: Chris Dunlop <chris@onthe.net.au>, Wols Lists <antlists@youngman.org.uk>
Cc: Brad Campbell <lists2009@fnarfbargle.com>, linux-raid@vger.kernel.org
Subject: Re: Rewrite md raid1 member
Date: Sat, 20 Aug 2016 07:26:27 +1000	[thread overview]
Message-ID: <87oa4oh2m4.fsf@notabene.neil.brown.name> (raw)
In-Reply-To: <20160819124615.GA23247@onthe.net.au>

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

On Fri, Aug 19 2016, Chris Dunlop wrote:

>
> In my case, I want it to write everything.
>
> If I do my 'dd' to write everything as previously described, with the window
> of opportunity for stale data to end up on the written disk, one option
> would to run a scrub / repair to check the data is the same - but if I'm
> unlucky with my dd and the data isn't the same for some sector[s], I want to
> ensure the correct data is copied over the stale data and not the other way
> around, e.g. to specify "in the event of a mismatch, use the data from sda
> and overwrite the data on sdb".
>
> Unfortunately I don't know how that can be done.
>
> Does anyone know?

If it is the second device in the array (as listed by mdadm --detail)
then you can stop the array and re-assemble with --update=resync.

If it is the first device I can only suggest that you
fail the device and add it again:

 mdadm /dev/mdXX --fail /dev/sdYY
 mdadm /dev/mdXX --remove /dev/sdYY
 mdadm /dev/mdYY --add /dev/sdYY

If the "good" drive fails during the rewrite it might be a little bit
fiddley getting the array working again, but all the data will certainly
be there on the device you are re-writing, so you won't lose anything.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  parent reply	other threads:[~2016-08-19 21:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-18  3:04 Rewrite md raid1 member Chris Dunlop
2016-08-18  3:27 ` Brad Campbell
2016-08-18  4:01   ` Chris Dunlop
2016-08-19 11:52     ` Wols Lists
2016-08-19 12:46       ` Chris Dunlop
2016-08-19 16:10         ` Chris Murphy
2016-08-20  1:43           ` Chris Dunlop
2016-08-20 10:44             ` Wols Lists
2016-08-19 21:26         ` NeilBrown [this message]
2016-08-20  1:57           ` Chris Dunlop
2016-08-20  6:52             ` NeilBrown

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=87oa4oh2m4.fsf@notabene.neil.brown.name \
    --to=nfbrown@novell.com \
    --cc=antlists@youngman.org.uk \
    --cc=chris@onthe.net.au \
    --cc=linux-raid@vger.kernel.org \
    --cc=lists2009@fnarfbargle.com \
    /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).