# mdadm: failed to create /dev/md*

## jgentooj

Hi all,

I'm having a problem booting up my software raid. I set up raid1 following the instructions on http://gentoo-wiki.com/HOWTO_Gentoo_Install_on_Software_RAID#About_RAID. When I reboot I get the following error:

*Starting up RAID devices (mdadm) ...

mdadm: failed to create /dev/md1

mdadm: failed to create /dev/md2

mdadm: failed to create /dev/md3

mdadm: failed to create /dev/md4

Since the nodes do not exist, I then get the following: 

*Checking root filesystem...

fsck.ext3: No such file or directory while trying to open /dev/md3

I then can go into maintenance mode and verify that /dev/md* does not exist. However, cat /proc/mdstat gives me the following:

Personalities : [raid1]

md1 : active raid1 sdb1[1] sda1[0]

          40064 blocks [2/2] [UU]

md2 : active raid sdb2[1] sda2[0]

          4008128 blocks [2/2] [UU]

md3 : active raid sdb3[1] sda3[0]

          10008384 blocks [2/2] [UU]

md4 : active raid1 sdb4[1] sda4[0]

          142231360 blocks [2/2] [UU]

unused devices: <none>

When I booted up using the Gentoo install disk, I got the same error message when trying mdadm -As /dev/md1 (failed to create /dev/md1). So I ran MAKEDEV md and added the devices to my generated /etc/mdadm.conf like so: DEVICES=/dev/sd[ab][1234], then mdadm -As /dev/md{1,2,3,4} worked. 

My kernel is built from a manually configured gentoo-sources: 2.6.19-gentoo-r5

My question is how do I get these devices to be created at boot time so that the system will start?

Thanks!

-J

----------

## jvrodrigues

I once had a similar problem ( /boot on /dev/hda1 and / on a RAID0 /dev/hda3 & /dev/hdb2) and the raid0 would not start at boot-time.

I found out there were 2 ways to solve this problem.

1) new kernel made with genkernel and an initrd. the initrd detected that the real_root was a md device and it would assemble it.

2) read /usr/src/linux/Documentation/md.txt

added "root=/dev/md1 md=1,/dev/hda3,/dev/hdb2" to the kernel parameters.

----------

## jgentooj

Thanks for the post, I added the line to grub.conf as you suggested. Unfortunately, it didn't quite work, and I'm getting a different error.

dmesg now shows the following after the "... autorun DONE" message:

md: loading md: /dev/sda3

md: couldn't update array info. -22

md: cound not bd_claim sda3.

md: md_import_device returned -16

md: could not bd_claim sdb3.

md_import_device returned -16

md: starting md3 failed

some googling around suggests that those errors reflect a device being busy. I don't know why this would be, however.

Thanks,

J

----------

## bunder

 *jgentooj wrote:*   

> 
> 
> I then can go into maintenance mode and verify that /dev/md* does not exist.

 

recompile the kernel with the raid stuff built-in.  looks like you're missing the multi-disk driver.

cheers

----------

## jgentooj

Hi. 

That wasn't the problem either. I had the kernel support built in. 

Good news is that I was able to fix the problem by booting with the install CD, not binding /dev, chrooting and then running MAKEDEV md.

Thanks for your help!

-J

----------

