# udev + software raid problem - no devices at boot

## Klavs

Hi guys,

I've just installed a new machine with root (/) as /dev/md0 - I can see it fine from my livecd and /dev is populated with all the device nodes (incl. null) that comes with the 2004.3 release.

When I reboot the kernel finds the software raid, and starts the init process.

Then it says:

Mounting proc at /proc

mounting sysfs at /sys

mounting ramfs at /dev

configuring system to use udev...

   populating /dev with device nodes..

/sbin/rc: line 25: cannot redirect standard input from /dev/null: no such file or directory

and dies  :Sad: 

if I go in to admin mode (or whatever you want to call it) I can see /dev is indeed empty at this point.

It seems it would be empty because ramfs is mounted on /dev (and thus empty).

I was running udev-0.45 but read many fixed things by upgrading - so I tried upgrading to 0.50 - but no change  :Sad: 

Anyone has any idea what is wrong here? (ohh and btw. it's a SATA system - not running ICH raid - but linux software raid on /dev/hde1 and /dev/hdg1).

----------

## Klavs

It seems a combination of these (don't know which actually did the trick - although the tarball disabling seems to be it):

adding notail to reiserfs for /

setting:

/etc/conf.d/rc: RC_DEVICE_TARBALL="no" 

now it dies when trying to start my other raid devices  :Sad: 

there is only a /dev/md0 device - no /dev/md1 /dev/md2 etc.  :Sad: 

damn udev  :Sad: 

----------

## Klavs

I hacked mknod /dev/md1 b 9 1 (and md2 = b 9 2 etc.) into /etc/init.d/checkfs 

A crappy solution.

I'm running udev-050 now - which actually works with md devices (raid and md is NOT a module).

----------

## Heretic

Hrm, I'm having the same problem.  I freshly imaged a few Gentoo Servers and need to use RAID, but there are no /dev/md nodes.  Have you seen any further information on this?

----------

## rojaro

Same problem here ... we really need a proper solution for this ...

----------

## Klavs

Nope - still using the crappy solution. Perhaps you can update this thread if you find a solution. I will.

----------

## Heretic

Have you looked in /dev/md/X ???  Where X is a number?

I found those were created for me.  Also, you can just run this to make the nodes:

for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do mknod /dev/md${i} b 9 ${i}; done

----------

## derheld42

 *Klavs wrote:*   

> It seems a combination of these (don't know which actually did the trick - although the tarball disabling seems to be it):
> 
> adding notail to reiserfs for /
> 
> setting:
> ...

 

For me, it was the RC_DEVICE_TARBALL setting...Thanx!

----------

## NicoEchaniz

 *Klavs wrote:*   

> I hacked mknod /dev/md1 b 9 1 (and md2 = b 9 2 etc.) into /etc/init.d/checkfs 
> 
> A crappy solution.

 

I had to do the same but into the /etc/init.d/checkroot file.

Anyway, if you leave RC_DEVICE_TARBALL="yes" instead of changing it to "no" in /etc/conf.d/rc

you can delete your hack from checkroot after one successful boot, because the new nodes will be inside the tarball and thus get generated without need for the hack.

----------

## MatzeG

Did you find a solution?

I also have a RAID1, and would really be interested in getting to know your solution.

Thanks in advance, 

Mat

----------

## gcasillo

Me too. I've been struggling with a RAID1 setup all weekend long. I can't get the damned md devices to show up and boot.

----------

## NicoEchaniz

This is what worked for me.

I booted with the live CD, loaded raid1 module, created the nodes manually, mounted partitions, chrooted then edited /etc/init.d/checkroot and added:

mknod /dev/md0 b 9 0

mknod /dev/md1 b 9 1

mknod /dev/md2 b 9 2

mknod /dev/md3 b 9 3

at the end of the file

If you leave RC_DEVICE_TARBALL="yes" instead of changing it to "no" in /etc/conf.d/rc

you can delete your hack from checkroot after one successful boot, because the new nodes will be inside the tarball and thus get generated on every boot.

----------

## gcasillo

Yes, the device nodes will be there, but according to bug #80379, the checkroot and/or checkfs boot scripts will fail to mount your root drive, because those script(s) are hosed.

From the bug report:

 *Quote:*   

> After some investigation, I tracked the problem down to the checkroot init script.  The problem being that it's trying to do fsck on /dev/md2 which doesn't exist yet because it gets created by the checkfs init script.  Catch 22.
> 
> As a hack, I changed the following:
> 
> if [ ! -f /fastboot -a -z "${CDBOOT}" ]
> ...

 

----------

## NicoEchaniz

well, that's why I created the nodes at the end of the checkroot script and not in the checkfs script as Klav had suggested.

This is what I've done and it's working.

----------

## ElCondor

I had the same problem. I set up a server yesterday, and when booting the 1st time from hd (after cd-install, stage1) it complained about the missing devices. 

When the prompt came "enter root passwort to login or Ctrl-D for normal startup" I logged in as root, created the nodes /dev/md/* and rebootet, DEVICE_TARBALL is set to NO. No further modifications where necessary. (baselayout 1.9.4-r6, hotplug 045, kernel 2.6.11-gentoo-r4 SMP, sw raid1 on sata, raidtools 1.00.3-r4)

After the reboot, everything works, there was no need to create the devices again.

* ElCondor udevraiding pasa *

----------

## Deathwing00

Moved from Installing Gentoo as this is a Kernel & Hardware problem.

----------

## Kosa

I used

```
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12; do mknod /dev/md${i} b 9 ${i}; done
```

in /etc/init.d/checkroot, then sucessfully rebooted and with RC_DEVICE_TARBALL="yes" i could delete the line after sucessfully reboot (it prints warning about nodes already created during next reboots).

Works perfect, thanks to NicoEchaniz.

----------

## guid0

I had similar errors where it was in fact udev that failed. Forgot to compile Unix domain sockets in the kernel (network section) which fixed it for me

----------

