[OpenIndiana-discuss] Mapping LSI SAS Target numbers to disk SAS WWNs (Log Info 0x31120303)
Richard Elling
richard.elling at richardelling.com
Sun Mar 17 15:51:40 UTC 2013
On Mar 16, 2013, at 5:02 PM, Richard Elling <richard.elling at richardelling.com> wrote:
> there is a way to get this info from mdb... I added a knowledge base article on this at Nexenta a few years ago, lemme see if I can dig it up from my archives…
And the winner is:
echo "::mptsas -t" | mdb -k
mptsas_t inst ncmds suspend power
================================================================================
ffffff0703785000 0 0 0 ON=D0
The SCSI target information
devhdl 12, sasaddress 5000c5002128f332, phymask ff,devinfo 401
throttle 20, dr_flag 0, m_t_ncmds 0
devhdl 11, sasaddress 5000c50021295cb2, phymask ff,devinfo 401
throttle 20, dr_flag 0, m_t_ncmds 0
mptsas reports the devhdl and you can cross-reference to the SAS address (WWN)
-- richard
>
> On Mar 15, 2013, at 11:22 PM, "Richard L. Hamilton" <rlhamil at smart.net> wrote:
>
>> Running on something older (SXCE snv_97 on SPARC, or thereabouts), with an LSI SAS controller using the mpt driver:
>>
>> #! /bin/ksh
>> for dev in $( find /devices -type c -name 'sd@*:a,raw'|grep LSILogic,sas)
>> do
>> echo $dev
>> prtconf -v ${dev}|grep id1,
>> done
>>
>>
>> produced the following output
>>
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 0,0:a,raw
>> value='id1,sd at n5000c5000682fbef'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 1,0:a,raw
>> value='id1,sd at n5000c5000682fb0f'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 2,0:a,raw
>> value='id1,sd at n5000c500104a589f'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 3,0:a,raw
>> value='id1,sd at n5000c500104aa29b'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 4,0:a,raw
>> value='id1,sd at n5000c50041e49faf'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 5,0:a,raw
>> value='id1,sd at n5000c50041d6455f'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 6,0:a,raw
>> value='id1,sd at n5000c50041ddfebf'
>> /devices/pci at 8,600000/LSILogic,sas at 1/sd at 7,0:a,raw
>> value='id1,sd at n5000c50041e2be0b'
>>
>> I assume the lines beginning with value='id1,sd at n have the WWN following
>> that, right?
>>
>> This is a 1068, that I lucked into on eBay for my SB2K.
>>
>> If this approach could be adapted or cleaned up a bit for what you want,
>> the advantage is that it doesn't require lsiutil, but just uses plain old
>> prtconf. Presumably someone fluent in perl could figure out a way to
>> parse and format it more elegantly.
>>
>>
>>
>> On Mar 15, 2013, at 11:20 PM, Peter Tripp wrote:
>>
>>> No questions...just information for how to translate a Target ID to a SAS WWN on LSI MPT2 SAS2 controllers under Illumos/Solaris. My apologies for cross posting or if this is old hat, but I've been running an LSI SAS2 controller with SATA disks and had my logs fill up with repeated cryptic entries, but never found a troubleshooting strategy until tonight. Under load (scrub) the following will repeatedly show up:
>>>
>>> scsi: [ID 365881 kern.info] /pci at 0,0/pci15ad,7a0 at 15/pci1000,3030 at 0 (mpt_sas0):
>>> Log info 0x31120311 received for target 20.
>>> scsi_status=0x0, ioc_status=0x804b, scsi_state=0xc
>>> scsi: [ID 243001 kern.warning] WARNING: /pci at 0,0/pci15ad,7a0 at 15/pci1000,3030 at 0 (mpt_sas0):
>>> mptsas_handle_event_sync: IOCStatus=0x8000, IOCLogInfo=0x31120303
>>>
>>> I assumed this was due to a disk failing or a cabling problem (my LSI SAS 9200-16e SAS_2116 has directly cabled WD RE4 SATA disks) but which disk is Target 20? I took the time to label my drive caddies with their WWN to ease trouble shooting, but was never able to figure out how to translate Target ID into a SAS WWN so I narrow down my troubleshooting to a single device....until now.
>>>
>>> Run lsituil.i386 as root
>>> (LSIUtil Kit 1.63.zip\Solaris\lsiutil.i386 from http://www.juhonkoti.net/media/LSIUTIL-1.63.zip )
>>> * Select your MPT device
>>> * e (Enable expert mode in menus)
>>> * 20 (Diagnostics)
>>> * 1 (Inquiry Test)
>>> * 0 (Bus 0)
>>> * XX (Target number from above, Target 20 for me)
>>> * 0 (Lun 0)
>>> * 83 or 80 (SAS WWN and Disk Serial Number respectively)
>>> Output:
>>>
>>> VPD Page: [00-FF or RETURN for normal Inquiry] 83
>>> B___T___L Page
>>> 0 20 0 83
>>> 16 bytes of Inquiry Data returned
>>> 0000 : 00 83 00 0c 01 03 00 08 50 01 4e e2 b1 65 f5 d7 P N e
>>>
>>> VPD Page: [00-FF or RETURN for normal Inquiry] 80
>>> B___T___L Page
>>> 0 20 0 80
>>> 24 bytes of Inquiry Data returned
>>> 0000 : 00 80 00 14 20 20 20 20 20 57 44 2d 57 4d 41 59 WD-WMAY
>>> 0010 : 30 34 33 32 38 34 38 39 04328489
>>>
>>> The second half of the hex string from 83h is your WWN (50014ee2b165f5d7 above), and ASCII from 80h (WMAY04328489 above) the serial number. With that info one can check the cabling path or replace the disk or whatever. This should work with other LSI SAS2 2008/2118 controllers like the 9200-8e, 9211-8i, etc. Might even work with older SAS1 cards (1068, etc) since lsiutil should also support them.
>>>
>>> Just thought others might find it useful! Have a great night!
>>>
>>> -Pete
>>>
>>> Source:
>>> https://www.meteo.unican.es/trac/meteo/blog/SolarisSATADeviceName
>>>
>>> References:
>>> http://www.juhonkoti.net/2012/01/02/supermicro-jbod-sc847e16-rjbo-enclosure-with-solaris-openindiana
>>> http://openindiana.org/pipermail/openindiana-discuss/2012-June/008363.html
>>> _______________________________________________
>>> OpenIndiana-discuss mailing list
>>> OpenIndiana-discuss at openindiana.org
>>> http://openindiana.org/mailman/listinfo/openindiana-discuss
>>
>> --
>> eMail: mailto:rlhamil at smart.net
>> Home page: http://www.smart.net/~rlhamil/
>> Facebook, MySpace,
>> AIM, Yahoo, etc: ask
>>
>>
>>
>>
>>
>> _______________________________________________
>> OpenIndiana-discuss mailing list
>> OpenIndiana-discuss at openindiana.org
>> http://openindiana.org/mailman/listinfo/openindiana-discuss
--
ZFS storage and performance consulting at http://www.RichardElling.com
More information about the OpenIndiana-discuss
mailing list