How to find WWN and WWPN of HBA card in Linux
There are several ways to detect the WWN of a Fibre Channel (FC) HBA and their details in Linux/Unix operating systems.
In this article, we will explain you the two best ways to find wwn number in Linux.
What is SAN?
A Storage Area Network (SAN) is a dedicated, independent, high-speed network that provides block-level network access to storage.
A SAN typically consists of cabling, host bus adapters, and SAN switches connected to storage arrays and servers.
SCSI (Small Computer System Interface) is a protocol used to communicate between servers and storage devices.
Purpose of wwn number
To add storage to the host, server has to be mapped with storage device by zoning the WWN of both host and storage in Fabric switch.
Once the zone is created, the storage team can assign LUNs to a specific Linux host, and new LUN can be discovered by scanning the storage LUN ID at the host end.
Popular FC host bus adapters are QLogic, Emulex, Brocade, Cisco, etc.
Some of the important abbreviations are listed below:
- WWN – World Wide Name
- WWNN – World Wide Node Name
- WWPN – World Wide Port Name
- WWID – World Wide Identifier
- OUI – Organizationally Unique Identifier
Checking HBA card information
You can easily identify how many HBA cards are installed in your Linux system by running ‘lspci’ command as shown below:
- # 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)
- 08:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)
- 08:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02)
Check this article on how to find information about other bus devices in Linux.
Method-1: Checking wwn number manually
HBA card wwn number can be manually identified by filtering the associated files under the “/sys” file system.
The files under sysfs provide information about devices, kernel modules, filesystems, and other kernel components, which are typically mounted automatically by the system at /sys.
To check the available HBA ports, use the below file:
- # ls -l /sys/class/fc_host
- total 0
- lrwxrwxrwx 1 root root 0 Oct 26 17:10 host1 -> ../../devices/pci0000:00/0000:00:02.0/0000:03:00.0/host1/fc_host/host1
- lrwxrwxrwx 1 root root 0 Oct 26 17:10 host2 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host2
- lrwxrwxrwx 1 root root 0 Oct 26 17:10 host3 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host3
- lrwxrwxrwx 1 root root 0 Oct 26 17:10 host4 -> ../../devices/pci0000:00/0000:00:02.2/0000:04:00.0/host2/fc_host/host4
The ‘fc_transport’ determines the correct host, channel, and target information from currently presented LUN:
- # ls -lrt /sys/class/fc_transport/
- drwxr-xr-x 2 root root 0 May 27 09:40 target7:0:2
- drwxr-xr-x 2 root root 0 May 27 09:40 target7:0:1
- drwxr-xr-x 2 root root 0 May 27 09:40 target7:0:0
- drwxr-xr-x 2 root root 0 May 27 09:40 target5:0:2
- drwxr-xr-x 2 root root 0 May 27 09:40 target5:0:1
- drwxr-xr-x 2 root root 0 May 27 09:40 target5:0:0
You can verify a list of ‘wwn’ number of the fc host (HBA card) using the following file:
- # cat /sys/class/fc_host/host?/port_name
- 0x500143802426baf2
- 0x500143802426baf3
- 0x500143802426baf4
- 0x500143802426baf5
Use the following file to check a specific fc host wwn number:
- # cat /sys/class/fc_host/host1/node_name
- 0x500143802426baf2
To find the status of HBA ports, use the below file (online/offline):
- # more /sys/class/fc_host/host?/port_state
- ::::::::::::::
- /sys/class/fc_host/host1/port_state
- ::::::::::::::
- Online
- ::::::::::::::
- /sys/class/fc_host/host2/port_state
- ::::::::::::::
- Online
- ::::::::::::::
- /sys/class/fc_host/host3/port_state
- ::::::::::::::
- Online
- ::::::::::::::
- /sys/class/fc_host/host4/port_state
- ::::::::::::::
- Online
Method-2: Checking wwn number using systool command
The systool is a tool that uses APIs provided by libsysfs to gather information. It allows you to view system device information by bus, class, and topology.
When you run systool without parameters, it will present all available bus types, device classes, and root devices.
How to install systool in Linux
systool can be easily installed from the distribution official repository.
For RHEL/CentOS 6/7 systems, use the yum command to install systool:
- $ sudo yum install -y sysfsutils
For RHEL/CentOS 8 and Fedora systems, use the dnf command to install systool:
- $ sudo dnf install -y sysfsutils
Once the sysfsutils package is installed on the Linux system, run the following command to find the WWN number of fc host:
- # systool -c fc_host -v | grep port_name
- port_name = "0x500143802426baf2"
- port_name = "0x500143802426baf3"
- port_name = "0x500143802426baf4"
- port_name = "0x500143802426baf5"
Run the following command to check the state of HBA ports:
- # systool -c fc_host -v | grep port_state
- port_state = "Online"
- port_state = "Online"
- port_state = "Online"
- port_state = "Online"
If you want to check wwn number of a specific fc host , run the following command:
- # systool -c fc_host -v -d host2 | grep port_name
Conclusion
In this guide, we have shown you 2 simple methods to find WWN, WWPN of HBA card and the status of HBA ports in Linux.
If you have any questions or feedback, feel free to comment below.
转载自:
https://www.2daygeek.com/how-to-find-wwn-wwnn-wwpn-number-of-hba-card-in-linux/
How to find WWN and WWPN of HBA card in Linux的更多相关文章
- 各平台操作系统查询主机WWPN
查询主机WWPN 目录 3.4.3.8.2.3 查询主机WWPN 3.4.3.8.2.3.1 查看主机HBA相应端口的WWPN(Windows) 3.4.3.8.2.3.2 查看主机HBA相应端口的W ...
- HBA 介绍
1.首先介绍一下什么是HBA. 这里所说的HBA,全称FC HBA,也就是Fibre Channel Host Bus Adapter.在FC网络中,主机(如服务器)需要和FC网络.FC存储设备(如S ...
- 几种系统下查看FC HBA卡信息的方法
几种系统下查看FC HBA卡信息的方法 目 录 几种系统下查看FC HBA卡信息的方法 FC HBA卡概述 Windows系统下查看FC HBA卡的信息 Linux系统下查看FC HBA卡的信息 U ...
- How to check WWN and Multipathing on Windows Server
There are many ways to find the World Wide Name (WWN) of fibre channel HBA connected to windows serv ...
- VMware虚拟化培训手册
一.VMware虚拟化架构概述 1.1VMware虚拟化架构图 如上图所示,虚拟化由物理主机(即ESXI主机).虚拟化管理程序(vCenter Server).虚拟机(操作系统).存储等基本组成. 1 ...
- Linux/hp unix/AIX日常巡检脚本(转)
以下为Linux/hp unix/AIX日常巡检脚本,大家可以参考着进行改写,用于自己的服务器. #!/usr/bin/ksh syserrdate=`date +"%m/%d"` ...
- ansible字符串处理(一)
[root@node-1 test]# ansible-playbook hba_card_check.yml PLAY [compute[0]] ************************** ...
- 操作系统下查看HBA卡信息wwn的方法
一.Windows 系统在Windows系统中,可以使用FC HBA卡厂家提供的管理软件查看光纤适配器的WWN号码,具体如下:Qlogic:SANsurferEmulex:HBAnyware http ...
- vSphere 查看FC HBA的WWNN和WWPN
# 查看WWN号
- AIX查看HBA卡的WWN号
1,获得AIX主机连接的光纤设备: # lsdev -Cc adapter -S a | grep fcs fcs0 Available 09-08 FC Ad ...
随机推荐
- React函数式组件值之useRef()和useImperativeHandle()
一.useRef useRef共有两种用法,获取子组件的实例(只有类组件可用),在函数组件中的一个全局变量,不会因为重复 render 重复申明, 类似于类组件的 this.xxx. 1. useRe ...
- centos6.5最小安装不能联网
因为个人需要,在一台笔记本安装centos6.5最小安装时遇到了无法有线联网,后面经过了几个小时的处理 总算理清楚并解决了这个问题.亲测有效而不是转载! 如上图所示 处理这个问题颇有感受,在网上找了很 ...
- Docker 安装 PHP+Nginx
安装Nginx docker pull nginx 安装PHP docker pull php:7.3.5-fpm 启动PHP-FPM docker run --name myphpfpm -v /d ...
- Android中动态添加tab
来源过于啰嗦,这里只有简化后的. 转载请注明出处 http://www.cnblogs.com/zaiyuzhong/p/add-tab-dynamic-in-android.html 建立对应的布 ...
- [WSL-1-Ubuntu]使用oh-my-zsh美化你的WSL(附脚本)
在腾讯云买的那个1c2g的服务器,想用mycat搭建一个mysql cluser,用docker部署了一主一从内存就没了一半,可一主一从没啥作用,起码也得2主2从吧?而且还有HA呢,但内存和钱包不给力 ...
- 12组-Beta冲刺-2/5
一.基本情况 队名:字节不跳动 组长博客:https://www.cnblogs.com/147258369k/p/15594989.html Github链接:https://github.com/ ...
- (未完成)JAVAWEB学习——
一.Servlet开发 1.sun公司提供的一种动态web资源开发技术,本质上就要是一段Java小程序,可以将Servlet加入到容器中运行Servlet. *servlet容器 -- 能够运行ser ...
- Virtualbox网络设置
记录一下https://ladybug.top/%E8%BD%AF%E4%BB%B6%E5%AE%89%E8%A3%85&%E9%85%8D%E7%BD%AE/complete-the-net ...
- 斐讯K2_V22.6.507.43降级+刷机整个过程
K2刷机整个过程 (包括降级) 开始之前请先下载好相对应的工具包,其中包括: 官方固件:"K2_V22.6.506.28.bin"."K2_V22.6.507.43.bi ...
- gitee部署
1.安装git 下载地址:https://npm.taobao.org/mirrors/git-for-windows/,拉到最下方选最新版,点击进去后选择对应windows版本的exe文件,默认安装 ...