wwn of a linux hba

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

  1. determine the hba's scsi bus number, set VENDOR to the vendor of your fibre channel array
    [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
    In this case, my magical number is 3.
  2. find the fc_host directory for the hba
    RHEL5
    [root@host ~] cd /sys/class/scsi_host/host3/device/fc_host:host3
    RHEL6
    [root@host ~] cd /sys/class/scsi_host/host3/device/fc_host/host3/
  3. look in port_name
    [root@host host3]# cat port_name 0x2001002219....4f
Hope that helps...

About the Author...

Slides from LISA 2019 Linux systems troubleshooting #LISA2019 https://t.co/D4dMKflK6R Tue Oct 29 05:59:30 +0000 2019

https://t.co/AGeihMALAv configuring grub2 with EFI Fri Sep 13 05:20:01 +0000 2019

I published a Thing on @thingiverse! https://t.co/IYpRyEb7Hz #thingalert Tue Jul 23 19:27:57 +0000 2019

Nokogiri install on MacOSX https://t.co/v3An0miW9L Fri Jul 12 15:06:49 +0000 2019

HTML email with plain mailer plugin on Jenkins https://t.co/Z6FSDMDjy8 Thu Jul 11 21:07:25 +0000 2019