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

hba status in linux, find wwn number in linux, How to find WWN number of HBA in LINUX, How to find wwn number in Redhat Linux, how to check wwpn number in linux

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
systool -c fc_host -v
or
ls /sys/class/fc_host
host0 host1
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
[ads-post]
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 the newly added or rescan the existing LUNs in Linux
echo "1" > /sys/class/fc_host/host0/issue_lip
echo "- - -" > /sys/class/scsi_host/host0/scan
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.
yum install sg3_utils
rescan-scsi-bus.sh

Now check the detected disks using fdisk command.

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.
YouTube | Facebook | Twitter | Pinterest | Rss
Keywords : systool -c fc_host -v linux, hba status in linux, find wwn number in linux, find wwn linux, find WWN Number of HBA card in Redhat linux, How to identify the HBA cards/ports and WWN in Linux, How To Find Fiber Host Bus Adapter (Fiber HBA) WWN On Linux, How to find WWN number of HBA in LINUX, How to find wwn in Redhat Linux, how to check wwpn number in linux
May 20, 2016

Post a Comment

[disqus][facebook][blogger]

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget