My problem is that I wanted to filter access on a raid array instead of doing it on the switch. I could login to the switch and figure out the linux hba's wwn (world-wide-name), but I thought there must be a way to get it from the linux machine directly.
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
[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