# Problem with initramfs and udev

## kdvgent

Over the week-end, I reinstalled my system from scratch but my problem is not going away.

Description:

I am using evms (with raid1 and lvm), hence I have made my kernel via genkernel, using the --evms2 option.  Consequence, I have an initramfs generated and use that one when booting.

During the boot process (but long before syslog-ng is started hence the messages are rapidly scrolling over my system), I got something like this:

Booting (initramfs) cannot umount /dev: device busy

Failed to unmount the initrd /dev

Once booted, when inserting a usb device, the necessary nodes are not made in the /dev directory.  However, when I issue the udevstart command with the device attached, the nodes are created (they do not go away when I remove the device).

I am using ~x86 for everything, have Gnome 2.12 installed but inserted usb devices are not automatically mounted and there are no icons placed on my desktop (looking to the forum and the bugreports, lots of people have problems with that but as long as my device nodes are not correctly created it is of no use to start looking into this).

Help please.  If I need to post more information, just tell me.

----------

## cpu

 *kdvgent wrote:*   

> Over the week-end, I reinstalled my system from scratch but my problem is not going away.
> 
> Description:
> 
> I am using evms (with raid1 and lvm), hence I have made my kernel via genkernel, using the --evms2 option.  Consequence, I have an initramfs generated and use that one when booting.
> ...

 

Exactly same situation on my system by I don't use evms just pure gentoo with SATA drive and while I'm plugging iRiver H320 (USB HDD) udev don't create necessary nodes in /dev but when I run udevstart everything is fine...

I also get this warning while booting kernel

Booting (initramfs) cannot umount /dev: device busy

Failed to unmount the initrd /dev

----------

## fangorn

In kernels pre 2.6.13 still was devfs as an option and there was an option to mount devfs automatically ab boot.

Check if you have activated this option. This will prevent udev from working.

----------

## kdvgent

But that option is no longer available in the kernelconfiguration (genkernel --menuconfig --evms2 all), hence I certainly have not enable it.

----------

## coffie

Same issues, Seems to have something to do with genkernel 3.3.8. Tried compiling using the following flags:

```
genkernel --menuconfig --gensplash=GoGentooGo --no-devfs all
```

No avail.

***UPDATE***

I'm going to file a bug for genkernel, please update your comments there also.

This looks to be the same bug: https://bugs.gentoo.org/show_bug.cgi?id=110492

----------

## prosario_2000

I think the most recent version of genkernel is responsible here, but I'm not sure.

----------

## fiercely

i am not sure exactly how or why and i have not checked bugzilla if this issue has already been noticed or addressed, but i downgraded to genkernel 3.3.6 and tried to reinstall my kernel with initramfs and it worked fine. i do believe these problems might have something to do with genkernel.

so a quick solution is to simply: "emerge =sys-kernel/genkernel-3.3.6" to downgrade and then use genkernel to recompile your kernel.

----------

## fschinagl

Hi everyone,

Perhaps you will find the following helpful - I haven't tried implementing these ideas yet.

The cause(s) for the described problem may have roots in in a combination of udev, evms, and the fact that you have to use an initial ram disk. A severe form of chicken and egg problem.

As you know your initrd (initial ram disk) script(s) must activate a minimum number of /dev entries in a (usually) temporary fashion to be able to bootstrap the system (including an instance of evms) before it can tell the kernel about the location of the root fs provided through evms and instruct the kernel to pivot the root file system.

Have a look at the /linuxrc script in your initrd file that your machine loads to preinitialize the kernel. Perhaps try to modify /linuxrc to intialize a pure udev system and have /linuxrc MOVE /dev to your real root file system after pivot root rather than trying to deactivate the temporary /dev and rebuilding a new /dev on the root fs that evms provides.

Allegedly one can "mount --move" a file system such as /dev. If it's possible to FULLY move /dev from within /linuxrc than it seems to me that it would no longer be necessary to start and stop or restart udev which can cause all sorts of problems with persistent devices such as the ones evms requires.

----------

## cpu

 *fschinagl wrote:*   

> Hi everyone,
> 
> Perhaps you will find the following helpful - I haven't tried implementing these ideas yet.
> 
> The cause(s) for the described problem may have roots in in a combination of udev, evms, and the fact that you have to use an initial ram disk. A severe form of chicken and egg problem.
> ...

 

But I get this error too and I don't have evms...

----------

## nixnut

Moved from Installing Gentoo to Kernel & Hardware.

Postinstallation problem, looks kernel/hardware related

----------

## fschinagl

If you don't use evms, think of the "evms" references in my earlier message as place holders for other services (for example some usb specific kernel/user space tools) that rely upon certain devices in such a way that the respective device nodes cannot be removed because, for example, the system requires access to one of the devices.

Let's try an analysis first:

Your previous message indicates two issues:

A) /dev cannot be unmounted (that's the one within the initial ramdisk environment - look for /initrd/dev in your real root fs, that's where most initial ram disk scripts put it after they pivot root - see /linuxrc in the inird.gz or whatever name you gave it).

B) At least certain USB devices are not automatically generated (those within the real root fs).

Re A) Check your /initrd/dev file system for REQUIRED device nodes (those that point at devices that the scripts in your initial ramdisk e.g. /linuxrc cannot deactivate because they ARE BEING USED) which prohibit your machine from unmounting /dev. This can be tricky as your initial ramdisk may (additionally) use "persistent" regular file-type like device nodes that exist in the file system and can mix with with the ones created by udev or devfs - try to not use devfs in your inital ramdisk.

Check if there are USB device nodes in /initrd/dev that seem to refer to your USB HDD.

Re B) Besides A), which could be the cause your "problem", try to find out why, as you describe, when you invoke udevstart (as I understand after you physically attach your USB HDD to your computer - do you turn on your USB HDD before or after you attach it to your computer?) creates the device nodes you need. It could be that your machine does not run properly activate udev after pivot root. Do you run hotplug?

Further reading:

Research more details about hotplug (e); The following is a more remote option but I think that despite hotplug being able to handle USB devices there might be another user space tool that could be more specifically intended for automatic USB device (dis-)connect handling.

Please familiarize yourself with the functionality of udev - see http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

----------

## cpu

Downprgade genkernel to 3.3.6 resolves this problem so it's genkernel related

----------

## coffie

Anyone know of the status for this bug?

----------

## vla_do

Check bug #113684

 *Quote:*   

> Fixed in 3.3.9; the solution was to upgrade udev to 077 if you're interested.

 

----------

