Penguin
Note: You are viewing an old revision of this page. View the current version.

UDev is the UserSpace-based replacement for DevFs, an obsolete LinuxKernel Module that creates entries for available devices in /dev. UDev is available in Kernel 2.5 and newer and uses HotPlug and the /sys FileSystem.

The home page for UDev is at http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

See also:


Notes

(WikiGnomes split out to another page if you feel the need)

Troubleshooting

Q: Why doesn't the HAL and UDev combination pick up my device events (ie plugging in a KeyDrive) in DebianLinux?
A: You have to add the user to the "plugdev" group, else it won't work.

Force a USB storage device to a specific mount point

DanielLawson writes on the NZLUG list:

There are a couple of ways of doing this.

If your distribution uses udev, you can make a udev rule to create a /dev entry for a specific device, based on some criteria. I've used the USB serial #, for example, to map my USB harddisk to /dev/external and my USB flash disk to /dev/memorystick. You can then use normal fstab rules for these mounts.

Another option, which works with most FileSystems (not NTFS it seems), is to get the UUID of the filesystem, and use that as an fstab(5) rule. If you run the blkid program as root it will list all filesystems present on your system, and their UUIDs if they are available. You can then add a rule to fstab that looks like:

UUID=42CB-5356 /media/external vfat rw,user,noauto 0 0

blkid is provided by the libblkid1 package under Ubuntu (and Debian Sarge, I believe).

These approaches should all integrate reasonably well with the standard automounting facilities available in modern distributions.

Locking down a device name

If you have multiple sound cards, network cards or multiple any device the kernel might change the order randomly. One time eth0 will be one card and eth1 the other - next time it might be eth1 for the first card and udev doesn't seem to be able to override this. To get around this use udev to call them a different name e.g. lan0 and lan1. Your eth0 and eth1 will still exist but use the lan0 and lan1 in other areas instead.