Is there some other way to determine which /dev/sd* names map to which slots in an enclosure?
Background:
I'm running with Centos 7.2 3.10.0-327.36.3.el7.x86_64
I have one many HDD populated enclosure (not released yet, so can't give more details) and 4 - LSI 9300 HBAs, each connecting to 2 separate ESMs (SAS expanders connecting to separate drive ports) in the enclosure.
Normally, the linux ses driver populates links under /sys/class/enclosure/SLOT . . . which map each of the enclosure slots to a kernel device. For example:
Code: Select all
# ls -d1 /sys/class/enclosure/*/*
/sys/class/enclosure/10:0:4:0/components
/sys/class/enclosure/10:0:4:0/device
/sys/class/enclosure/10:0:4:0/power
/sys/class/enclosure/10:0:4:0/SLOT 00,7PG0TNJC
/sys/class/enclosure/10:0:4:0/SLOT 01,7PG276NR
/sys/class/enclosure/10:0:4:0/SLOT 02,7PG2HTZR
/sys/class/enclosure/10:0:4:0/SLOT 03,7PG2E5GR
. . .
/sys/class/enclosure/1:0:4:0/SLOT 03,7PG2E5GR
/sys/class/enclosure/1:0:4:0/SLOT 04,7PG2HHBR
/sys/class/enclosure/1:0:4:0/SLOT 05,7PG26PHR
/sys/class/enclosure/1:0:4:0/SLOT 06,7PG17V6C
/sys/class/enclosure/1:0:4:0/SLOT 07,7PG17W2C
. . .
Code: Select all
# sg_ses /dev/sg188 -p ed
XXX XXXXX XXX
Primary enclosure logical identifier (hex): 5000ccab03000480
Element Descriptor In diagnostic page:
generation code: 0x0
element descriptor by type list
Element type: Array device slot, subenclosure id: 0 [ti=0]
Overall descriptor: <empty>
Element 0 descriptor: [color=#FF0000]SLOT 00,7PG0TNJC[/color]
Element 1 descriptor: SLOT 01,7PG276NR
Element 2 descriptor: SLOT 02,7PG2HTZR
Element 3 descriptor: SLOT 03,7PG2E5GR
Element 4 descriptor: SLOT 04,7PG2HHBR
. . .
Under these "SLOT XX,SN" directories there should be a "device" link, which points back to the SCSI drive under a slot. Searching Internet, this appears to be the recommended way to discover which drives are in which slot, especially when building raid sets.
Code: Select all
# ls -d1 /sys/class/enclosure/10\:0\:4\:0/SLOT*/device/block/*
/sys/class/enclosure/10:0:4:0/SLOT 00,7PG0TNJC /device/block/sdha
/sys/class/enclosure/10:0:4:0/SLOT 01,7PG276NR /device/block/sdgz
/sys/class/enclosure/10:0:4:0/SLOT 02,7PG2HTZR /device/block/sdgu
/sys/class/enclosure/10:0:4:0/SLOT 03,7PG2E5GR /device/block/sdgp
/sys/class/enclosure/10:0:4:0/SLOT 04,7PG2HHBR /device/block/sdgl
. . .
When only two HBAs from one host are attached to the enclosure, the device
entries are populated correctly. But, when there are 4 LSI 9300 HBAs connecting to enclosure (2 to one ESM, 2 to the other), one of the HBA connections to each ESM is missing the "device" links.
Code: Select all
# ls -d1 /sys/class/enclosure/*
/sys/class/enclosure/10:0:4:0
/sys/class/enclosure/1:0:4:0
/sys/class/enclosure/11:0:4:0
/sys/class/enclosure/9:0:4:0
# ls -d1 /sys/class/enclosure/*/SLOT*/device
/sys/class/enclosure/10:0:4:0/SLOT 00,7PG0TNJC /device
/sys/class/enclosure/10:0:4:0/SLOT 01,7PG276NR /device
/sys/class/enclosure/10:0:4:0/SLOT 02,7PG2HTZR /device
. . .
/sys/class/enclosure/1:0:4:0/SLOT 00,7PG0TNJC /device
/sys/class/enclosure/1:0:4:0/SLOT 01,7PG276NR /device
/sys/class/enclosure/1:0:4:0/SLOT 02,7PG2HTZR /device
/sys/class/enclosure/1:0:4:0/SLOT 03,7PG2E5GR /device
. . .
The question is: is this a Centos bug (seems like it), something related to the enclosure operation, or is there some other (multipath?) setting I'm missing.
There is a bug I found which noted a problem in red hat 7.3 which sounds like it may be related (however the problem apparently didn't exist in 7.2). The fix is not planned until 7.4,
https://bugzilla.redhat.com/show_bug.cgi?id=1394089
I am unaware of any other method to map drive slots to kernel devices so that code can reliably exercise particular slots.
I'm unsure how to debug this further - Any ideas? (sorry for the long post)