When Linux-users talk about the hardware on their system in the vicinity of
people who believe Linux is some sort of virus or brand of coffee, the use of
"slash dev slash foo" will return a strange look for sure. But for the fortunate
user (and that includes you) using
We all know what a device file is. Some even know why device files have special
numbers when we take a closer look at them when we issue
Think about hotpluggable devices like USB, IEEE1394, hot-swappable PCI, ... What is the first device? And for how long? What will the other devices be named when the first one disappears? How will that affect ongoing transactions? Wouldn't it be fun that a printing job is suddenly moved from your supernew laserprinter to your almost-dead matrix printer because your mom decided to pull the plug of the laserprinter which happened to be the first printer?
Enter
Every time a change happens within the device structure, the kernel emits a
udev is meant to be used in combination with a 2.6 kernel (like
# emerge udev
Kernelwise, be sure to activate the following options:
General Setup --->(Make sure the following item is *not* enabled) [ ] enable deprecated sysfs features to support old userspace tools File Systems ---> [*] Inotify support for userspace Pseudo filesystems ---> [*] Virtual memory file system support (former shm fs)
If you use
If you can't boot successfully because you get an error about
If you run
To see which devices nodes are present before the
# mkdir test # mount --bind / test # cd test/dev # ls
The devices needed for a successful boot are
# mknod -m 660 console c 5 1 # mknod -m 660 null c 1 3
When you're finished, don't forget to unmount the
# cd ../.. # umount test # rmdir test
If you use the proprietary driver from nVidia and the X server fails to start on a udev-only system, then make sure you have:
Even though our intention is to have a consistent naming scheme between both dynamical device management solutions, sometimes naming differences do occur.
One reported clash is with a HP Smart Array 5i RAID controller (more precisely
the
If this is the case, don't forget to update your
The same happens with all-round symlinks that used to exist in
Another issue is the difference in naming of terminals between devfs and udev.
While devfs calls its terminals
Recent versions of udev (104 and up) along with newer kernel versions (2.6.19
and up) may change your disc device names, due to a change in the kernel's
libata implementation. A CD-RW device at
To work around these issues, you must edit
For more information on writing udev rules, be sure to read Daniel Drake's
Sometimes unplugging and replugging a network device (like a USB WiFi card) can rename your net device each time, incrementing the number by one.
When this happens, you'll see it become
File systems ---> [*] Inotify file change notification support [*] Inotify support for userspace
Now udev will retain proper names for your network devices.
Sometimes udev loads modules in an undesired, unpredictable, or seemingly random order. This is especially common for systems that have multiple devices of the same type, as well as multimedia devices. This can affect the assigned numbers of devices; for example, sound cards may sometimes swap numbers.
There are a few solutions to fix device numbers and/or module load order. Ideally, you can just use module parameters to specify your desired device number. Some modules, such as ALSA, include the "index" parameter. Modules that use the index parameter can be adjusted as shown. This example is for a system with two sound cards. The card with an index of 0 is designated as the first card. Once the parameters are changed, the module config files must be updated.
# echo "option snd-ice1724 index=0" >> /etc/modprobe.d/alsa.conf # echo "option snd-ymfpci index=1" >> /etc/modprobe.d/alsa.conf # update-modules
The above example is the preferred solution, but not all modules support
parameters such as index. For these modules, you'll have to force the correct
module load order. First, you must stop udev from autoloading the modules by
blacklisting them. Be sure to use the exact name of the module being loaded.
For PCI devices, you'll need to use the module names obtained from the output of
# echo "blacklist b2c2-flexcop-pci" >> /etc/modprobe.d/dvb # echo "blacklist budget" >> /etc/modprobe.d/dvb # update-modules
Next, load the modules in the correct order. Add them to
# echo "budget" >> /etc/modules.autoload.d/kernel-2.6 # echo "b2c2-flexcop-pci" >> /etc/modules.autoload.d/kernel-2.6
If device nodes are not created when a module is loaded from
Support for the framebuffer devices (
For kernels older than 2.6.4 you have to explicitly include support for the
File systems ---> Pseudo filesystems ---> [*] /dev/pts file system for Unix98 PTYs
The udev talk on the Linux Symposium (Ottawa, Ontario Canada - 2003) given by Greg Kroah-Hartman (IBM Corporation) provided a solid understanding on the udev application.