I thought I'd share this little bit of code that I've written to handle
usb-pen/thumbdrive devices that seem to be pretty popular these days
(certainly beats floppies). It is pretty simplistic and will work in 99%
of cases, by my estimates.
1. Automatically create /dev/diskonkey pointing to the correct device.
2. Automatically create /mnt/diskonkey if missing.
3. Automatically add fstab entries if missing.
4. Automatically set ownership to the console user (if anyone is logged
in -- if not, then the ownership will be set by the /mnt/diskonkey* rule
1. Currently only supports one thumbdrive device at a time, though
support for more should be easy to add (I only have one to play with.
2. No way to tell nautilus to re-read /etc/fstab to add diskonkey to the
list of mountable devices in rightclick->disks (they claim it's fixed in
the newer version of nautilus, but that doesn't help. Currently sending
killall -$(anysignal) nautilus will kill it, though theoretically a -HUP
should tell it to reread the config). A workaround -- tell your users to
plug in the device before they log in.
3. If partition info changes on the device, then things go screwey, as
devlabel gets confused (e.g. someone deletes /dev/sda1 and decides to
use the entire /dev/sda device instead). This rarely, if ever, happens.
4. This hasn't been overly extensively tested.
Installation instructions are in the file itself. I would love to hear
any feedback on this.
Konstantin ("Icon") Riabitsev
Duke Physics Sysadmin, RHCE
Show replies by thread