Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a home media server running on openSUSE 12.2. I'm using eight 2TB drives in a RAID-10 configuration. I deliberately bought two different types of drives: four Seagate Barracuda Green and four Western Digital Red. My goal is to configure the RAID such that each mirrored pair within the array will consist of dissimilar drives (ie, one Seagate drive and one WD drive). YaST2 Partitioner unfortunately did not give me this level of choice in the structure of the array, so now I'm trying to find out what the default RAID10 structure looks like.

I do know the following:

  • sdc, sdd, sde, and sdf are all WD drives
  • sdg, sdh, sdi, and sdj are all Seagate drives

I chose the default 'n2' layout when creating the RAID. My guess based upon info from these two sources is that adjacent drives are mirrored (ie, sdc==sdd, sde==sdf, etc), but I want to know for sure:

Here is the output of 'mdadm --detail /dev/md0':

/dev/md0:
        Version : 1.0
  Creation Time : Sat Mar 16 12:55:11 2013
     Raid Level : raid10
     Array Size : 7814045696 (7452.05 GiB 8001.58 GB)
  Used Dev Size : 1953511424 (1863.01 GiB 2000.40 GB)
   Raid Devices : 8
  Total Devices : 8
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Sat Mar 16 13:09:37 2013
          State : active, resyncing
 Active Devices : 8
Working Devices : 8
 Failed Devices : 0
  Spare Devices : 0

         Layout : near=2
     Chunk Size : 2048K

  Resync Status : 1% complete

           Name : aldaris:0  (local to host aldaris)
           UUID : c6cc3943:97394500:b77d44cd:f02ed876
         Events : 149

    Number   Major   Minor   RaidDevice State
       0       8       33        0      active sync   /dev/sdc1
       1       8       49        1      active sync   /dev/sdd1
       2       8       65        2      active sync   /dev/sde1
       3       8       81        3      active sync   /dev/sdf1
       4       8       97        4      active sync   /dev/sdg1
       5       8      113        5      active sync   /dev/sdh1
       6       8      129        6      active sync   /dev/sdi1
       7       8      145        7      active sync   /dev/sdj1

And here are the contents of /proc/mdstat:

Personalities : [raid10] md0 : active raid10 sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[3] sde1[2] sdd1[1] sdc1[0]
      7814045696 blocks super 1.0 2048K chunks 2 near-copies [8/8] [UUUUUUUU]
      [>....................]  resync =  4.8% (375163456/7814045696) finish=1206.5min speed=102751K/sec
      bitmap: 57/59 pages [228KB], 65536KB chunk

unused devices: <none>

So my questions are:

  1. How do I tell which drives are mirrors of each other?
  2. Is there a way to change this, or should I just swap the wires around (since that will swap the drive letters) and then rebuild the RAID?

Thanks in advance.


Tangential note, for anyone wants to know my reasoning for doing this is: Drives of the same model and batch, operated under similar usage loads, uptime, and temperature have little systematic variation, and differences in time to failure between drives will be primarily driven by random variation in the manufacturing process. This increases the risk of multiple drives dying at once. By purchasing drives not just from different batches but completely different manufacturers, I am introducing systematic variation into my array, thus influencing which drives will fail at similar times.

share|improve this question

migrated from serverfault.com Mar 17 '13 at 12:21

This question came from our site for system and network administrators.

1  
Home media servers are off-topic for ServerFault. That said, you clearly put some effort into this and I'm going to flag it for migration to unix.SE. –  Andrew B Mar 16 '13 at 18:26
    
@AndrewB, why is that? –  poige Mar 16 '13 at 19:56
    
It's a very interesting question and the reasoning behind is so well understood. You don't have to change wires since just to specify disk in when (re-)creating RAID is much more simpler. –  poige Mar 16 '13 at 20:03
    
@poige This falls under anything in a home setting. I tried to make it clear that I considered the question adequately researched despite this. –  Andrew B Mar 16 '13 at 20:19
    
If I were to wildly speculate, then I would guess that you could look at the RaidDevice column. It might be as simple as (0,1),(2,3),(4,5),(6,7). That would make me assume that you need to make RaidDevice line up like WD/Sea/WD/Sea/etc... But I am not 100% certain about that. –  Zoredache Mar 16 '13 at 20:26

3 Answers 3

I think you are talking about a real raid 10 array (1+0 striped mirroring)

sdc/sdg = md0 raid1 2TB |
sdd/sdh = md1 raid1 2TB |_  md4 raid0 8TB
sde/sdi = md2 raid1 2TB |
sdf/sdj = md3 raid1 2TB |

1. Create your 4 raid1 arrays:

mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/{sdc,sdg}
mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/{sdd,sdh}
mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/{sde,sdi}
mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/{sdf,sdj}

At this time you have 4 raid 1 arrays with 2TB space on each,

2. Let's assemble them!

mdadm --create /dev/md4 --run --level=0 --raid-devices=4 /dev/md{0,1,2,3}

--run options is usefull because some components are active in another array

3. Adapt your mdadm.conf file

You may need (depending of your configuration) to adapt this file to reflect changes about our new array (/dev/md4).

4. Enjoy.. Your new DIY raid10 array!

share|improve this answer
    
No, he's talking about linux's mdadm raid10 personality. I believe your answer doesn't apply (although, to be fair, it does give the OP an alternative to achieve what he needs to do) –  gnp Jun 5 at 23:49

You can always verify which are mirrors by a crude manner of comparing the data, for example:

# dd if=/dev/sda1 bs=1M skip=10 count=50 2> /dev/null | md5sum -
7c01afa434fc74aeddc8ec0546e4c332  -
# dd if=/dev/sdb1 bs=1M skip=10 count=50 2> /dev/null | md5sum -
1f0f8166857710d555cb35db4a23891a  -
# dd if=/dev/sdg1 bs=1M skip=10 count=50 2> /dev/null | md5sum -
7c01afa434fc74aeddc8ec0546e4c332  -
# dd if=/dev/sdf1 bs=1M skip=10 count=50 2> /dev/null | md5sum -
1f0f8166857710d555cb35db4a23891a  -

(if you don't get any matches, you may need to increase skip=, as you're not skipping over RAID superblocksl; and if you get same md5sum for more than 2 disks, you may need to increase count=, as you're probably reading and m5summing zeros - to prevent that you should put some data on the raid first, otherwise they might be full of zeroes)

As for the swapping wires around, you don't need to do that - mdadm should create raid with devices as specified on command line in mdadm --create, so you would just specify drives in different order on command line.

share|improve this answer

Run "mdadm --examine device" on each component device (i.e. /dev/sda1, /dev/sdb1, etc.). The information there should help you determine which components are each others' mirror.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.