Jacek Pliszka <[EMAIL PROTECTED]> writes:
> On 14 Jun 2002, Mark Atwood wrote:
>
> > > > I want to do this so that my /etc/hotplug/usb/usb-storage script can
> > > > automatically mount it and do some magic with it's contents.
> > >
> > > Sorry, but right now it does not know that information :(
> >
> > So is there any way to do what I want? (Plug in arbitrary numbers
> > and kinds of usb-storage devices and have them be programatically
> > mounted automatically?).
>
> You can try doing that:
> a) your script mounts the device somewhere
> b) if it succeeds - reads the label of the drive
> c) umounts and mounts in the right place based on the LABEL it read
I cant even figure out how to do that, programmatically, and
bulletproof enough.
Right now what I have to do is
cat /proc/scsi/scsi
insert the device
cat /proc/scsi/scsi again
notice what has been added
count down a,b,c,d for each device of type "Direct Access"
mount /dev/sdX1, where X is the a,b,c
Here are some problems:
I have to keep track from moment to moment what the SCSI table used
to look like vs what it looks like right now.
If two or more devices are plugged in within a short period of time
of each other, I cant tell which one was which.
When a storage device is removed, the corresponding entry in the
SCSI table is *not* removed.
Not all storage devices have unique volume labels.
Oh, and another problem:
There exists multimemory devices like the Addonics Pocket DigiDrive,
which has slots for MMD, for SmartMedia, for CompactFlash, and for
MemoryStick. (The usb-storage driver makes each look like a
different Lun on the same Id). There is no way to tell if a memory
chip has been pulled, inserted, substituted, other than constantly
scanning it. Ick.
What I am doing is trying to add some features to an appliance that is
Linux based. This means that I dont have any control over what sorts
of hubs the user may plug in, the brands and sizes and varieties of
storage devices he may plug in, and control of the contents of those
devices.
I'm sure there is some reason why the usb-storage driver doesn't just
create a block special device, instead of sitting underneight the
baroque abstractions of the scsi layer, but in my ignorance, I dont
see what that reason may be.
I crave enlightenment.
--
Mark Atwood | Well done is better than well said.
[EMAIL PROTECTED] |
http://www.pobox.com/~mra
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users