About UDEV



 

 


The udev program is designed to simplify the chaos that had overtaken the /dev directory with huge numbers of mostly unneeded devices. Understanding how udev works is key to dealing with devices, especially hotplug devices and how they can be managed.

/dev chaos

The /dev/directory has always been the location for the device files in all Unix and Linux operating systems. Note that device files are not the same as device drivers. Each device file represents one actual or potential physical device connected to the host.

In the past, device files were created at the time the operating system was created. This meant that all possible devices that might ever be used on a system needed to be created in advance. In fact, tens of thousands of device files needed to be created to handle all of the possibilities. It became very difficult to determine which device file actually related to a specific physical device.

udev simplification

udev is designed to simplify this problem by creating at boot time entries in /dev only for those devices that actually currently exist or which have a high probability of actually existing on the host. This significantly reduces the number of device files required.

In addition, udev assigns names to devices when they are plugged into the system, such as USB storage and printers, and other non-USB typs of devices as well. In fact, udev treats all devices as plug’n'pray, even at boot time. This makes dealing with devices consistent at all times.

Here is a link to a paper written by one of the authors of udev. It provides insight into the details of udev and how it is supposed to work.

Kernel Korner – udev — Persistent Naming in User Space by Greg Kroah-Hartman

Early Problems

Although udev is designed to provide persistent device naming, I found that there were some issues with this and devices such as multiple Network Interface Cards (NICs)  were renamed after upgrades from Fedora 11 to fedora 12 or from pre-udev releases of Fedora to post-udev releases. This was necessary to move from random device naming to consistent naming, but it did cause a few issues when upgrading.