Hba wwn in linux

How to identify the HBA cards/ports and WWN in Linux

There are several commands to determine the WWN of a Fibre Channel (FC) HBA and their status (online/offline). The post discusses few of the most commonly used methods.

Method 1
To find the HBA cards installed on your system use :

# lspci -nn | grep -i hba 07:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02) 07:00.1 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)

To check the available HBA ports :

# ls -l /sys/class/fc_host total 0 drwxr-xr-x 3 root root 0 Feb 3 2015 host2 drwxr-xr-x 3 root root 0 Feb 3 2015 host3

To find the state of HBA ports (online/offline) :

# more /sys/class/fc_host/host?/port_state . /sys/class/fc_host/host2/port_state . Online . /sys/class/fc_host/host3/port_state . Online

To find the WWN numbers of the above ports :

# more /sys/class/fc_host/host?/port_name . /sys/class/fc_host/host2/port_name . 0x500143802426baf4 . /sys/class/fc_host/host3/port_name . 0x500143802426baf6

Method 2 : Using systool
Another useful command to find the information about HBAs is systool. If not already install, you may need to install the sysfsutils package.

To check the available HBA ports :

# systool -c fc_host Class = "fc_host" Class Device = "host2" Device Class Device = "host3" Device

To find the WWNs for the HBA ports :

# systool -c fc_host -v | grep port_name port_name = "0x500143802426baf4" port_name = "0x500143802426baf6"

To check the state of the HBA ports (online/offline) :

# systool -c fc_host -v | grep port_state port_state = "Online" port_state = "Online"

Источник

Вики IT-KB

Как идентифицировать контроллеры FC HBA в CentOS Linux

Для того, чтобы получить информацию о том, какие Fibre Channel контроллеры установлены сервере с ОС CentOS, существует целый ряд способов.

Читайте также:  Нет корневой файловой системы root file system linux mint

Способ №1. Утилита lspci

# lspci -nn | grep -i hba 0b:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA [1077:2432] (rev 03) 0b:00.1 Fibre Channel [0c04]: QLogic Corp. ISP2432-based 4Gb Fibre Channel to PCI Express HBA [1077:2432] (rev 03)

Способ №2. Информация в /sys/class/fc_host/

# ls -l /sys/class/fc_host lrwxrwxrwx. 1 root root 0 May 30 16:13 host2 -> ../../devices/pci0000:00/. /fc_host/host2 lrwxrwxrwx. 1 root root 0 May 30 16:13 host3 -> ../../devices/pci0000:00/. /fc_host/host3

Например, чтобы получить состояние (online/offline) каждого порта:

# more /sys/class/fc_host/host?/port_state . /sys/class/fc_host/host2/port_state . Online . /sys/class/fc_host/host3/port_state . Online

Другой пример. Получим информацию об идентификаторах WWN портов:

tag># more /sys/class/fc_host/host?/port_name . /sys/class/fc_host/host2/port_name . 0x500148800400c204 . /sys/class/fc_host/host3/port_name . 0x500148800400c206

Способ №3. Утилита systool

Утилита systool входит в пакет sysfsutils. Чтобы его установить на CentOS, выполните:

Пример подробного вывода информации по конкретному FC порту:

# systool -c fc_host -v Class = "fc_host" Class Device = "host2" Class Device path = "/sys/devices/pci0000:00/. /host2/fc_host/host2" dev_loss_tmo = "16" fabric_name = "0x100000051e04e030" issue_lip = max_npiv_vports = "127" node_name = "0x500148800400c205" npiv_vports_inuse = "0" port_id = "0xc91800" port_name = "0x500148800400c204" port_state = "Online" port_type = "NPort (fabric via point-to-point)" speed = "4 Gbit" supported_classes = "Class 3" supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit" symbolic_name = "HPAE312A FW:v7.03.00 DVR:v8.07.00.29.07.0-k1" system_hostname = "" tgtid_bind_type = "wwpn (World Wide Port Name)" uevent = vport_create = vport_delete = Device = "host2" Device path = "/sys/devices/pci0000:00/. /0000:0b:00.0/host2" fw_dump = nvram = "ISP " optrom_ctl = optrom = reset = sfp = "" uevent = "DEVTYPE=scsi_host" vpd = "▒+" .

Дополнительные источники информации

Автор первичной редакции:
Алексей Максимов
Время публикации: 01.06.2016 15:04

Источник

How to Find WWN Number Information in Linux

How-to-find-WWN-in-Linux

Too often system administrators require to collect details about host bus adapters in Linux. In this article, we are going to discuss how to find wwn number information in linux .

There are many other way and utility which is helpful in getting details but sysfsutils is the package delivered via Red Hat repository which is very helpful while dealing with any kind of HBA details and it usage systool command or script to fetch the required details.

Let us check few related things before directly going for how to find WWN number information in linux. Let us first check if HBA is installed or not in your linux server.

How to Check Which HBA Card is Installed in Linux

There are multiple options for how you can check which HBA card is installed in linux. Let`s go through some of them.

# dmesg |grep -i fibre  [ 1.640026] Emulex LightPulse Fibre Channel SCSI driver 12.0.0.5 [ 1.641479] scsi host1: Emulex LPe12000 PCIe Fibre Channel Adapter on PCI bus 07 device 00 irq 53 [ 4.083706] scsi host4: Emulex LPe12000 PCIe Fibre Channel Adapter on PCI bus 24 device 00 irq 56 
# lspci |grep -i emulex 07:00.0 Fibre Channel: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter (rev 03) 24:00.0 Fibre Channel: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter (rev 03) 
# dmesg |grep -i emulex [ 1.640026] Emulex LightPulse Fibre Channel SCSI driver 12.0.0.5 [ 1.641479] scsi host1: Emulex LPe12000 PCIe Fibre Channel Adapter on PCI bus 07 device 00 irq 53 [ 4.083706] scsi host4: Emulex LPe12000 PCIe Fibre Channel Adapter on PCI bus 24 device 00 irq 56

How to Check sysfsutils/systool is installed or not in Linux

You can validate the presence of sysutils in your server using the below method.

Читайте также:  Установка альт линукс второй системой

Method 1: Use the which command

# which systool   /usr/bin/systool //This is showing path for systool it means sysutils package is already installed.//

Method 2: Use the rpm command

# rpm -qa |grep sysfsutils sysfsutils-2.1.0-16.el7.x86_64 //This is showing package as it is already installed on my server .If it is not it will not display any result.//

How to Install sysfsutils in Linux

If it is not installed as mentioned above you can refer to how to install sysfsutils in linux below.

# yum --enablerepo=* install sysfsutils ============================================================================ Package Arch Version Repository Size ============================================================================ Installing:sysfsutils x86_64 2.1.0-16.el7 distro 41 k Transaction Summary ============================================================================ Install 1 Package Total size: 41 k Installed size: 123 k Is this ok [y/d/N]: y Warning: RPMDB altered outside of yum. Installed: sysfsutils.x86_64 0:2.1.0-16.el7

So now we have systool in action. Let us see how we can use systool to get all related information related to HBA.

How to get HBA Name in Linux

# systool -a -v -c scsi_host | egrep "info|modelname" bg_info = "BlockGuard Disabled" info modelname npiv_info = "NPIV Physical" nvme_info = "NVME Disabled" bg_info = "BlockGuard Disabled" info = "EMC LPe12000-E 8Gb PCIe Fibre Channel Adapter on PCI bus 24 device 00 irq 56 Logical Link Speed: 8000 Mbps" modelname = "LPe12000-E" npiv_info = "NPIV Physical" nvme_info = "NVME Disabled" 
# cat /sys/class/fc_host/host*/symbolic_name Emulex LPe12000-E FV1.00A12 DV12.0.0.5. HN:server231. OS:Linux Emulex LPe12000-E FV1.00A12 DV12.0.0.5.

How to get HBA Port Status in Linux

# cat /sys/class/fc_host/host*/port_state Online Online

How to Get HBA Port Speed in Linux

# cat /sys/class/fc_host/host*/speed 4 Gbit 4 Gbit

How to Get HBA Supported Speed in Linux

# cat /sys/class/fc_host/host*/supported_speeds 2 Gbit, 4 Gbit, 8 Gbit 2 Gbit, 4 Gbit, 8 Gbit

Getting Other HBA Details in Linux

# cat /sys/class/fc_host/host*/node_name 0x20000090fa2537d6 0x20000090fa253a29 # cat /sys/class/fc_host/host*/port_type NPort (fabric via point-to-point) NPort (fabric via point-to-point) # cat /sys/class/fc_host/host*/port_id 0x0a1600 0x0a2600 # cat /sys/class/fc_host/host*/fabric_name 0x100050eb1a5e9300 0x100050eb1a5e9300

We have seen how we can get various details about HBA and about WWN in linux. So let us come to our main topic about how to Find WWN Number Information in Linux.

First, we will see how systool can help and then proceed with the alternate procedure on how to find WWN number information in linux.

How to Find WWN in Linux

There are various methods that are helpful to find WWN lumber in Linux. As mentioned we will start with the systool.

First Method

How to find WWN Number Information in Linux using systool

systool utility comes with linux distros. If it is not available it can be installed on servers where HBA is already installed which will be really helpful in how to find WWN number information in linux.

 # systool -c fc_host -v (output truncated for clarity) Class Device path = "/sys/class/fc_host/host8" port_name node_name 

Second Method

How to find WWN Number Information in Linux using the system-level command

# cat /sys/class/fc_host/host*/port_name 0x10000090fa2537d6 0x10000090fa253a29

Third Method

How to find WWN Number Information in Linux using syminq command

If EMC Storage is being used so there is a chance you must have SYMCLI software installed. syminq comes with SYSCLI.syminq is also helpful in getting WWN in an easy way.

[[email protected]]# syminq hba Host Name : server HBA Type : FibreChannel HBA Name : Emulex-LPe11000-E-2 Vendor : Emulex Corporation Model : LPe11000-E Serial Number : BT01473025 Firmware Version : 2.72A2 (Z3D2.72A2), sli-3 Driver Version : 8.2.0.63.3p; HBAAPI(I) v2.1.g, 12-07-07 Node WWN : 20000000c9b0513a Number of Ports : 1 Port WWN : 10000000c9b0513a Port name : /sys/class/scsi_host/host3 Port type : NPort Port FCID : 2764032 Port speed : 4gbit Supported speed : 4gbit Port state : Online Supported COS : 00000008 Supported FC4 types : 00000100000000010000000 Active FC4 types : 00000100000000010000000 Max frame size : 2048

Fourth Method

How to find WWN Number Information in Linux using hbacmd command

hbacmd command can be used to find WWN in linux. It will work if hbanyware package is installed on the server.

# /usr/sbin/hbanyware/hbacmd listHBAs Manageable HBA List Port WWN : 10:00:00:00:c9:b0:55:2e Node WWN : 20:00:00:00:c9:b0:55:2e Fabric Name: 10:00:50:eb:1a:5f:c7:0c Flags : 8000fe00 Host Name : server Mfg : Emulex Corporation Serial No. : BT01474056 Port Number: n/a Mode : Initiator Port WWN : 10:00:00:00:c9:b0:51:32 Node WWN : 20:00:00:00:c9:b0:51:32 Fabric Name: 10:00:50:eb:1a:5f:bd:0c Flags : 8000fe00 Host Name : server Mfg : Emulex Corporation Serial No. : BT01472998 Port Number: n/a Mode : Initiator #

Conclusion

That`s it about how to find WWN Number information in linux. Using all the above methods you can find wwn number information in linux and all other HBA and WWN related information in linux. Hope this will help you with your query about how to find WWN Number information in linux.

Источник

Оцените статью
Adblock
detector