From: NeilBrown <neilb@suse.de>
To: starlight.2012q4@binnacle.cx
Cc: linux-raid@vger.kernel.org
Subject: Re: question: no-bitmap RAID1 with off-site drive
Date: Tue, 27 Nov 2012 13:31:55 +1100 [thread overview]
Message-ID: <20121127133155.2132a857@notabene.brown> (raw)
In-Reply-To: <6.2.5.6.2.20121118185613.05e63580@binnacle.cx>
[-- Attachment #1: Type: text/plain, Size: 3192 bytes --]
On Sun, 18 Nov 2012 19:11:56 -0500 starlight.2012q4@binnacle.cx wrote:
> Started playing with the third drive
> and my invented approach may not
> be correct. That, as recommended,
> using --grow to eliminate the offsite
> "removed" drive and put back the
> rotate-in drive is right.
>
> It looks like MD re-initializes the
> superblock (different UUID) when
> something like
>
> mdadm --grow --add --raid-devices=3 /dev/md3 /dev/sde
>
> is run, even if /dev/sde has a previous
> superblock from the same array. However
> I only tested it with a drive image that
> had not been fully synced and from the
> same (not different) array. Running
>
> mdadm --re-add /dev/md3 /dev/sde
>
> results 'mdadm' refusing the
> drive that had been from the
> same array (though not fully synced).
>
> Appears then that 'mdadm' may not
> check the superblock to see if the
> drive came from a different array
> and should not be overwritten, and
> instead prefers to just zap it.
Correct. When you ask mdadm to --add device to an array, that is what it
will do. If the metadata looks particularly good it might do a re-add for
you, but if not it will just erase it and write some more.
>
> Can anyone confirm or deny the
> possibility? I can manually run
> an --examine and check the array
> name as a precaution when rotating
> drives if 'mdadm' doesn't perform
> the check. Want to avoid inserting
> a offsite drive in the wrong array.
>
We might be able to make "mdadm -I" do what you want ... find out which array
it "should" be a member of and auto-add it.
But that will currently fail for an out-of-date member with no bitmap.
If you applied
http://git.neil.brown.name/?p=mdadm.git;a=commitdiff;h=75a410f6226d1e3ef441bbb8cd4f198d5de5cf5b
and put
policy action=force-spare
in mdadm.conf, it might work.
NeilBrown
>
>
>
> At 12:26 PM 11/12/2012 -0500, starlight.2012q4@binnacle.cx wrote:
> >After some pondering, think I've figure it out.
> >
> >Best way to go is to set it up with
> >
> > --create --level=1 --raid-devices=2
> >
> >for the initial pair of drives, then
> >
> > --fail --remove
> >
> >the rotate-out drive, then
> >
> > --add
> >
> >the alternate drive. Now there will be
> >three drive slots with one "removed" and two
> >"active".
> >
> >To rotate a drive off-site
> >
> > --fail --remove
> >
> >go to the off-site, swap the drives and on return
> >
> > --re-add
> >
> >the rotate-in drive.
> >
> >This way the 'mdadm' UUID labels will stay on the
> >drives and 'mdadm' will warn against mistakes
> >such as trying to use the wrong drive for
> >a mirror pair. Will always have one "removed"
> >drive.
> >
> >The
> >
> > --grow --raid-devices=1 --force
> >
> >and
> >
> > --grow --raid-devices=2 --add
> >
> >would be used only if a drive fails and needs to
> >be replaced.
> >
> >If anyone disagrees please advise.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2012-11-27 2:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-11 21:40 question: no-bitmap RAID1 with off-site drive starlight.2012q4
2012-11-11 22:14 ` starlight.2012q4
2012-11-12 3:40 ` Adam Goryachev
2012-11-12 14:55 ` starlight.2012q4
2012-11-12 17:56 ` Drew
[not found] ` <CACJz6Qt93zm47+576HSWBv+GGcNKKmz0G7+soAqPSMeBk2KFCg @mail.gmail.com>
2012-11-12 18:05 ` starlight.2012q4
2012-11-12 17:26 ` starlight.2012q4
2012-11-12 18:11 ` starlight.2012q4
2012-11-12 20:31 ` NeilBrown
2012-11-12 20:40 ` starlight.2012q4
2012-11-19 0:11 ` starlight.2012q4
2012-11-27 2:31 ` NeilBrown [this message]
2012-11-27 3:31 ` starlight.2012q4
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=20121127133155.2132a857@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=starlight.2012q4@binnacle.cx \
/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