can hotplug mount USB flash drive automatically?

can hotplug mount USB flash drive automatically?

Post by Denes Molna » Wed, 30 Apr 2003 16:04:45


Does anyone know how to coerce hotplug to *automatically* mount a USB
flash drive upon insertion? I am running RedHat 7.3 with hotplug 2002_08_26-1.

Everything works fine (insertions/removals are detected and the module
usb-storage gets loaded) but every time I have to mount the drive by hand
via 'mount /dev/sda1 /mnt/flash'.

I tried setting up usb.usermap and putting a custom script into
usb/usbstorage to mount the drive, following the sample usb/usbcam file
(all paths are relative to /etc/hotplug/). However, usb.agent exits
happily once it found that the usb-storage kernel module is loaded, and
control never gets to the user script. Seems the script is called only if
all other attempts to find a kernel module fail.

Am I supposed to redirect control someplace else to execute my extra mount
commands? I could of course modify the Redhat scripts but I worry about
potential side effects.

Thanks for any info,

Denes Molnar


can hotplug mount USB flash drive automatically?

Post by gial » Thu, 15 May 2003 07:44:09

Unfortunately, I haven't a 7.3 handy, but in my RH9 I had to edit the
file /etc/updfstab.conf.default to read:

device flash {
    partition 1
    match   hd CompactFlash
    match   hd ImageMate
    match   hd "USB Flash Drive"


I added the last line, where "USB Flash Drive" come from 'cat

Attached devices:
Host: scsi0 Channel: 00 Id: 00 Lun: 00
  Vendor: IOMEGA   Model: ZIP 250          Rev: 31.G
  Type:   Direct-Access                    ANSI SCSI revision: 02
Host: scsi1 Channel: 00 Id: 00 Lun: 00
  Vendor:          Model: USB Flash Drive  Rev: 1.00
  Type:   Direct-Access                    ANSI SCSI revision: 02

upon a new login, I can now mount/unmount the flash usb pen with the
right mouse button contextual menu.

If you have the /etc/updfstab.conf.default I guess it will work.

Good luck


1. Sun Solaris USB Flash Drive mount command (scsa2usb driver)

I plugged in a USB 1.0 flash drive into a SunBlade 1000 (Solaris 8).
I'm now tring to figure out the mount command.
Can you help.
Here is what I've done so far:

I tried to follow the USB Flash Drive help at:
I ran:
 csh% dmesg | grep scsa2usb
WHICH REPORTED (on machine 'eunice'):
 Sep 23 15:24:06 eunice usba: [ID 855233]

 Sep 23 15:24:06 eunice genunix: [ID 936769]

 Sep 23 15:24:06 eunice scsi: [ID 193665]
                 sd45 at scsa2usb0: target 0 lun 0

 Sep 23 15:24:06 eunice genunix: [ID 408114]

The next step is supposed to be the mount step, but, this failed:
 csh% su root
 csh# mkdir /flash
 csh# mount -F pcfs /dev/dsk/c1t1d0s2:c /flash
      Which reported: mount: /dev/dsk/c1t1d0s2:c is not a DOS filesystem.
 csh# df -kl
      Does not report the existance of this flash drive.

Probably I have the data incorrect in the mount line for the
controller:target:disk:slice:1 information in the mount command.

But, how do I find out that data for the mount command?
If it's in the dmesg output ... I don't understand that well enough to
find the controller, target, disk, & slice information for this new flash

Any help is appreciated,

2. xlc long double

3. mount USB flash drive on Unix

4. Can't get Linux to talk to MacTCP

5. Automatically mounting USB drive/digital camera

6. KDE system tray?

7. Allow all users to mount to a usb flash drive

8. Support for cached lookups via readdirplus [5/6]

9. problem mounting usb flash disk

10. Help mounting a USB Compact Flash Reader with 64MB card

11. problems mounting multi-slot USB flash reader

12. How to mount USB flash memory to Sun Solaris 9 on Sun Blade 150?

13. How to automatically mount memory sticks (and other usb-storage stuff)?