Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I am running a debian 4.0 system (embedded - no GUI)
I am trying to setup udev to properly mount and run a script when a usb stick is plugged in. I have attached 3 different USB sticks and shown my udev rules and the udevinfo output below. When I plug in, udev runs the z10-local.rules to properly mount the stick but the z80-local.rules rule ( to run the script) doesn't seem to work. Any ideas?
Also If I run the script manually it works fine.
Thanks in advance
Thanks for the quick reply and info but I have a few questions:
1)Which rules file do you put all these rules into?
2) When you have a OPTIONS="last_rule", doesn't that skip all remaining matching rules?
3)What does the "vol_id" script/program do?
4) In general, how does one test udev rules (ie watch if it even gets to a rule and why it does or doesn't run it etc.?
5) Are any other "actions" allowed other than "add" or "remove"?
6) If you pull out the USB stick that doesn't give the umount rule/command a chance to run (to properly close the device) does it?
Thanks in advance.
Honestly, they are someone else's rules that I copied and used. I am not nearly good enough with udev to totally understand everything there, I just know that it works for me. I'll answer what I can.
1) I just put them in /etc/udev/rules.d/usbmount.rules
6) I am not totally sure, if you have something left that hasn't been written to the drive yet, it won't be happy. I haven't had any real problems with it though.
Used the following rules for managing the usb sticks and starting a management script when they appear. Put a 10 delay in the script (to allow the slow usb mounting process to finish - Not sure if that is needed).
Note script only works for sda1, sdb1, and sdc1 sticks (on purpose).Cheers and thanks!