Here's the steps
- determine the hba's scsi bus number, set VENDOR to the vendor of your fibre channel array
In this case, my magical number is 3.[root@host ~] grep -B1 "Vendor: $VENDOR" /proc/scsi/scsi |grep Host |head Host: scsi3 Channel: 00 Id: 00 Lun: 00 Host: scsi3 Channel: 00 Id: 00 Lun: 01 Host: scsi3 Channel: 00 Id: 00 Lun: 02 Host: scsi3 Channel: 00 Id: 00 Lun: 03
- find the fc_host directory for the hba
RHEL5
RHEL6[root@host ~] cd /sys/class/scsi_host/host3/device/fc_host:host3
[root@host ~] cd /sys/class/scsi_host/host3/device/fc_host/host3/
- look in port_name
[root@host host3]# cat port_name 0x2001002219....4f