linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re-arranged Drives in MDADM?
@ 2010-01-28 18:58 Carlos Williams
  2010-01-28 21:39 ` Robin Hill
  0 siblings, 1 reply; 4+ messages in thread
From: Carlos Williams @ 2010-01-28 18:58 UTC (permalink / raw)
  To: linux-raid

I new system was built today and I don't understand why the drives are
out of order. I don't think it matters but I wanted to ask here. I am
100% sure I specified /dev/sdd2 to be my spare device but when I now
check mdadm, it does not appear this way...

[root@tuna ~]# mdadm --detail /dev/md0
/dev/md0:
        Version : 0.90
  Creation Time : Thu Jan 28 06:59:49 2010
     Raid Level : raid5
     Array Size : 480391552 (458.14 GiB 491.92 GB)
  Used Dev Size : 240195776 (229.07 GiB 245.96 GB)
   Raid Devices : 3
  Total Devices : 4
Preferred Minor : 0
    Persistence : Superblock is persistent

    Update Time : Thu Jan 28 13:50:40 2010
          State : clean
 Active Devices : 3
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 1

         Layout : left-symmetric
     Chunk Size : 64K

           UUID : c935f1cc:af72fc84:c89aa428:f91eeb1b
         Events : 0.471

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2
       2       8       50        2      active sync   /dev/sdd2

       3       8       34        -      spare   /dev/sdc2


As you can see it has my /dev/sdc2 instead of /dev/sdd2 as my spare.
The problem is the drives are physically labeled on the chasis and I
was wondering why it did this and also can it be fixed. Can I move
/dev/sdd2 from number '2' position to my spare and then move /dev/sdc2
as an active member of the raid? The /dev/md0 is my entire / partition
so anything that requires me stopping the RAID becomes a little
difficult.

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

* Re: Re-arranged Drives in MDADM?
  2010-01-28 18:58 Re-arranged Drives in MDADM? Carlos Williams
@ 2010-01-28 21:39 ` Robin Hill
  2010-01-29  9:40   ` Neil Brown
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Hill @ 2010-01-28 21:39 UTC (permalink / raw)
  To: linux-raid

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

On Thu Jan 28, 2010 at 01:58:20PM -0500, Carlos Williams wrote:

> I new system was built today and I don't understand why the drives are
> out of order. I don't think it matters but I wanted to ask here. I am
> 100% sure I specified /dev/sdd2 to be my spare device but when I now
> check mdadm, it does not appear this way...
> 
> [root@tuna ~]# mdadm --detail /dev/md0
> /dev/md0:
>         Version : 0.90
>   Creation Time : Thu Jan 28 06:59:49 2010
>      Raid Level : raid5
>      Array Size : 480391552 (458.14 GiB 491.92 GB)
>   Used Dev Size : 240195776 (229.07 GiB 245.96 GB)
>    Raid Devices : 3
>   Total Devices : 4
> Preferred Minor : 0
>     Persistence : Superblock is persistent
> 
>     Update Time : Thu Jan 28 13:50:40 2010
>           State : clean
>  Active Devices : 3
> Working Devices : 4
>  Failed Devices : 0
>   Spare Devices : 1
> 
>          Layout : left-symmetric
>      Chunk Size : 64K
> 
>            UUID : c935f1cc:af72fc84:c89aa428:f91eeb1b
>          Events : 0.471
> 
>     Number   Major   Minor   RaidDevice State
>        0       8        2        0      active sync   /dev/sda2
>        1       8       18        1      active sync   /dev/sdb2
>        2       8       50        2      active sync   /dev/sdd2
> 
>        3       8       34        -      spare   /dev/sdc2
> 
> 
> As you can see it has my /dev/sdc2 instead of /dev/sdd2 as my spare.
> The problem is the drives are physically labeled on the chasis and I
> was wondering why it did this and also can it be fixed. Can I move
> /dev/sdd2 from number '2' position to my spare and then move /dev/sdc2
> as an active member of the raid? The /dev/md0 is my entire / partition
> so anything that requires me stopping the RAID becomes a little
> difficult.
> 
When you created the array, it would have started as a degraded array
(using sda2 and sdb2), with the other two as spares.  The array is then
recovered using one of the spare drives - I don't know whether there's
any way to specify which though (other than creating with just three,
and adding the fourth after the rebuild has finished).

If you really want the two swapped (not sure why - any failure will
cause this to change anyway), you can fail & remove sdd2, then re-add it
after the recovery to sdc2 has completed.  This won't stop the array
from running, but does leave you at risk of total failure until the
rebuild completes.

Cheers,
    Robin
-- 
     ___        
    ( ' }     |       Robin Hill        <robin@robinhill.me.uk> |
   / / )      | Little Jim says ....                            |
  // !!       |      "He fallen in de water !!"                 |

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: Re-arranged Drives in MDADM?
  2010-01-28 21:39 ` Robin Hill
@ 2010-01-29  9:40   ` Neil Brown
  2010-01-29 14:02     ` Carlos Williams
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Brown @ 2010-01-29  9:40 UTC (permalink / raw)
  To: Robin Hill; +Cc: linux-raid

On Thu, 28 Jan 2010 21:39:24 +0000
Robin Hill <robin@robinhill.me.uk> wrote:


> If you really want the two swapped (not sure why - any failure will
> cause this to change anyway), you can fail & remove sdd2, then re-add it
> after the recovery to sdc2 has completed.  This won't stop the array
> from running, but does leave you at risk of total failure until the
> rebuild completes.

Or possibly shut down, physically swap the devices, and the start up again.

NeilBrown

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

* Re: Re-arranged Drives in MDADM?
  2010-01-29  9:40   ` Neil Brown
@ 2010-01-29 14:02     ` Carlos Williams
  0 siblings, 0 replies; 4+ messages in thread
From: Carlos Williams @ 2010-01-29 14:02 UTC (permalink / raw)
  To: linux-raid

On Fri, Jan 29, 2010 at 4:40 AM, Neil Brown <neilb@suse.de> wrote:
> Or possibly shut down, physically swap the devices, and the start up again.

I noticed when I created the RAID5 array on my Linux server using the
mdadm command:

mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/sda2 /dev/sdb2
/dev/sdc2 --spare-devices=1 /dev/sdd2

The above command create a /etc/mdadm.conf file which showed 2 spare
devices because one of the spares was rebuilding as the 3rd member of
the RAID5 array. Once the rebuild / sync was complete on /dev/sdc2, it
would not longer show as a spare. My question is does the data in
/etc/mdadm.conf need to be accurate after the RAID has been created
and established? Once the rebuild was complete and all 3 drives were
synced, the mdadm.conf file was never updated so I deleted the
contents of the file and ran:

mdadm -D --scan >> /etc/mdadm.conf

I didn't see a real reason to do so but I did it just to be consistent
with my system and avoid issues later.

Does anyone have any thoughts on this?

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

end of thread, other threads:[~2010-01-29 14:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-28 18:58 Re-arranged Drives in MDADM? Carlos Williams
2010-01-28 21:39 ` Robin Hill
2010-01-29  9:40   ` Neil Brown
2010-01-29 14:02     ` Carlos Williams

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