Well, you'd be better off looking at udevadm to see how to get the attributes of the drive.
If you are saying that you want *any* usb drive to mount at (for example) /media/usb, that should be easy. In the udev rule the device should show up as /dev/sda1 (first partition on first drive using the "scsi" compatible sd driver).
I think this will work, put this code in /etc/udev/rules.d/99-usbdisk.rules
Code: Select all
KERNEL=="sda1", ACTION=="add", RUN="/bin/mount /dev/sda1"
and have the mount point set in /etc/fstab
You will have to unmount the drive before removing it though.
If you are only going to read the drive, you could make it mount read-only, then add this line to the rules file
Code: Select all
KERNEL=="sda1", ACTION=="remove", RUN="/bin/umount /dev/sda1"
As the drive is mounted read-only, it won't matter that it gets unplugged before the umount command is run.