Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I use a RAID0 (md2) as a device in a RAID5 (md3) setup (see below). Now everytime the computer boots, mdadm will mark md3 as degraded and i am forced to re-add md2 as a new spare. Of course mdadm then starts resyncing/recovering.

Is there a way to tell mdadm to wait for md2 before assembling md3 on boot time, or another solution to this problem?

System (Ubuntu 12.10 Server 64bit):

$ uname -a
Linux nas-server.local 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# mdadm --detail --scan 
ARRAY /dev/md/2 metadata=1.2 name=lubuntu:1 UUID=70bdbcc1:a423c042:e798e197:56cc4396
ARRAY /dev/md/3 metadata=1.2 spares=1 name=lubuntu:0 UUID=bce57189:aa8ae91a:a1268e87:bef78ff4
ARRAY /dev/md/1 metadata=1.2 name=nas-server:1 UUID=fdc6b691:3ca45346:3b493827:8ca7ed4e
ARRAY /dev/md/0 metadata=1.2 name=nas-server:0 UUID=3bad2d5c:68517cb9:34631143:27c21bd1

Array /dev/md/2 is used as an active drive in /dev/md/3:

# mdadm --detail /dev/md2
/dev/md2:
Version : 1.2
Creation Time : Thu Mar 14 10:00:09 2013
Raid Level : raid0
Array Size : 2930276864 (2794.53 GiB 3000.60 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent

Update Time : Thu Mar 14 10:00:09 2013
State : clean 
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Chunk Size : 512K

Name : lubuntu:1
UUID : 70bdbcc1:a423c042:e798e197:56cc4396

Number   Major   Minor   RaidDevice State
0       8       64        0      active sync   /dev/sde
1       8       80        1      active sync   /dev/sdf

/dev/md3:
Version : 1.2
Creation Time : Thu Mar 14 10:00:49 2013
Raid Level : raid5
Array Size : 5860270080 (5588.79 GiB 6000.92 GB)
Used Dev Size : 2930135040 (2794.39 GiB 3000.46 GB)
Raid Devices : 3
Total Devices : 3
Persistence : Superblock is persistent

Update Time : Mon Mar 18 14:56:49 2013
State : clean, degraded, recovering 
Active Devices : 2
Working Devices : 3
Failed Devices : 0
Spare Devices : 1

Layout : left-symmetric
Chunk Size : 512K

Rebuild Status : 12% complete

Name : lubuntu:0
UUID : bce57189:aa8ae91a:a1268e87:bef78ff4
Events : 25514

Number   Major   Minor   RaidDevice State
4       8       32        0      active sync   /dev/sdc
1       8       48        1      active sync   /dev/sdd
3       9        2        2      spare rebuilding   /dev/md/2
share|improve this question

2 Answers 2

I just had a very similar problem.

  1. In /etc/mdadm/mdadm.conf, place the drives in the order they should be assembled. I did not find that containers was necessary, though I did explicitly list the array in the devices.

    DEVICE partitions containers /dev/md/2
    ARRAY /dev/md/2 ...
    ARRAY /dev/md/3 ...
    
  2. Update the initramfs. This was critical to my debian 6 setup.

    update-initramfs -u
    
share|improve this answer

You realy need such crazy raid setup? O_o

Try adding to /etc/mdadm/mdadm.conf:

DEVICE partitions containers
ARRAY /dev/md/2 ...
ARRAY /dev/md/3 ...

Keyword 'containers' will cause mdadm to look for assembled arrays as source for assembling futher arrays.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.