rageek

A place for Unix Thoughts and Ideas

Show SAN Target information for HBA’s on a Solaris system

Here is a quick 1-liner for displaying all the Targets and LUNs that are seen by all the HBA’s on a Solaris System

fcinfo hba-port | grep ‘Port WWN’ | awk ‘{print $4}’ | xargs -i sh -c ” echo HBA {}; fcinfo remote-port -sl -p {}”

This outputs the following (note: the space formatting seems to be lost in the posting)

root@testserver # fcinfo hba-port | grep ‘Port WWN’ | awk ‘{print $4}’ | xargs -i sh -c ” echo HBA {}; fcinfo remote-port -sl -p {}”
HBA 10000000c98ba51a
Remote Port WWN: 50060e800547725d
Active FC4 Types: SCSI
SCSI Target: yes
Node WWN: 50060e800547725d
Link Error Statistics:
Link Failure Count: 0
Loss of Sync Count: 0
Loss of Signal Count: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 0
Invalid CRC Count: 0
LUN: 0
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd0s2
LUN: 1
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd1s2
LUN: 2
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd2s2
LUN: 3
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd3s2
LUN: 4
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd4s2
LUN: 5
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd5s2
LUN: 6
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd6s2
LUN: 7
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd7s2
LUN: 8
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd8s2
LUN: 9
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd9s2
LUN: 10
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd10s2
LUN: 11
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c2t50060E800547725Dd11s2
HBA 10000000c96e954a
Remote Port WWN: 50060e800547724d
Active FC4 Types: SCSI
SCSI Target: yes
Node WWN: 50060e800547724d
Link Error Statistics:
Link Failure Count: 0
Loss of Sync Count: 0
Loss of Signal Count: 0
Primitive Seq Protocol Error Count: 0
Invalid Tx Word Count: 0
Invalid CRC Count: 0
LUN: 0
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd0s2
LUN: 1
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd1s2
LUN: 2
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd2s2
LUN: 3
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd3s2
LUN: 4
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd4s2
LUN: 5
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd5s2
LUN: 6
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd6s2
LUN: 7
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd7s2
LUN: 8
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd8s2
LUN: 9
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd9s2
LUN: 10
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd10s2
LUN: 11
Vendor: HITACHI
Product: OPEN-V -SUN
OS Device Name: /dev/rdsk/c3t50060E800547724Dd11s2

Advertisements

One response to “Show SAN Target information for HBA’s on a Solaris system

  1. d2 December 14, 2011 at 12:41 am

    Thanks, helpful stuff.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: