Linux – mdev and how to /dev/* nodes get created in Linux

devicesembedded-linuxlinuxlinux-kernelrootfs

Our Linux kernel is 2.6.31 running on an embedded MIPS processor with busybox.

The initialisation script (rcS) starts mdev with:

echo "/sbin/stbhotplug" > /proc/sys/kernel/hotplug
mdev -s

Can anyone tell me what the Linux utility mdev does?

It looks like it does auto hot plugging as the stbhotplug is a script that handle ethernet interfaces.

Also, the rootfs we have been given only has a console device i.e. /dev/console is the only file in /dev.

However, when the system is running, the /dev directory is full of device files (e.g. /dev/mtd, etc.).

The reason I ask is that occasionally we get an error whereby it is reported that /dev/ubi_ctrl is not found or /dev/ubi1 is not found.

How or when does Linux create these devices?

Thanks.

Best Answer