Correlating scsi-id's of drives to controllers and file-systems

Correlating scsi-id's of drives to controllers and file-systems

Post by l.. » Sun, 10 May 1998 04:00:00



HI,
I was wondering if there is a way if correlated the information in the
divvy table on OS5 to a controller and the SCSI-ID associated with
that divvy dev name; ie,
something like correlating /dev/hd1a being SCSI-ID 3 on disk ctlr
alad?

tnx
Les

 
 
 

Correlating scsi-id's of drives to controllers and file-systems

Post by Bela Lubki » Wed, 13 May 1998 04:00:00



> I was wondering if there is a way if correlated the information in the
> divvy table on OS5 to a controller and the SCSI-ID associated with
> that divvy dev name; ie,
> something like correlating /dev/hd1a being SCSI-ID 3 on disk ctlr
> alad?

It isn't easy, but let's give it a try.

First, we need to determine the device's major/minor numbers:

  # ls -l /dev/hd1a /dev/v1 /dev/v2
  brw-------   1 sysinfo  sysinfo    1,111 Sep 17  1996 /dev/hd1a
  brw-r-----   1 sysinfo  sysinfo    1,168 Oct 14  1996 /dev/v1
  brw-r-----   1 sysinfo  sysinfo   91,104 Feb 10  1997 /dev/v2

My test system is a pure-SCSI system.  On such a system, all hard disks
are accessed through the "hd" driver.  Each physical disk consumes 64
minor numbers.  Since OpenServer only supports 256 minor numbers for
each major, an "extended minor numbers" scheme is used to support the
5th and higher disks.  This looks like different major numbers, but the
effect is as if one major had >256 minors.  We can see this in mdevice:

  # grep '^hd' /etc/conf/cf.d/mdevice
  hd      hoc     BirobCcGk       hd      1       1       1       1       -1
  hd      hoc     BiobCcGkM       hd      91      91      1       256     -1

The first entry tells us that 1 is the major number for "hd".  The
second tells us that 91 is an extended major for "hd".  The "M" in field
3 means "extended major", and the 256 in field 8 tells us what range of
minor numbers it covers (256..511).

So /dev/v2 is really major number 1 ("hd"), minor number 104 + 256 =
360.

Each hard disk consumes 64 minors:

  1st    0..63
  2nd   64..127
  3rd  128..191
  4th  192..255
  5th  256..319
  6th  320..383

So /dev/hd1a is on the 2nd, /dev/v1 is on the 3rd, and /dev/v2 is on the
6th hard disk.

Finally, /etc/conf/cf.d/mscsi gives us the mapping of hard disk numbers
to SCSI bus locations:

  # egrep '^.ha|Sdsk.' /etc/conf/cf.d/mscsi
  *ha     attach  number  ID      lun     bus
  alad    Sdsk    0       0       0       0
  alad    Sdsk    0       2       0       0
  alad    Sdsk    0       1       0       0
  alad    Sdsk    0       3       0       0
  alad    Sdsk    0       4       0       0
  alad    Sdsk    0       6       0       0

/dev/hd1a, on the 2nd SCSI disk, is on "alad" adapter #0, ID 2, LUN 0.
/dev/v1, on the 3rd SCSI disk, is on "alad" adapter #0, ID 1, LUN 0.
/dev/v2, on the 6th SCSI disk, is on "alad" adapter #0, ID 6, LUN 0.

The man page hd(HW) explains the minor number scheme for hard disk
devices.  From it we can learn that /dev/hd1a (minor #111) is the whole
active partition of its disk.  /dev/v1 (minor #168) and /dev/v2 (minor
#360) are division #0 of the active partition of their respective disks.

=============================================================================

On a pure-IDE system, the IDE hard disks use major #1 (driver "hd").
Since only 4 IDE drives are supported, extended major numbers aren't an
issue.  The mscsi file is not involved.  Drives map to minor numbers as
follows:

  1st (primary/master)      0..63
  2nd (primary/slave)      64..127
  3rd (secondary/master)  128..191
  4th (secondary/slave)   192..255

=============================================================================

On a combined IDE + SCSI system, the IDE drives use the "hd" driver as
above.  The SCSI drives use the "Sdsk" driver.  You need to look up the
major number(s) and possible minor number mapping for "Sdsk" in
/etc/conf/cf.d/mdevice.

Quote:>Bela<