I would like to have a script run whenever I plug any SD card into a specific SD adaptor, I've been told that udev is the way to go but I'm at a complete loss, I've done some searching and can find plenty of information that relates to running scripts when a specific drive is plugged in but not anything about any cards plugged into a specific adaptor/hub.
I've only managed to get so far that the hub itself has an entry in the output of lsusb which is
Code:
Bus 001 Device 011: ID 0bda:0119 Realtek Semiconductor Corp.
After that I'm lost completely, all the guides assume you know which /dev/sd? entry you're looking for, which I don't
Additionally if I remove and then reconnect the adaptor this is the output written to /var/log/messages
Code:
Jun 30 22:22:57 raspberrypi kernel: [ 2114.145106] usb 1-1.3.4.2: USB disconnect, device number 11
Jun 30 22:23:00 raspberrypi kernel: [ 2116.427548] usb 1-1.3.4.2: new high-speed USB device number 12 using dwc_otg
Jun 30 22:23:00 raspberrypi kernel: [ 2116.534769] usb 1-1.3.4.2: New USB device found, idVendor=0bda, idProduct=0119
Jun 30 22:23:00 raspberrypi kernel: [ 2116.534808] usb 1-1.3.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 30 22:23:00 raspberrypi kernel: [ 2116.534826] usb 1-1.3.4.2: Product: USB2.0-CRW
Jun 30 22:23:00 raspberrypi kernel: [ 2116.534839] usb 1-1.3.4.2: Manufacturer: Generic
Jun 30 22:23:00 raspberrypi kernel: [ 2116.534852] usb 1-1.3.4.2: SerialNumber: 20090815198100000
Jun 30 22:23:00 raspberrypi kernel: [ 2116.540723] usb-storage 1-1.3.4.2:1.0: USB Mass Storage device detected
Jun 30 22:23:00 raspberrypi kernel: [ 2116.543236] scsi6 : usb-storage 1-1.3.4.2:1.0
Jun 30 22:23:01 raspberrypi kernel: [ 2117.540126] scsi 6:0:0:0: Direct-Access Generic- SD/MMC 1.00 PQ: 0 ANSI: 0 CCS
Jun 30 22:23:01 raspberrypi kernel: [ 2117.542785] sd 6:0:0:0: Attached scsi generic sg3 type 0
Jun 30 22:23:01 raspberrypi kernel: [ 2117.548659] sd 6:0:0:0: [sdb] Attached SCSI removable disk
I'm running up to date Raspian (debian) on a raspberry pi,
Can someone point me in the right direction at least?
Many Thanks for your help
Mark