From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to find SCSI device to USB device association.
Date: Mon, 9 May 2011 12:41:44 -0700 [thread overview]
Message-ID: <20110509194144.GA28126@kroah.com> (raw)
In-Reply-To: <392081.43699.qm@web30802.mail.mud.yahoo.com>
On Mon, May 09, 2011 at 12:12:15PM -0700, StephanT wrote:
> Hi all,
>
> System description: disk-less ARM, 32M, Linux 2.6.30, 4 USB ports.
>
> I plug in two USB flash sticks and I get:
>
> % df -h
> /dev/sda1 3.7G 32.1M 3.5G 1% /media/sda1
> /dev/sdb1 7.4G 32.1M 7.0G 0% /media/sdb1
>
> The sysfs shows:
>
> % ls /sys/bus/scsi/devices/
> 25:0:0:0 26:0:0:0
>
> (25 being the sda1 and 26 sdb1)
>
> % ls /sys/bus/usb/devices/
> 1-0:1.0 1-1 1-1.1 1-1.1:1.0 1-1.4 1-1.4:1.0 1-1:1.0
> usb1
>
> and:
>
> % ls -l /sys/devices/dw_otg/usb1/1-1
>
> drwxr-xr-x 4 root root 0 Jan 1 14:10 1-1.1
> drwxr-xr-x 4 root root 0 Jan 1 14:18 1-1.4
> ...
>
> From all this information: how can I find out the association USB
> device number(1|4) to SCSI device (sda1|sdb1)
Why would you want such a mapping? It's not stable, changes every time,
and means nothing.
On the other hand, you can do this, look in the sysfs tree for the block
device, it will point you to the usb device from there.
Hope this helps,
greg k-h
next prev parent reply other threads:[~2011-05-09 19:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-09 19:12 How to find SCSI device to USB device association StephanT
2011-05-09 19:41 ` Greg KH [this message]
2011-05-09 21:07 ` StephanT
2011-05-09 21:59 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110509194144.GA28126@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).