As a system administrator, every now and then you may come across situations wherein your SAN admin presents you some storage (LUNS) and you can’t find where the hell has it gone. The following are some of the ways to list the LUNS presented on a controller or all the controllers on the server.
1. Using fcinfo
In Solaris 10, you can use the “fcinfo” utility which is a 2 step process to identify the Luns presented to the server.
1. Find the HBA port WWN number on the server:
# fcinfo hba-port
This command will show the HBA Port WWN among other information like the Node WWN, Device name, manufacturer, firmware, driver details etc.
root@myserver:/root # fcinfo hba-port HBA Port WWN: 21000022ff0553e9 OS Device Name: /dev/cfg/c5 Manufacturer: QLogic Corp. Model: 371-4324-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.03; EFI: 2.01; Serial Number: 0402R00-1102885753 Driver Name: qlc Driver Version: 3.00p Type: L-port State: online Supported Speeds: 2Gb 4Gb 8Gb Current Speed: 4Gb Node WWN: 20000022ff0553e9
Here 21000022ff0553e9 is the WWN number for the HBA port.
2. List SCSI targets for the remote port attached to the HBA port attached to the above.
# fcinfo -sl -p HBA-Port-WWN
root@myserver:/root # fcinfo remote-port -sl -p 21000022ff0553e9 Remote Port WWN: 202400a0b8744072 Active FC4 Types: SCSI Target: yes Node WWN: 200400a0b8744072 Link Error Statistics: Link Failure Count: 1 Loss of Sync Count: 2 Loss of Signal Count: 72 Primitive Seq Protocol Error Count: 0 Invalid Tx Word Count: 0 Invalid CRC Count: 0 LUN: 0 Vendor: SUN Product: LCSM100_F OS Device Name: /dev/rdsk/c5t202400A0B8744072d0s2 LUN: 2 Vendor: SUN Product: LCSM100_F OS Device Name: /dev/rdsk/c5t202400A0B8744072d2s2 LUN: 31 Vendor: SUN Product: Universal Xport OS Device Name: /dev/rdsk/c5t202400A0B8744072d31s2
Here, LUN0 and LUN2 are the actual disks and LUN31 is the Command device for the Storage controller
2. Using cfgadm
You can also find the above information using the “cfgadm” utility. One of the following commands should reveal the LUNS attached to the controller. Although the later works only on Solaris 10.
# cfgadm -al -o show_FCP_dev c5 or # cfgadm -al -o show_SCSI_LUNS c5
where c5 is the controller. If you do not mentioned the controller, it then displays for every single disk controller on the server.
root@myserver:/root # cfgadm -al -o show_FCP_dev c5 Ap_Id Type Receptacle Occupant Condition c5 fc-private connected configured unknown c5::202400a0b8744072,0 disk connected configured unknown c5::202400a0b8744072,2 disk connected configured unknown c5::202400a0b8744072,31 disk connected configured unknown
root@myserver:/root # cfgadm -al -o show_SCSI_LUN c5 Ap_Id Type Receptacle Occupant Condition c5 fc-private connected configured unknown c5::202400a0b8744072,0 disk connected configured unknown c5::202400a0b8744072,2 disk connected configured unknown c5::202400a0b8744072,31 disk connected configured unknown
Share your thoughts, if you know more ways of doing this.
5 thoughts on “List LUNs attached to HBA/Disk controllers in Solaris 10”
wwn of scsi
very useful information – thanks – greate
I want to add that I have superstitiously used qlogic only in Solaris ever since I had a huge production issue with Emulex. That resulted in a call to Sun Support and they told me to switch to Qlogic.
That being said, Qlogic definitely keeps their utilities and drivers uploaded. The SCLI interface for qlogic is fantastic and tells you a lot of great info: stats, configuration, wwn, etc..
What does the error mean on the ff:
Link Failure Count: 1
Loss of Sync Count: 2
Very useful information. any pointers to where can i learn more of this,will be much appreciated?