HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: How to view SAN switch and SAN box details usi...
Operating System - Linux
1832086
Members
2911
Online
110037
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2011 05:10 AM
04-12-2011 05:10 AM
How to view SAN switch and SAN box details using the hardware path of the LUN in Linux
There is one LUN assigned to one of the linux box...It is shown as "sda" with in linux...
I found some hardware path for this LUN "sda" using below steps...
lgora61:/ # cd /sys/block/sda
lgora61:/sys/block/sda # ll
lrwxrwxrwx 1 root root 0 Sep 18 2010 device -> ../../devices/pci0000:04/0000:04:0a.0/0000:06:01.0/host0/0:0:0:0
So I am thinking that "/devices/pci0000:04/0000:04:0a.0/0000:06:01.0/host0/0:0:0:0" is the path to the LUN "sda"...
Now I am having some questions:
1)Is "/devices/pci0000:04/0000:04:0a.0/0000:06:01.0/host0/0:0:0:0" hardware path?..If not, how to find the hardware path?
2)How to find the SAN switch and SAN box details from with in linux using above details?...If it is not using above details, how to find?
I found some hardware path for this LUN "sda" using below steps...
lgora61:/ # cd /sys/block/sda
lgora61:/sys/block/sda # ll
lrwxrwxrwx 1 root root 0 Sep 18 2010 device -> ../../devices/pci0000:04/0000:04:0a.0/0000:06:01.0/host0/0:0:0:0
So I am thinking that "/devices/pci0000:04/0000:04:0a.0/0000:06:01.0/host0/0:0:0:0" is the path to the LUN "sda"...
Now I am having some questions:
1)Is "/devices/pci0000:04/0000:04:0a.0/0000:06:01.0/host0/0:0:0:0" hardware path?..If not, how to find the hardware path?
2)How to find the SAN switch and SAN box details from with in linux using above details?...If it is not using above details, how to find?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2011 05:06 AM
04-13-2011 05:06 AM
Re: How to view SAN switch and SAN box details using the hardware path of the LUN in Linux
# scsi_id -g -u -s /block/sda
This will give you the WWID of the LUN, which you can map back to a vdisk depending on your array
# multipath -v3 | grep tgt
This will show you target WWN's of your array
As for switches, you'll need to refer to your SAN documentation for that :D
This will give you the WWID of the LUN, which you can map back to a vdisk depending on your array
# multipath -v3 | grep tgt
This will show you target WWN's of your array
As for switches, you'll need to refer to your SAN documentation for that :D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2011 06:50 AM
04-13-2011 06:50 AM
Re: How to view SAN switch and SAN box details using the hardware path of the LUN in Linux
The info for your SAN / HBA can be found in contents of files under:
/sys/class/fc_host/host*
For switch port ID:
cat /sys/class/fc_host/host*/port_id
Port Id identifies the switch port on the SAN switch your HBA is physically connected to. It varies from switch manu to switch manu and there is a table for that.
Take the following, save in a script say show_hbas.ksh, make executable and run as your regular tool:
#!/bin/ksh
#
# Display available FC Ports and their WWIDS
echo "show_hbas.ksh"
echo "v.0.1 Alzhy (crude. 02/2010)"
echo " "
for hba in `ls -d /sys/class/fc_host/host*`;do
FC_HOST=`basename $hba`
PortID=`cat $hba/port_id`
wwid=`cat $hba/port_name`
state=`cat $hba/port_state`
speed=`cat $hba/speed`
hba=`cat $hba/symbolic_name`
cat < FC-Host: $FC_HOST ($hba)
---------------------------------------------------------------------------
HBA WWID : $wwid PortId: $PortID
HBA State: $state Speed : $speed
EOB
done
Cheers!
/sys/class/fc_host/host*
For switch port ID:
cat /sys/class/fc_host/host*/port_id
Port Id identifies the switch port on the SAN switch your HBA is physically connected to. It varies from switch manu to switch manu and there is a table for that.
Take the following, save in a script say show_hbas.ksh, make executable and run as your regular tool:
#!/bin/ksh
#
# Display available FC Ports and their WWIDS
echo "show_hbas.ksh"
echo "v.0.1 Alzhy (crude. 02/2010)"
echo " "
for hba in `ls -d /sys/class/fc_host/host*`;do
FC_HOST=`basename $hba`
PortID=`cat $hba/port_id`
wwid=`cat $hba/port_name`
state=`cat $hba/port_state`
speed=`cat $hba/speed`
hba=`cat $hba/symbolic_name`
cat <
---------------------------------------------------------------------------
HBA WWID : $wwid PortId: $PortID
HBA State: $state Speed : $speed
EOB
done
Cheers!
Hakuna Matata.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP