Wwn and wwn in linux

How To Find WWN in Linux Check HBA Connectivity Status

Find WWN in Linux is easy using existing commands and installing few systools will help us in getting the FC HBA adapter WWN in Linux. There are several ways to find out FC HBA WWN in Linux/Unix operating systems.

How To Find WWN in Linux Check HBA Connectivity Status

We can use lspci command to find the FC HBA adapter details first. lspci is a utility for displaying information about PCI buses in the system and devices connected to them.

# lspci |grep -i hba 0e:04.0 Fibre Channel: QLogic Corp. ISP2422-based 4Gb Fibre Channel to PCI-X HBA (rev 02)

above command will give us an whether Host Bus Adapter is installed in our Linux machine or not. If HBA is installed then we can see it’s details as shown above.

check how many hosts (Ports/Cards) are there in your Linux machine using below command

Using below command find if FC HBA is Online or Offline Or Link Status. If link status is down also we can get WWN in Linux. Below while loop script will list all of your HBA card details.

ls /sys/class/fc_host/ | while read host ; do cat /sys/class/fc_host/$host/port_state ; done

Find all the card information using below command

ls /sys/class/fc_host/ | while read host ; do cat /sys/class/fc_host/$host/port_name ; done

Method 2 – Find WWN in Linux

Another way of finding WWN in Linux is using systool utility this is an extra package you have to install in your Linux server using below command

wwn in linux

After successful installation run below command to get all the details about FC HBA

$ systool -c fc_host -v Class = "fc_host" Class Device = "host3" Class Device path = "/sys/devices/pci0000:00/0000:00:06.0/0000:0c:00.2/0000:0e:04.0/host3/fc_host/host3" dev_loss_tmo = "30" fabric_name = "0xffffffff" issue_lip = max_npiv_vports = "127" node_name = "0x2101001c321fb8f6" npiv_vports_inuse = "0" port_id = "0x000000" port_name = "0x2101001b321fb8f6" port_state = "Linkdown" port_type = "Unknown" speed = "unknown" supported_classes = "Class 3" supported_speeds = "1 Gbit, 2 Gbit, 4 Gbit" symbolic_name = "QLA2460 FW:v7.03.00 DVR:v8.07.00.26.06.8-k" system_hostname = "" tgtid_bind_type = "wwpn (World Wide Port Name)" uevent = vport_create = vport_delete = Device = "host3" Device path = "/sys/devices/pci0000:00/0000:00:06.0/0000:0c:00.2/0000:0e:04.0/host3" optrom_ctl = reset = uevent = "DEVTYPE=scsi_host"

All above details are not required for us just grep the required details using grep command

# cat /sys/class/fc_host/host3/port_state Linkdown # systool -c fc_host -v | grep port_name port_name color: #ff6600;">2101001b321fb8f6"

Highlighted in orange color is the WWN of FC HBA card host3

Читайте также:  Last password change on linux

That’s it about finding the WWN in Linux using command line utilities

Thanks for your wonderful Support and Encouragement

More than 40000 Techies in our community do you want part of it Join Now

My Name is ARK. Expert in grasping any new technology, Interested in Sharing the knowledge. Learn more & Earn MoreView all Posts

Источник

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.

Читайте также:  Установка arch linux 2022

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.

Источник

Читайте также:  Настройка zabbix astra linux

How to find WWN number of HBA and scan FC Luns in Linux

How to find WWN number of HBA and scan the FC Luns in LINUX

This post will help you with How to find WWN number of HBA and scan the FC Luns in LINUX.
If you are interested in learning, Request you to go through the below recommended tutorial.

How to find WWN number of HBA and scan the FC Luns in LINUX?

As a Linux admin, we may come in a situation like, to find WWN number of HBA and scan the FC Luns in LINUX which are provided by Storage team. Its need to be scan from the Linux OS side without rebooting server.

So How to find WWN number of HBA and scan the FC Luns in LINUX without rebooting the server?

Here is a solution to find WWN number of HBA and scan the FC Luns.

Identify the number of HBA adapters

Note the number of hosts available in the server. We have Two HBA here from the above example (host0 and host1).

To get the WWNN (World Wide Node Number) of HBA or FC card in Linux

cat /sys/class/fc_host/host0/node_name
0x20000000c9538d83
cat /sys/class/fc_host/host1/node_name
0x20000000c9538dac

To get the WWPN (World Wide Port Number) of HBA or FC card in Linux

cat /sys/class/fc_host/host0/port_name0x10000000c9538d83
cat /sys/class/fc_host/host1/port_name0x10000000c9538dac

If you have more HBAs, replace «host0 or host1» with «hostN «. In most cases, System admins need to provide the WWPN to storage admins for the storage allocation.

Scan newly added disks or rescan existing LUNs in Linux

If you have more number of hosts file under the directory /sys/class/fc_host, then use the command for each hosts file by replacing the «host0».

From Redhat Linux 5.4 onwards, redhat introduced “/usr/bin/rescan-scsi-bus.sh” script to scan all the SCSI bus and update the SCSI layer to reflect new devices.

We can also use the «rescan-scsi-bus.sh» script to detect new LUNs without rebooting the server.
This script is available with sg3-utils package. So install the sg3-utils package using yum, refer this link to configure yum repo server in Linux.

Now check the detected disks using fdisk command.

Hope you have got an idea How to find WWN number of HBA and scan the FC Luns in LINUX.

Keep practicing and have fun. Leave your comments if any.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.

find wwn number in linux, find wwn linux, hba status in linux, find WWN number of HBA card in linux, how to check wwpn number in linux

Источник

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