How to identify/get QLogic WWN on Red Hat Enterprise Linux 5 (RHEL5).
First identify your installed or recognised
# lspci | grep -i fibre 04:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03) 04:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03) 05:00.0 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03) 05:00.1 Fibre Channel: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA (rev 03)
On Red Hat Enterprise Linux 5 (5.x) is on /sys/class/fc_host/hostX/port_name
(X is your device 1,2,3,…N)
For get use:
cat /sys/class/fc_host/hostX/port_name
Sample with multiple HBA (Fibre) QLogic
# ls /sys/class/fc_host/ host1 host2 host3 host4 # cat /sys/class/fc_host/host[1-4]/port_name 0x2100001b32936e24 0x2101001b32b36e24 0x2100001b32932821 0x2101001b32b32821
On Red Hat Enterprise Linux 4 (AS/ES) is on /proc/scsi/qla2xxx/1 (1,2,3,..N)
Sample:
# egrep [node|port] /proc/scsi/qlx2xxx/0
scsi-qla0-adapter-node=200000e08b1c19f2;
scsi-qla0-adapter-port=210000e08b1c19f2;
Verified on Suse Linux Enterprise Server and CentOS/Redhat
The info is in
/sys/class/scsi_host/hostN/device/fc_host/hostN/port_name
Where “N” is the number of device for your fiber HBAs.
Unfortunately, you may have a large number of listings depending on the different cards (besides fiber HBA) that you have on your system. In my example, I have six listings:
host0 host1 host2 host3 host4 host5
but only two represent a fiber HBA.
So you may have to do some digging. In my case they are
host4 host5
(I have two HBAs installed)
So …
[root@centos63node01 ~]# cat /sys/class/scsi_host/host4/device/fc_host/host4/port_name 0x5001438003af1ffc [root@centos63node01 ~]# cat /sys/class/scsi_host/host5/device/fc_host/host5/port_name 0x5001438003af1b9e [root@centos63node01 ~]#
Here is a one liner command to find it. This is added 2/28/2014 per a comment on my blog made by reader Liivo L (THANKS Liivo L!!)
[root@testlinux ~]# cat /sys/class/scsi_host/host*/device/fc_host/host*/node_name 0x20000024ff5763d2 0x20000024ff5763d3 [root@testlniux ~]#
This is the way I did have it written down prior to Liivo L’s comment. Here’s my shortcut bash command if you don’t want to look around. This command is executed in the /sys/class/scsi_host directory. While the one liner command is easier, this is a nice example of using a “for do done” loop on your command line (very handy for many other things)
[root@centos63node01 scsi_host]# for i in 0 1 2 3 4 5; do cat host$i/device/fc_host/host$i/port_name; done cat: host0/device/fc_host/host0/port_name: No such file or directory cat: host1/device/fc_host/host1/port_name: No such file or directory cat: host2/device/fc_host/host2/port_name: No such file or directory cat: host3/device/fc_host/host3/port_name: No such file or directory 0x5001438003af1ffc 0x5001438003af1b9e [root@centos63node01 scsi_host]#
mpathconf --user_friendly_names y --find_multipaths y --with_multipathd y /etc/init.d/multipathd start for i in /sys/class/fc_host/host* do echo '1' > $1/issue_lip done for i in /sys/class/scsi_host/host* do echo '- - -' > $i/scan done