mount filesystem and run a program when hotplugged

Harmon Seaver hseaver at cybershamanix.com
Fri Jun 28 11:31:45 PDT 2002


   Never tried it with USB, but use autofs a lot -- look at your
/etc/auto.master and /etc/auto.misc files. I use

 "crypt        -fstype=reiserfs :/dev/loop0" 

in /etc/auto.misc to automount an encrypted loop device. The user that owns that
filesystem can just cd to it and it mounts automagically, to others it's not
even there. That is, there's nothing in the /misc/ dir until I cd into
/misc/crypt and it self unmounts if you aren't in it for so long, however long
you set the timeout for. You have to have already run the losetup for the loop
device, of course, and all that. 
   Autofs works fine for automounting floppys and pccards as well, don't know
why it wouldn't work for USB drives. Getting it to run a shell script when
mounted shouldn't be that hard.


On Fri, Jun 28, 2002 at 05:29:17PM +0200, Eugen Leitl wrote:
> I've bought me a little (32 MBytes) hotpluggable USB flash stick (a
> TrekStor). It mounts fine, but what I'd like to do is to automount it, and
> fire up a program (I intend to put my keyring on it) if hotplugged.
> 
> The system I'm testing this on is RH 7.3. 
> 
> I've been using mount -t vfat /dev/sda /mnt/usbhd to mount it manually and
> put diverse entries into /etc/fstab, to no avail. Any suggestions?

-- 
Harmon Seaver	
CyberShamanix
http://www.cybershamanix.com





More information about the cypherpunks-legacy mailing list