[OpenIndiana-discuss] Best way to map SAS drives to physical positions

Jeppe Toustrup openindiana at tenzer.dk
Fri Oct 7 11:10:55 UTC 2011


On Fri, Oct 7, 2011 at 02:41, Christopher Chan
<christopher.chan at bradbury.edu.hk> wrote:
> On Wednesday, October 05, 2011 02:03 AM, Alasdair Lumsden wrote:
>> Have you tried:
>>
>> /usr/lib/fm/fmd/fmtopo -V
>>
>> ?
>>
>> It works with SES compatible JBOD enclosures and I can confirm it works
>> with the LSI JBODs we use.
>>
>
> Thanks Alasdair for this!
>
> I get enclosure id and bay id with this command. But boy, it sure does need
> lots of parsing.

Weird, that command lists the drives in a random order for me, and is
thus unusable for me to use for mapping WWNs to JBOD slots.

Here is an example of the information I get from the command for one
of the drives (also available here: https://gist.github.com/1270080):

hc://:product-id=X8DTU-LN4+:server-id=head01:chassis-id=1234567890/motherboard=0/hostbridge=2/pciexrc=2/pciexbus=3/pciexdev=0/pciexfn=0/iport=0/scsi-device=7
  group: protocol                       version: 1   stability: Private/Private
    resource          fmri
hc://:product-id=X8DTU-LN4+:server-id=head01:chassis-id=1234567890/motherboard=0/hostbridge=2/pciexrc=2/pciexbus=3/pciexdev=0/pciexfn=0/iport=0/scsi-device=7
  group: authority                      version: 1   stability: Private/Private
    product-id        string    X8DTU-LN4+
    chassis-id        string    1234567890
    server-id         string    head01
  group: storage                        version: 1   stability: Private/Private
    target-port       string    w5000cca369c5cf1a
    attached-port     string    w50080e520155d03f
    lun64             int64     0
    devid             string    id1,sd at n5000cca369c5cf1a
    manufacturer      string    ATA
    model             string    Hitachi HDS72302
    firmware-revision string    A180
    inquiry-device-type int32     0


It states in the FMRI string that the this is scsi-device 7, however,
the drive in question is really drive number 10 in the JBOD.
scsi-device 6 is really slot 2 and so on - random numbering it seems.

The sas2ircu command does however work fine for me, and gives me the
output I need. This is for instance for the same drive as above
(https://gist.github.com/1270081):

Device is a Hard disk
  Enclosure #                             : 3
  Slot #                                  : 10
  SAS Address                             : 50080e5-2-0155-d00a
  State                                   : Ready (RDY)
  Size (in MB)/(in sectors)               : 1907729/3907029167
  Manufacturer                            : ATA
  Model Number                            : Hitachi HDS72302
  Firmware Revision                       : A180
  Serial No                               : MN1220F30DT4LD
  GUID                                    : 5000cca369c5cf1a
  Protocol                                : SATA
  Drive Type                              : SATA_HDD


By the way Christopher, fmtopo has an option to output in XML format,
that may be easier to parse for you. Just run "/usr/lib/fm/fmd/fmtopo
-x" instead.

--
Venlig hilsen / Kind regards
Jeppe Toustrup (aka. Tenzer)



More information about the OpenIndiana-discuss mailing list