You could create a custom udev rule like this (I did it with one of my usb sticks):
Code: Select all
KERNEL=="sd[a-z]1", SUBSYSTEM=="block", ATTRS{model}=="Drive SM_USB20", ACTION=="add",
RUN+="/bin/su george -c '/usr/bin/pmount --sync %N /media/MYDRIVE'"
made an /etc/udev/rules.d/10-mydrive.rules file with those contents. You will need to change some of the fields in there. You can find the relevant information if you run:
Code: Select all
udevadm info -a -p `udevadm info -q path -n /dev/sdb1`
assuming /dev/sdb1 is your e-reader. KERNEL should probably remain the same, unless your e-reader has more partitions. Find the SUBSYSTEM entry that corresponds to sdb1 and change it. Same for ATTRS{model} (you can go down the list if there is none specified for sdb1). You can add more entries to make sure the device is identified properly, just pick from the list.
Of course you will need to change the username in the RUN command to your own and MYDRIVE to whatever you want. You'll also need to install pmount. One downside is that this will work for one user only, the one you specify. Another one is that you can only unmount using pumount. But you can put that in a panel button or something I guess.
Now that I think about it, if you want to make it work for multiple users, you could instead just create a dev symlink for it with something like:
Code: Select all
KERNEL=="sd[a-z]1", SUBSYSTEM=="block", ATTRS{model}=="Drive SM_USB20", ACTION=="add",
SYMLINK+="MYDRIVE"
so that your device is always available under /dev/MYDRIVE no matter what other devices you have plugged in. Now any user could just mount with
pmount --sync /dev/MYDRIVE and unmount with
pumount /dev/MYDRIVE. Or even mount using gnome-mount, with
gnome-mount -o sync -d /dev/MYDRIVE. In that case you will be able to unmount it normally like any other device.