Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm trying to script the RAID setup for a (growing) number of identical servers. The advice I've seen for using mdadm suggests that once the RAID array has been created you can run mdadm --examine --scan >> /etc/mdadm.conf so that the array is initialised on bootup. But that doesn't seem to work for me - in particular the array is presented as /dev/md/<hostname>:pool, where the mdadm --examine outputs /dev/md/pool.

Am I doing something wrong? Is there something odd about my version of mdadm?

[root@positron /]# mdadm --create /dev/md0 --level=0 --name=pool --raid-devices=6 /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf
[root@positron /]# mdadm --examine --scan
ARRAY /dev/md/pool metadata=1.2 UUID=567da122:fb8e445e:55b853e0:81bd0a3e name=positron:pool
[root@positron /]# ls /dev/md/*
/dev/md/md-device-map  /dev/md/positron:pool
[root@positron /]# cat /dev/md/md-device-map
md127 1.2 22a17d56:5e448efb:e053b855:3e0abd81 /dev/md/positron:pool
[root@positron /]# mdadm --version
mdadm - v3.1.3 - 6th August 2010
share|improve this question
    
Are you running udev? I've come across a few issues on debian where udev wasn't assigning the right device. –  Thomas James Nov 3 '11 at 12:34
    
Yes, on RHEL rather than Debian, but running udev. Not sure quite what to do with this tip, but I'll go Googling. –  David Waller Nov 3 '11 at 13:38
    
Do you get problems when omitting the --name option during creation? –  Nils Nov 7 '11 at 21:19
    
I think in that case I got /dev/md/positron:0 –  David Waller Nov 22 '11 at 16:50
add comment

3 Answers

And here's the fix, I'm not entirely clear on why it works, but it does!

After updating your mdadm file following the RAID array creation - usually with something like mdadm --detail --scan >> /etc/mdadm/mdadm.conf

Simply run the following command update-initramfs -u

Then reboot, and everything will work as expected.

Voila ;)

share|improve this answer
add comment

I've found that I've had to manually edit both the mdadm.conf and udev.conf to get the manual device names to hold.

However, I've not found it to be an issue one LVM is layered on top.

share|improve this answer
add comment

I don't see what's the problem. Array will be assembled on boot okay, even if it would be only mentioned with its UUID.

share|improve this answer
add comment

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.