Skip to contentSkip to conversation

Howto automatically mount multiple usb-storage devices?

DISCUSSION [email protected] 3 participants 3 messages Nov 23, 2001 – Nov 24, 2001

lore
Share & tools
lore
#0 lore raw

Hello,

My problem is very simple I have a few usb-storage devices and I would like to connect them randomly. After connecting the device it must be mounted, but I don't know the name of the device on forehand?

I had a look at hotplug, devreg and scsimon, but it seems that it is not possible with these tools?

Anybody an idea how to do this?

Thanks for your time.

Erik

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

Am Freitag 23 November 2001 12:37 schrieb [email protected]:

Quoted 10 lines

Hello,

My problem is very simple I have a few usb-storage devices and I would like to connect them randomly. After connecting the device it must be mounted, but I don't know the name of the device on forehand?

I had a look at hotplug, devreg and scsimon, but it seems that it is not possible with these tools?

Anybody an idea how to do this?

There is an experimental kernel patch called scsimon which generates hotplug events upon detection of scsi devices. You still have to deal with partitions though.

HTH
Oliver

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to [email protected]
Quoted 3 lines · [email protected] writes:

My problem is very simple I have a few usb-storage devices and I would like to connect them randomly. After connecting the device it must be mounted, but I don't know the name of the device on forehand?

I've gotten the impression that support for this sort of thing was coming, but isn't there yet. So for my simple needs (read files from one of two USB devices that might be connected at any given time), I wrote a little perl script to look in /proc/scsi/usb-storage* and figure out which device was mounted on which id. It's nothing special and currently only understands the two devices I have and the directories where I mount them, but you could easily modify it to do whatever you needed if you only have a few devices. You're welcome to it: http://www.shallowsky.com/software/mountpix.pl

The downside is that I can't use fstab entries (because one of the devices is read-only while the other isn't), so I have to mount the device explicitly and therefore the script has to run as root. I run it with sudo and added it under my name in /etc/sudoers. Hotplugging to known locations, so we could hook up to fstab, would be a lot better.

	...Akkana

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel