# mdev vs. udev

## lyonsd

I was using kernel-genkernel-x86-2.6.16-gentoo-r9 and upgraded to kernel-genkernel-x86-2.6.17-gentoo-r6.  When I built the new kernel I used the exact same config file as the previous version.  Furhtermore, I used the same boot options in gru

b.conf, which looks like this:

```

default 0

fallback 0

timeout 3

splashimage=(hd0,1)/grub/splash.xpm.gz

title Gentoo Linux (2.6.16-gentoo-r9)

root (hd0,1)

kernel /kernel-genkernel-x86-2.6.16-gentoo-r9 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda4 splash=silent

initrd /initramfs-genkernel-x86-2.6.16-gentoo-r9

title Gentoo Linux (2.6.17-gentoo-r6)

root (hd0,1)

kernel /kernel-genkernel-x86-2.6.17-gentoo-r6 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda4 splash=silent

initrd /initramfs-genkernel-x86-2.6.17-gentoo-r6

title Windows XP Professional SP2 (hd0,0)

root (hd0,0)

makeactive

chainloader +1

```

However, when I boot the new kernel I get this:

```

>> Activating mdev

/init: 216: mdev: not found

>> Determining root device

!! Block device /dev/hda4 is not a valid root device...

!! The root block device is unspecified or not detected...

Please specify a device to boot, or "shell" for a shell...

boot() ::

```

With the older kernel, I'd get this:

```

>> Activating udev

>> Determining root device

```

And it would boot fine.

So the problem seems to be mdev vs udev.  

I thought udev was default.  What is this mdev and why isn't it found when booting?  I checked the kernel config parameters and didn't see anything relating to "mdev".

Any way to resolve this?

Thanks.

----------

## Ice82

I have the same problem, but also made a mess:

when I upgrade a kernel I use to reboot, see if everything works fine and then remove the older one. This time I upgraded to kernel-2.6.17-r7, rebooted, re-compiled with some differences (removed APM support since I use ACPI), removed kernel 2.6.17-r4. After rebooting I have that issue with mdev, but I don't have any other kernels to boot with!

I tried to solve this problem using an old live CD (2004.2): I wanted to re-compile the kernel with APM support re-enabled, but it doesn't even find my SATA hard disk anymore (sda), so I cannot chroot!

Now I'm downloading the newest live CD and see if this one will save my poor Gentoo. If you have any other ideas in the meanwhile, I would appreciate it a lot. Thank you!

----------

## zxy

@Ice82

Here you've got a lesson:  Always have a working backup kernel waiting...   :Wink: 

----------

## Ice82

Oh. My. God. I booted with the newest liveCD: it says:

```
PCI: Failed to allocate mem resource #6:20000@c0000000 for 0000:01:00.0

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0)
```

My hard disk is partiotioned this way:

/dev/sda1 Win

/dev/sda2 extended

/dev/sda3 swap

/dev/sda4 Gentoo

/dev/sda5 vfat data

The first time I installed Gentoo on my machine was with the same version of liveCD. Why does it give me this error right now?  :Sad: 

----------

## lyonsd

So is there something you have to do when compiling the kernel to make it use mdev?

I wonder if they have all these problems with Ubuntu?

----------

## Ice82

lyonsd, I think that your problem is not so terrible. Try to enter "mdev" in the Quick Search and you'll find some solutions since August the 15th.  :Wink: 

As for me, maybe I should post a new thread for this issue. This is a tragedy, Gentoo is the only Linux that runs on my laptop, and now I can't even use its LiveCD to recompile the kernel, use another one or reinstall everything from the beginning.  :Crying or Very sad: 

----------

## lyonsd

I didn't see anything specific.  I saw people getting the "invalid root device" error, but I didn't see where they got 

/init: 216: mdev: not found

I saw where one guy selected a bunch of kernel compile options, but he didn't specify which ones.  That's my question: if there is a kernel option, which one is it?

----------

## Waldi

mdev is kinda micro-udev and it is included in the sys-apps/busybox package

----------

## Ice82

I saw in a couple of threads that the problem is related to the latest genkernel. One suggests to compile at hand, the other one to downgrade genkernel until the new version gets fixed. I hope this will help you.  :Wink: 

As for me, still stuck. Tomorrow I'll see if the same liveCD I used to install Gentoo the first time will work. Versions 2004.2 and 2006.1 are excluded. This is my last hope, then after 2 years I'll have to say goodbye to Linux until I get a new laptop...  :Crying or Very sad: 

----------

## Ice82

 :Very Happy:  Done it!!!  :Very Happy: 

I used a 2006.0 version of the LiveCD (the only one that works with my computer, I see), copied its kernel in my /boot directory, modified the grub.conf file, and recovered everything. The strange thing is that I recompiled the same kernel 2.6.17-r7 with the same genkernel 3.4.0-r1, and it started to work properly with mdev. I didn't modify anything, though... Anyway. Problem SOLVED!  :Wink: 

I wonder if lyonsd has succeded?

----------

## zxy

@lyonsd

If you can boot from livecd then I suggest manually configuring the kernel. Genkernel takes much more time to compile. You can do everything that genkernel offers by hand. Then you get smaller, more optimized kernel, that boots faster. And you get to learn something too.

----------

## lyonsd

 *Ice82 wrote:*   

> 
> 
> I wonder if lyonsd has succeded?

 

Negative.

I just tried building a kernel with the latest code and it failed to boot with the same problem.

I don't have a liveCD with me.  I have my working kernel backed up to the root directory (which is on /dev/hda4, my boot partition is /dev/hda2).

Is there anyway I can get into grub and make it boot my working kernel on /dev/hda4 so I can colpied it back to /boot (/dev/hda2) and get this working?

Thanks.

----------

## zxy

Look at the second post, where I have described how to do it with grub. If you need more help, just ask

----------

## zxy

Look at the second post, where I have described how to do it with grub. If you need more help, just ask

Look here: https://forums.gentoo.org/viewtopic-t-495405-start-0-postdays-0-postorder-asc-highlight-.html

----------

## mauricev

A bug: https://bugs.gentoo.org/show_bug.cgi?id=142775  :Sad: 

----------

