linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Got raid10 assembled wrong - how to fix?
@ 2008-02-12 16:59 George Spelvin
  2008-02-13  9:16 ` Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: George Spelvin @ 2008-02-12 16:59 UTC (permalink / raw)
  To: linux-raid; +Cc: linux

I just discovered (the hard way, sigh, but not too much data loss) that a
4-drive RAID 10 array had the mirroring set up incorrectly.

Given 4 drvies A, B, C and D, I had intended to mirror A<->C and B<->D,
so that I could split the mirror and run on either (A,B) or (C,D).

However, it turns out that the mirror pairs are A<->B and C<->D.  So
pulling both A and B off-line results in a non-functional array.

So basically what I need to do is to decommission B and C, and rebuild
the array with them swapped: A, C, B, D.

Can someone tell me if the following incantation is correct?

mdadm /dev/mdX -f /dev/B -r /dev/B
mdadm /dev/mdX -f /dev/C -r /dev/C
mdadm --zero-superblock /dev/B
mdadm --zero-superblock /dev/C
mdadm /dev/mdX -a /dev/C
mdadm /dev/mdX -a /dev/B

I'm assuming that fresh spares will be assigned to the lowest available
slot.  I just get nervous about commands with names like --zero-superblock
when I have data I'd rather not lose.

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Got raid10 assembled wrong - how to fix?
  2008-02-12 16:59 Got raid10 assembled wrong - how to fix? George Spelvin
@ 2008-02-13  9:16 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2008-02-13  9:16 UTC (permalink / raw)
  To: George Spelvin; +Cc: linux-raid

George Spelvin wrote:
> I just discovered (the hard way, sigh, but not too much data loss) that a
> 4-drive RAID 10 array had the mirroring set up incorrectly.
> 
> Given 4 drvies A, B, C and D, I had intended to mirror A<->C and B<->D,
> so that I could split the mirror and run on either (A,B) or (C,D).
> 
> However, it turns out that the mirror pairs are A<->B and C<->D.  So
> pulling both A and B off-line results in a non-functional array.
> 
> So basically what I need to do is to decommission B and C, and rebuild
> the array with them swapped: A, C, B, D.
> 
> Can someone tell me if the following incantation is correct?
> 
> mdadm /dev/mdX -f /dev/B -r /dev/B
> mdadm /dev/mdX -f /dev/C -r /dev/C
> mdadm --zero-superblock /dev/B
> mdadm --zero-superblock /dev/C
> mdadm /dev/mdX -a /dev/C
> mdadm /dev/mdX -a /dev/B

That should work.

But I think you'd better just physically swap the drives instead -
this way, no rebuilding the array will be necessary, and your data
will be safe all the time.

/mjt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-13  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-12 16:59 Got raid10 assembled wrong - how to fix? George Spelvin
2008-02-13  9:16 ` Michael Tokarev

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).