I'm running a Ubuntu system where USB drives are mounted automatically.
I'm curious to what happens when a USB device plugs in a port. Which part of the linux senses that a new device has been plugged in? After that which processes (and what is the caller or callers) are called to mount it to the system? Are theese kernel-space, user-space processes or mixed ?
I'd like to follow theese steps in a C/C++ program. Is there any way to do that? Where could I read more about it? How would you do it?