All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Mark Atwood <mra@pobox.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	kurt@garloff.de
Subject: Re: SCSI host/channel/lun/part to /dev/sd* or maj/minor mapping
Date: Fri, 14 Jun 2002 00:16:09 -0400	[thread overview]
Message-ID: <3D096E09.B58901A7@torque.net> (raw)

Mark Atwood write:
> Is there a mapping between the Host,Channel,Id,Lun of a SCSI device as
> reported in /proc/scsi/scsi, and the the /dev/sd* names and/or the
> major/minor device numbers?
> 
> I've done some experamentation, and the more obvious ways of doing
> the mapping dont seem to be 100%.

Mark,
There are several utilities discussed at this url:
http://www.torque.net/sg/u_index.html
including scsidev and sg_map. Devfs shows you this mapping
via its hierarchy:
$ ls -l
total 0
brw-------    1 root     root       8,   0 Dec 31  1969 disc
crw-r-----    1 root     root      21,   0 Dec 31  1969 generic
brw-------    1 root     root       8,   1 Dec 31  1969 part1
$ pwd
/dev/scsi/host1/bus0/target0/lun0/


None of these approaches is completely satisfactory. Kurt Garloff
is working on a patch that seems to address this problem quite
cleanly:

$ cat /proc/scsi/map
# C,B,T,U	Type	onl	sg_nm	sg_dev	nm	dev
0,0,00,00	05	1	sg0	c:15:00	sr0	b:0b:00
1,0,01,00	05	1	sg1	c:15:01	sr1	b:0b:01
1,0,03,00	05	1	sg3	c:15:03	sr2	b:0b:02
1,0,05,00	00	1	sg4	c:15:04	sda	b:08:00
1,0,09,00	00	1	sg5	c:15:05	sdb	b:08:10
1,0,02,00	01	1	sg2	c:15:02	osst0	c:ce:00
2,0,01,00	05	1	sg6	c:15:06	sr3	b:0b:03
2,0,02,00	01	1	sg7	c:15:07	osst1	c:ce:01
2,0,03,00	05	1	sg8	c:15:08	sr4	b:0b:04
2,0,09,00	00	1	sg10	c:15:0a	sdd	b:08:30
3,0,10,00	00	1	sg11	c:15:0b	sde	b:08:40
3,0,12,00	00	1	sg12	c:15:0c	sdf	b:08:50


Doug Gilbert

             reply	other threads:[~2002-06-14  4:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-14  4:16 Douglas Gilbert [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-06-14  2:19 [PATCH: NEW SUBARCHITECTURE FOR 2.5.21] support for NCR voyager (3/4/5xxx series) Matthew D. Pitts
2002-06-14  2:52 ` SCSI host/channel/lun/part to /dev/sd* or maj/minor mapping Mark Atwood

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=3D096E09.B58901A7@torque.net \
    --to=dougg@torque.net \
    --cc=kurt@garloff.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mra@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.