How to use udev to detect when any SD card is plugged into a usb adaptor.
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. 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 Can someone point me in the right direction at least? Many Thanks for your help Mark |
I'm having a similar problem. maybe this can help.
I'm using Debian derivatives, and don't know if others are the same.
Most (maybe all) USB thumb drives, and/or USB adapters with sd chips in them will register in /media with an automatic name which is the block ID for that unit. With Thumb drives, or sd chips, that is two two segments of four digits each separated by a dash. (For instance /media/86C8-2CBD). I want to be able to record identical (or dis-similar) programs onto 10 or more chips, as quickly as possible, and (in case one fails, or is two slow), to be able with certainty to know which one it is without testing each one. Maybe my observations can help you. |
All times are GMT -5. The time now is 09:10 AM. |