# How does automated hotplug mounting work?

I was reading a bit about gnome-mount, HAL, udev, etc. It left me with a couple of faint ideas how mounting a hotplug device might work in the latest Ubuntu release.

Could someone give a detailed explanation about what exactly is going on after a hotplug device (i.e. usb-stick) was plugged in?

-

## 1 Answer

Maybe you should specify which part of the process is interesting to you but let's say a USB stick is added then...

• kernel detects and initializes the device (see dmesg), then exports all the information it has found via a directory in /sys (see /sys/devices)
• kernel sends a uevent signal which is picked up by udev daemon
• udev daemon gathers available info and checks config files in /etc/udev/rules.d/ and /lib/udev/rules.d/ for rules about symlinks to create in /dev, permissions to set, programmes to run and sets some variables concerning the device (see man udev)
• udisks daemon in cooperation with gvfs-gdu-volume-monitor creates the appropriate directory in /media and mounts the new volume if deemed sensible
• nautilus checks the contents, creates thumbnails and opens a window if it is configured to do so; it also looks into /media/*/autorun.inf file for executable content
-
that was just what i was interested in. thanks a lot! so is gvfs-gdu-volume-monitor responsible for picking an appropriate driver for the device? i'm asking because i have a problem with an ntfs formatted usb drive that is always mounted using the ntfs kernel module instead of the ntfs-3g driver. –  koloman Mar 3 '11 at 9:51
No, it is actually udisks-daemon, but I'm afraid it is not configurable (web.archiveorange.com/archive/v/7azSg34QulEtgOvRXE08) But you can use a udev rule to do that for you (haven't tried it myself) - see wiki.archlinux.org/index.php/… –  arrange Mar 3 '11 at 21:54