Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anybody recommend materials about device management in the Linux environment? From the point where I insert a cdrom or usb device to the point where it is mounted in /media/somedir.

I know that I must read about hal, dbus, udev but I was wondering is there any material that treats this topic as a whole.

EDIT: Thanks for link but I want explore this topic more deeply, for example: from who udev get message that there is new device. How this process works etc.

share|improve this question
up vote 5 down vote accepted

This is Linux specific:

A hotplug event handler will register with the kernel to receive hotplug events either over a netlink socket or by echoing its path to /proc/sys/kernel/hotplug. It will then receive information over the socket (netlink) or via being launched with environment variables (/proc.../hotplug).

Usually, udev is this handler. When udev gets an event, it proceeds through its rules, and processes ones that match. The rules can include loading kernel modules, naming the device, launching programs, and more.

If you want to see exactly what udev might see, you can write a short program to listen to the netlink socket, or you can do this:

exec 1>/tmp/hotplug.log
echo -----

Then give the file execute permissions and echo the path to /proc/sys/kernel/hotplug. Insert and remove some devices and check the log.



share|improve this answer
Thanks. This is very helpful. Good description about udev and finally i understand a bit more :D. – PaulP Oct 19 '11 at 14:42

Hal is obsolete. It simply didn't make it and got pushed away. Dbus has not much to do with hardware at all - it is a system message bus (a universal means of communication between various system components). The most important general hardware management system for linux desktop systems is currently udev. If you're interested, you can read a very nice guide from gentoo documentation.

share|improve this answer
So why is there still a HALD running if UDEV is in use? – Nils Oct 19 '11 at 18:48
@Nils If it is so on your system, it could mean either that the system is outdated or that some particular program uses the old HAL or that it is simply unneeded and can be removed. – rozcietrzewiacz Oct 19 '11 at 19:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.