On Sat, 2 Mar 2013, website reader wrote:
> Has anyone written udev rules for the USB removable media thumbdrives?
This is what I use for my Lexar 4GB thumbdrive. I think I got the values
by looking at dmesg after inserting the drive.
It's been a few years, so I'm not sure I can reconstruct all the steps
without spending some time thinking about it.
/etc/udev/rules.d/58-Lexar.rules:
KERNEL=="sd?1", ATTRS{idVendor}=="05dc", ATTRS{idProduct}=="a732",
SYMLINK+="lexar"
ACTION=="add", KERNEL=="sd?1", ATTRS{idVendor}=="05dc",
ATTRS{idProduct}=="a732", RUN+="/bin/mkdir /mnt/lexar"
ACTION=="add", KERNEL=="sd?1", ATTRS{idVendor}=="05dc",
ATTRS{idProduct}=="a732", RUN+="/bin/mount -t vfat -o
sync,flush,uid=1000,gid=100 /dev/lexar /mnt/lexar"
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="05dc",
ENV{ID_MODEL_ID}=="a732", RUN+="/bin/umount /mnt/lexar"
ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="05dc",
ENV{ID_MODEL_ID}=="a732", RUN+="/bin/rmdir /mnt/lexar"
Plug in the thumbdrive, and voila! /mnt/lexar.
--
David Fleck
[email protected]
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug