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

Upon boot it stuffs it up every time:

    [root][centos ~] cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] 
md127 : inactive sda[2] sdb[3]
      1953524992 blocks
unused devices: <none>
[root][centos ~] mdadm --stop /dev/md127 
mdadm: stopped /dev/md127
[root][centos ~] mdadm --assemble --scan
mdadm: /dev/md0 has been started with 4 drives.
[root][centos ~] cat /proc/mdstat 
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 sda1[0] sdd1[3] sdc1[2] sdb1[1]
      2930279424 blocks level 5, 1024k chunk, algorithm 2 [4/4] [UUUU]          
unused devices: <none>

You can see first it detects a BS md127, then I have to stop that one, then reassemble it, here's one weird thing, it detects two md0's but it's sucessful:

[root][centos ~] mdadm -Es 
ARRAY /dev/md0 UUID=39c28990:e753d835:8b94c90b:72da1a08
ARRAY /dev/md0 UUID=88edc937:2ecbc9bb:8b94c90b:72da1a08

my mdadm.conf

[root][centos ~] cat /etc/mdadm.conf
DEVICE partitions 
ARRAY /dev/md0 UUID=88edc937:2ecbc9bb:8b94c90b:72da1a08
MAILADDR root 
CREATE owner=root group=disk mode=0660 auto=yes
HOMEHOST <system>

But the weirdest thing, in dmesg, I think the problem lies here:

md: kicking non-fresh sdc from array!
md: unbind<sdc>
md: export_rdev(sdc)
md: kicking non-fresh sdd from array!
md: unbind<sdd>
md: export_rdev(sdd)
async_tx: api initialized (async)
xor: automatically using best checksumming function: generic_sse
   generic_sse:  6532.000 MB/sec
xor: using function: generic_sse (6532.000 MB/sec)
raid6: int64x1   1664 MB/s
raid6: int64x2   2148 MB/s
raid6: int64x4   1453 MB/s
raid6: int64x8   1457 MB/s
raid6: sse2x1    2417 MB/s
raid6: sse2x2    3222 MB/s
raid6: sse2x4    3429 MB/s
raid6: using algorithm sse2x4 (3429 MB/s)
md: raid6 personality registered for level 6
md: raid5 personality registered for level 5
md: raid4 personality registered for level 4
raid5: device sda operational as raid disk 2
raid5: device sdb operational as raid disk 3
raid5: allocated 4282kB for md127
2: w=1 pa=0 pr=4 m=1 a=2 r=4 op1=0 op2=0
3: w=2 pa=0 pr=4 m=1 a=2 r=4 op1=0 op2=0
raid5: not enough operational devices for md127 (2/4 failed)
RAID5 conf printout:
 --- rd:4 wd:2
 disk 2, o:1, dev:sda
 disk 3, o:1, dev:sdb
raid5: failed to run raid set md127
md: pers->run() failed ...
share|improve this question

4 Answers 4

You probably need to rebuild your initrd so that it has the correct mdadm.conf file in it because the boot process has to use that version until it can get the root filesystem mounted.

What you need to do is something like this:

mkinitrd /boot/initrd-<kernel-version>.img <kernel-version>

I'm assuming here that the CentOS version you're using is still using mkinitrd - if it has switched to dracut then you will want:

dracut /boot/initramfs-<kernel-version>.img <kernel-version>

In either case you will need to rename the old file first before you can build the new one.

share|improve this answer
    
The root file system is getting mounted no problems so I don't know if this step is necessary. The raid is on a different mount just for storage. –  beatbreaker Aug 7 '11 at 1:00

mdadm should be able to asseble a md device. It seems as it is seeing some wrong drives:

md127 : inactive sda[2] sdb[3]

That looks like it's taking the whole sda and sdb disks for the raid array, and not the partitions sda1 sdb1 sdc1 sdd1.

What does blkid show? what does mdadm -E /dev/sda or mdadm -E /dev/sdb show?

Maybe there is something strange going on with the superblocks.

As TomH said you should also try to rebuild initrd.

share|improve this answer
    
Ok blkid is here along with mdadm -E pastebin.com/gUM3S5dm I think I can see that md0 now has a completely different UUID in that output so I'll try that –  beatbreaker Aug 7 '11 at 1:04
    
The two UIDs should be the same, so try fixing that and see if it helps. But I don't know an easy way to do that. –  Jure1873 Aug 7 '11 at 16:13

In Ubuntu I solved this problem with this:

sudo update-initramfs -k all -u
share|improve this answer
up vote 0 down vote accepted

I think I found it, it was a problem with my mdadm.conf file not being specific enough and possibly confusing for the OS.

So I read this: http://manpages.ubuntu.com/manpages/hardy/man5/mdadm.conf.5.html

And I found that if I use this

DEVICE partitions

Then:

This will cause mdadm to read /proc/partitions and include all devices and partitions found therein

So I've changed it to

DEVICE /dev/sd[abcd]1

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.