# mdraid very slow to start in boot runlevel

## snzzbk

When I set the mdraid service to start in the 'boot' runlevel, it takes a very long time to start, proportional to the number of arrays (1-2 minutes for about 15 arrays). When it finally finishes, there are no named devices in /dev/md (only numbered ones) but everything works fine otherwise. If I set the service to start in the default runlevel or if I disable it and run mdadm -As on the command line, it finishes within seconds and the named devices are created properly, but that's too late for the dependent filesystems to be automounted.

These are the only relevant messages I can find:

```

...

Feb  4 20:04:18 ing mdadm[3372]: DeviceDisappeared event detected on md device /

dev/md/unsafe09

Feb  4 20:04:18 ing mdadm[3372]: DeviceDisappeared event detected on md device /

dev/md/unsafe08

Feb  4 20:04:18 ing mdadm[3372]: DeviceDisappeared event detected on md device /

dev/md/unsafe07

Feb  4 20:04:18 ing mdadm[3372]: DeviceDisappeared event detected on md device /

...

```

They come from the mdadm monitor and may be related to the lack of named devices.

Any ideas on how to fix this?

----------

## Goverp

Late bit of feedback, but I've just seen the same message and Google found your entry.

I'm running Gentoo on a 4-disk RAID5 array.  As I have my rootfs on the array, my kernel boot parameters include

```
root=/dev/md127p3 md=127,/dev/sda3,/dev/sdb3,/dev/sdc3,/dev/sdd3
```

to define the array.  This means that the kernel assembles the array, and /etc/init.d/mdraid doesn't do anything.  It also means that the array is called md127, whereas when I built it, my /etc/mdadm.conf called it "gentoo".  (Last time I checked, changing the boot parameters to say "md=gentoo,/dev/sda3..." didn't work; it has to be numeric.)

I had mdraid in my boot runlevel, but mdadm wasn't in any runlevel.  Now I've swapped them; mdraid was indeed unnecessary (serving only to generate an error message when it tried to close the array during shutdown), and mdadm now shows the DeviceDisappeared message for the "gentoo" array.  I think that makes sense, and maybe I should update mdadm.conf to use md127 as the array name.

If you also use either autodetect or boot parameters to get the kernel to assemble your array,. that might explain the message.

----------

