# Udev and devfsd

## cryo

I am running a 2.6.5 kernel with udev hotplug and baselayout 1.8.6.13-r1. According to the udev guide on this site, devfsd shouldn't be running.. I still have devfs enabled at boot time. The guide says

 *Quote:*   

> If you want to use the udev-tweaks Gentoo added to make your life comfortable, then read no more. You're all set. The Gentoo init scripts won't run the devfsd daemon and will deactivate devfs when you boot up.

 

But devfsd is in fact running after I boot up. Killing it doesn't seem to harm anything, and stuff like e.g. tun devices seem to be handled by udev and not devfsd, since the devices are created a little differently (with no symbolic links). So why run devfsd? Looking in /sbin/rc, it says something about it being needed for /dev/ram0 or something. Anyone knows?

----------

## nonotme

actually, you can disable devfs in kernel if your using udev instead. you probably still have "devfs" and "mount at boot" enabled. check in Pseudo Filesystems in your kernel.

----------

## cryo

Yes I do... according to the guide you can leave it enabled (whatever "can" is suposed to mean in this case :-p), and still, quote "The Gentoo init scripts won't run the devfsd daemon and will deactivate devfs when you boot up.".

But... it doesn't seem to be the case, and actually looking into it I can see that /dev is mounted as devfs and not ramfs or whatever, which is not really a surprise I guess. I also don't have the device node tarball expanded then.

Is it safe to disable devfs mount at boot just like that? What about the /dev/console and /dev/null? Well... I guess I can always experiment :-p.

----------

## nevynxxx

You can leave the devfs enabled in the kernel, but should remove mount at boot, other wise it will mount...at boot...  :Twisted Evil: 

----------

## cryo

Right... I assumed it was necessary for system operation.. I was tricked since udevd is actually running along with devfsd now, and devices are created in a new way (for instance I now get /dev/net/tun as a direct device, instead of before where it was a link to /dev/misc/..).

I am now wondering... where is udevd started? Not by the startup scripts; it even starts when booting into single user mode. Is it because the kernel has hotplug support and thus calls the hotplug script which calls the udevsend and then ..udevd? In that case, why is udevd started manually by rc when we are in udev mode? Forgive me for being curious   :Wink: 

Final question: When the udev FAQ speaks of creating /dev/null and /dev/console (when running non-tweaked udev), where do they want those created? In the ramfs mounted on /dev? In the devfs mounted on /dev (hardly), .. on the disk? And if so, how do you access that, since there is always a devfs/ramfs mounted on top of it?

----------

## cryo

Alright, I just tried to boot without mounting devfs at boot... result: Unable to open initial console. My guess is the missing /dev/console and /dev/null? But in the udev guide it says those are only needed if you are not running the gentoo tweaked udev and not using the tarball etc.

Soo... is the guide wrong or ..what is wrong?  :Smile: 

----------

## cbr

Create those two files by the steps given in the manual and you should be OK.

----------

## linkfromthepast

The best guide for using udev:

http://webpages.charter.net/decibelshelp/LinuxHelp_UDEVPrimer.html

Do:

```

cd /dev

mknod -m 660 console c 5 1

mknod -m 660 null c 1 3
```

----------

## firephoto

I had the same missing console problem last night when I tried to get the system booted with udev. I booted a knoppix cd and did the mknod thing for console and null (couldn't do it while in the system, said they were already there). After that it booted into gentoo but now there's 1506 items under /dev/ instead of the usual 800 or so and my ieee1394 connections seem missing but I don't have anything plugged into them right now so maybe it's ok. Need to set things up for a "pure" udev since it seems to be working ok.

----------

## cryo

Right. It worked for me too after that (and after getting rid of udevsend/udevd which are apparently bugged, see bug #47902, https://bugs.gentoo.org/show_bug.cgi?id=47902).

By the way, in the following way it's possible to make those two devicenodes without booting off a different disk or CD (as root):

```
mkdir test

mount --bind / test

cd test/dev

mknod console c 5 1

mknod null c 1 3

cd ../..

umount test
```

By the way, the fact that udevd is started in rc sysinit doesn't seem to have any impact on the system. It's started through udevsend on demand anyway it seems. But I don't use either right now, because of the bug mentioned above.

----------

