From: Chris Dunlop <chris@onthe.net.au>
To: Wols Lists <antlists@youngman.org.uk>
Cc: Brad Campbell <lists2009@fnarfbargle.com>, linux-raid@vger.kernel.org
Subject: Re: Rewrite md raid1 member
Date: Fri, 19 Aug 2016 22:46:15 +1000 [thread overview]
Message-ID: <20160819124615.GA23247@onthe.net.au> (raw)
In-Reply-To: <57B6F2F5.8090800@youngman.org.uk>
On Fri, Aug 19, 2016 at 12:52:21PM +0100, Wols Lists wrote:
> On 18/08/16 05:01, Chris Dunlop wrote:
>> I'm interested to see if there's a way of essentially doing the above on a
>> live system, assuming there's appropriate care taken to not trash any
>> existing data (including superblocks).
>>
>> I.e. is it *theoretically* possible to write the same data back to the whole
>> disk safely. E.g. using 'dd' from/to the same disk is almost there, but, as
>> described, there's a window of opportunity where you could get stale data on
>> the disk and a raid repair could then copy that stale data to the good disk.
>
> There is something called "scrub". My superficial knowledge of raid
> doesn't let me know what it is, but as far as I can make out it forces a
> whole-disk-write or somesuch. Explicitly to flush out such problems. If
> someone else can tell you how to scrub your disks, I'd try that.
A scrub will read the RAID members to check that both sides match (raid 1,
10), or that the checksum is correct (raid 4,5,6).
To initiate a scrub of md0:
echo repair > /sys/block/md0/md/sync_action
You can watch it using /proc/mdstat, e.g.:
watch cat /proc/mdstat
It won't write anything if it doesn't detect any errors.
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?
Cheers,
Chris
next prev parent reply other threads:[~2016-08-19 12:46 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 [this message]
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
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=20160819124615.GA23247@onthe.net.au \
--to=chris@onthe.net.au \
--cc=antlists@youngman.org.uk \
--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).