How does Linux kernel detect and plug in your hardware? Kernel, sysfs, udev and dbus collaboration.

I have been administrating Linux systems for a while now and were always strugling to “dig deeper”. Today I found myself wondering how does Linux detect, plug in my hardware and show that pop-up window asking me to choose what I want to do with my flash drive. So I launched my web browser and began to search for an answers in forums, tutorials and how-tos which almost ended in complete failure. I say “almost” because I did find some of the answers but they all were scattered and incomplete or too old. So I had to use “heavy artillery” and read through all those manuals… And I think I finally get it how it works :) This is what I will try to explain further. *I really hope I didn’t misunderstand something*

Continue reading