Information About Linux Udev Subsystem


Original document from

What Does Udev Do?

udev provides a dynamic device directory containing only the files for actually present devices. It creates or removes device node files usually located in the /dev/ directory, or it renames network interfaces.

As part of the hotplug subsystem, udev is executed if a kernel device is added or removed from the system. On device creation, udev reads the sysfs directory of the given device to collect device attributes like label, serial number or bus device number. These attributes may be used as keys to determine a unique name for the device. udev maintains a database for devices present on the system. On device removal, udev queries its database for the name of the device file to be deleted.

udev gets called by hotplug, if a module is loaded, and a device is added or removed. udev looks in /sys/, if the driver provides a "dev" file, which contains the major and minor number for a device node to communicate with the driver. After looking in the udev rules (in the /etc/udev/rules.d/ directory), which specify the device node filename and symlinks, a device node is created in /dev/ with the permissions, which are specified in /etc/udev/permissions.d/.

After device node creation, removal, or network device renaming, udev executes the programs in the directory tree under /etc/dev.d/. The name of a program must end with the .dev suffix, to be recognized. In addition to the hotplug environment variables, DEVNAME is exported to make the name of the created node or the name the network device is renamed to, available to the executed program. The programs in every directory are sorted in lexical order, while the directories are searched in the following order:

How is Udev Integrated on Fedora?

initrd / initfs

mkinitrd copies /sbin/udev.static to the initrd /sbin/udev and symlinks it to /sbin/udevstart.

After the kernel boots, it executes the nash script of the initrd. This mounts a tmpfs filesystem on /dev/. Instead of hotplug /sbin/udev is called in the initrd phase. udevstart creates all device nodes for the devices, which are compiled in the kernel and for the modules, which are loaded by nash.


The whole udev and hotplug infrastructure is not available in initrd. Thus no hotplug scripts, udev rules, and permissions and no /etc/dev.d/ scripts are executed for any hotplug event, which is sent from the kernel.


First, if SELinux is loaded and enabled, the context of /dev/ is set. rc.sysinit calls /sbin/start_udev. start_udev mounts a tmpfs filesystem on /dev/, if there is none already mounted. Then it creates some device nodes, which need module autoloading, or where there is no kernel module. After that /sbin/udevstart is called again, which simulates the hotplug events in the initrd phase, to apply the whole udev rules and permissions. After that rc.sysinit parses the ouput of /sbin/kmodule and loads every module. This should provide device nodes for all hardware found on your computer.

Console User Permissions

/etc/dev.d/default/ is called whenever a device node is created and calls /sbin/pam_console_setowner with the filename (and an optional symlink) of the device node. This sets the permissions for console users like specified in /etc/security/console.perms.

Customizing Udev on Fedora

Read the manpage of udev and udevinfo. Please try not to modify the files of RPM packages.

New Rules

New rules should be placed in a file, which ends in .rules in /etc/udev/rules.d/. Please do not use 50-udev.rules. The supported and preferred way is to create rules without the "NAME" tag and only create "SYMLINK"s.

A nice document describing how to write rules can be found on


New permissions should be placed in a file, which ends in .permissions in /etc/udev/permissions.d/. Please do not use 50-udev.permissions.

But I Really Want My Device Node!

Put them in /etc/udev/devices/, and they will get copied to /dev/. File a bugzilla entry, if you think that should be done per default.


Quick solution: If you do not need rhgb, just load the nvidia module in /etc/rc.local

If you have udev >= 032-5, load the nvidia module:

	cp -a /dev/nvidia* /etc/udev/devices
	chown root.root /etc/udev/devices/nvidia*