The short answer is that for 2.4.x there isn't a good way to do this.

Doug (Gilbert, I think) has sg3_utils which will help -- with those you can
at least enumerate /dev/ devices with INQUIRY data.

In 2.5, the lsscsi utility does everything you want (at least for the very
latest 2.5.x kernels).

Matt

On Wed, Feb 12, 2003 at 12:28:00PM -0700, Reg Clemens wrote:
> 
> Ive asked this question several different ways before, and have yet
> to get an answer to the underlying question/problem.
> 
> The question is this.
> 
> If a user plugs in a USB/Memory device, how can he find out which
> SCSI port its going to appear on?
> 
> ---
> 
> The only place I see a correspondence between the USB device (name)
> and the SCSI port is in
> 
>         /proc/scsi/scsi
> 
> But these entries are 'long-lived' (WHY?) they never go away.  So if
> I have more than one type of USB/Memory device (I do) there is no way
> to tell which one is attached now.
> 
> ---
> 
> One can determine WHICH USB/Memory device is attached by looking at
> either
>         /proc/scsi/usb-storage-m/n
> where m and n are integers, and look for the 'Attached: Yes/No' line,
> or at the file
>         /proc/bus/usb/devices
> 
> but there is no connection between these entries and those in
> /proc/scsi/scsi.  That is to say, even the Manufacturer/Product name
> is different in the two places, and while the serial number appears
> in /proc/bus/usb/devices and in /proc/scsi/usb-memory-m/n, it doesn't
> appear in /proc/scsi/scsi.
> 
> ---
> 
> If I could get back to the 'correct' /proc/scsi/scsi entry, then at
> least if I were running devfs, I could get to the device (without
> devfs, one still appears to be up a creek)
> 
> ---
> 
> So, am I missing something?
> Is there another way to do this?
> This is all with kernel 2.4.19, is there better information in the
> /proc files of a later release?
> 
> I really would like to plug in a device, and be able to find out where it is
> so that I can mount it.
> 
>                                 Reg.Clemens
>                                 [EMAIL PROTECTED]
> 
>                                       Reg.Clemens
>                                       [EMAIL PROTECTED]
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> [EMAIL PROTECTED]
> To unsubscribe, use the last form field at:
> https://lists.sourceforge.net/lists/listinfo/linux-usb-users

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

I want my GPFs!!!
                                        -- Stef
User Friendly, 11/9/1998

Attachment: msg06225/pgp00000.pgp
Description: PGP signature

Reply via email to