http://www.planamente.ch/emidio/pages/linux_howto_udev.php
Each device seems to be identified by a model and vendor. Here how to find out these values.
Plug in your USB device and get the device name:
tail -n 20 /var/log/message
You should find sda or sdb or something like this.
In the next steps, replace sda with what you have found before.
Call
udevinfo -q path -n /dev/sda udevinfo -a -p /sys/block/sda | grep BUS udevinfo -a -p /sys/block/sda | grep model udevinfo -a -p /sys/block/sda | grep vendor
You should find something like:
BUS="scsi" SYSFS{model}="..." SYSFS{vendor}="Apacer "
Add and entry in /etc/udev/udev.rules:
BUS="scsi", SYSFS{vendor}="Apacer ", NAME="apacer%n", SYMLINK="%k"
Create directory for script to be called (replace apacer with your vendor name)
mkdir /etc/dev.d/apacer-1
and copy the following script in /etc/dev.d/apacer-1/mount
#!/bin/sh if [ "$ACTION" == "add" ] then USER=`ps -elf | grep x-session-manager | cut -d " " -f 3 | head -n 1` su -c "mount /media/palmint-1" $USER fi
Create mountpoint:
mkdir /media/apacer-1
add following line in your /etc/fstab:
/dev/apacer-1 /media/apacer-1 auto user,noauto,noatime,sync,defaults
Hal-volume-manager can show a lot informations about your hardware, but I couldn't find a package providing it.