7

My system has to auto-mount USB devices; how can I be notified when a USB device is plugged in? Where can I read more about this subject?

I would like to handle this problem via C or a shell script.

The Student
  • 3,529
  • 1
    And what about specifically "user space" options? I want my own shell script to run A) when a drive becomes available (e.g. auto-mount) and B) when a drive is about to become unavailable (e.g. "unmount" via gvfs or a gui file manager. – user29020 Apr 16 '14 at 14:31

1 Answers1

5

Udev support running external programs

KERNEL=="sdb", RUN+="/usr/bin/my_program"
alvosu
  • 306