SlideShare a Scribd company logo
1 of 7
Download to read offline
simple hands on multipathing in linux part 1 :
hello guys
this is hossein mehrara
i’m trying to create simple but resourceful documentation on storage and
multipathing in linux
so what is a san : a san (storage area network) is a network of storage devices
that can be accessed by multiple servers or computers, providing a shared pool /
lun of storage space. each computer on the network can access storage on the
san as though hba cards.
hba cards or fc cards :
a host bus adapter (hba) is a circuit board or integrated circuit adapter that
connects a host system ( server ) to san storage.
hba cards has the optical interfaces generally transmit data through optical fiber
cables called sfp , it’s high speed module to communicate with san switch.
hba cards like nic cards have verity if models from single port to quad port
hba and sfp
using hba cards and multipathing give us multiple paths to storage devices provide
connection redundancy, failover capability, load balancing, and improved
performance. device-mapper multipath (dm-multipath) is a multipathing tool that
enables you represent multiple i/o paths between a server and a storage device as
a single path.
without dm-multipath, the system treats each path as being separate even though
it connects the server to the same storage device. dm-multipath creates a single
multipath device, /dev/mapper/mpathn, that subsumes the underlying
devices, /dev/sdc and /dev/sdf.
each hba cards has wwn / wwnp and some more identification which for now you
just need to know the wwn.
wwn – world wide name
wwnn – world wide node name
wwpn – world wide port name
wwid – world wide identifier
oui – organizationally unique identifier
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
now that we know the cards and cables are connected to SAN storage let’s start a
senario
my DBA team asked me to get new FAST external Disk from Storage and mount
it to my Linux server , so here’s what we do :
First in need to manage the external disk with package Device Mapper Multipath .
I will install the device-mapper-multipath package.
# yum install device-mapper-multipath
initiate the basic configuration settings of the multipathing feature.
# mpathconf --enable --with_multipathd y
This command also creates the /etc/multipath.conf , WWN file and bind file.
When devices are brought under the control of device-mapper-multipath the new
multipathed devices can be seen in three different places under the /dev directory:
1. /dev/dm-N
2. /dev/mapper/mpathN
3. /dev/mpath/mpathN
time to scan and get disks online without rebooting server :
I will first Identify the number of HBA adapters
systool -c fc_host -v
or
ls /sys/class/fc_host
which result is host0
then Use the below command to scan the LUNs
echo “- – -” > /sys/class/scsi_host/host0/scan
or
echo “1” > /sys/class/fc_host/host0/issue_lip
also I can easly install following package and run this script
yum install sg3_utils
/usr/bin/rescan-scsi-bus.sh
this with scan our hba card initiator and find disks , to check if we have got the disk
run : multipath -ll
you can see we have a disk called mpatha with 100G size
# multipath -ll
mpatha (3600601f0d057000018fc7845f46fe011) dm-1 dgc,raid 0
size=98g features='0' hwhandler='1 emc' wp=rw
|-+- policy='round-robin 0' prio=1 status=active
| - 11:0:0:0 sdd 8:128 active ready running
| - 10:0:0:0 sde 8:64 active ready running
-+- policy='round-robin 0' prio=0 status=enabled
|- 8:0:0:0 sdc 8:32 active ready running
- 9:0:0:0 sdf 8:80 active ready running
note that multipathing gave you single 100gb name / mpatha instead of 4 * 100gb
disk (sdc,sdd,sde,sdf) or as we call path from storage.
i will explain the modes of this multipathing like active/avtive and active/passive
later .
ok now what to do ?
just like same local disk format approuch we do
# fdisk /dev/mapper/maptha

More Related Content

Similar to Hands_on_multipath_p1.pdf

Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02FNian
 
3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfvvideos
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsManuel Vega
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modulesmohamedmoharam
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Sim Janghoon
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linuxVicent Selfa
 
Pursue container architecture with mincs
Pursue container architecture with mincsPursue container architecture with mincs
Pursue container architecture with mincsYuki Nishiwaki
 
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicHow to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicCircling Cycle
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovPivorak MeetUp
 
System Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperSystem Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperStefano Stabellini
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESJan Kalcic
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabMichelle Holley
 

Similar to Hands_on_multipath_p1.pdf (20)

Notes for LX0-101 Linux
Notes for LX0-101 Linux Notes for LX0-101 Linux
Notes for LX0-101 Linux
 
Top ESXi command line v2.0
Top ESXi command line v2.0Top ESXi command line v2.0
Top ESXi command line v2.0
 
Andresen 8 21 02
Andresen 8 21 02Andresen 8 21 02
Andresen 8 21 02
 
3. configuring a compute node for nfv
3. configuring a compute node for nfv3. configuring a compute node for nfv
3. configuring a compute node for nfv
 
Linux
LinuxLinux
Linux
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
unixtoolbox
unixtoolboxunixtoolbox
unixtoolbox
 
Comando kvm terminal
Comando kvm terminalComando kvm terminal
Comando kvm terminal
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
 
Linux filesystemhierarchy
Linux filesystemhierarchyLinux filesystemhierarchy
Linux filesystemhierarchy
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Pursue container architecture with mincs
Pursue container architecture with mincsPursue container architecture with mincs
Pursue container architecture with mincs
 
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-BaljevicHow to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
How to-mount-3 par-san-virtual-copy-onto-rhel-servers-by-Dusan-Baljevic
 
Linux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene PirogovLinux Tracing Superpowers by Eugene Pirogov
Linux Tracing Superpowers by Eugene Pirogov
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
System Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and LopperSystem Device Tree update: Bus Firewalls and Lopper
System Device Tree update: Bus Firewalls and Lopper
 
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLESQuick-and-Easy Deployment of a Ceph Storage Cluster with SLES
Quick-and-Easy Deployment of a Ceph Storage Cluster with SLES
 
linux installation.pdf
linux installation.pdflinux installation.pdf
linux installation.pdf
 
DPDK in Containers Hands-on Lab
DPDK in Containers Hands-on LabDPDK in Containers Hands-on Lab
DPDK in Containers Hands-on Lab
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 

Hands_on_multipath_p1.pdf

  • 1. simple hands on multipathing in linux part 1 : hello guys this is hossein mehrara i’m trying to create simple but resourceful documentation on storage and multipathing in linux so what is a san : a san (storage area network) is a network of storage devices that can be accessed by multiple servers or computers, providing a shared pool / lun of storage space. each computer on the network can access storage on the san as though hba cards.
  • 2. hba cards or fc cards : a host bus adapter (hba) is a circuit board or integrated circuit adapter that connects a host system ( server ) to san storage. hba cards has the optical interfaces generally transmit data through optical fiber cables called sfp , it’s high speed module to communicate with san switch. hba cards like nic cards have verity if models from single port to quad port hba and sfp using hba cards and multipathing give us multiple paths to storage devices provide connection redundancy, failover capability, load balancing, and improved performance. device-mapper multipath (dm-multipath) is a multipathing tool that
  • 3. enables you represent multiple i/o paths between a server and a storage device as a single path. without dm-multipath, the system treats each path as being separate even though it connects the server to the same storage device. dm-multipath creates a single multipath device, /dev/mapper/mpathn, that subsumes the underlying devices, /dev/sdc and /dev/sdf. each hba cards has wwn / wwnp and some more identification which for now you just need to know the wwn. wwn – world wide name wwnn – world wide node name wwpn – world wide port name wwid – world wide identifier oui – organizationally unique identifier to check the available hba ports, use the below file: # ls -l /sys/class/fc_host total 0
  • 4. 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 ::::::::::::::
  • 5. 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"
  • 6. 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 now that we know the cards and cables are connected to SAN storage let’s start a senario my DBA team asked me to get new FAST external Disk from Storage and mount it to my Linux server , so here’s what we do : First in need to manage the external disk with package Device Mapper Multipath . I will install the device-mapper-multipath package. # yum install device-mapper-multipath initiate the basic configuration settings of the multipathing feature. # mpathconf --enable --with_multipathd y This command also creates the /etc/multipath.conf , WWN file and bind file. When devices are brought under the control of device-mapper-multipath the new multipathed devices can be seen in three different places under the /dev directory: 1. /dev/dm-N 2. /dev/mapper/mpathN 3. /dev/mpath/mpathN time to scan and get disks online without rebooting server : I will first Identify the number of HBA adapters systool -c fc_host -v or ls /sys/class/fc_host which result is host0
  • 7. then Use the below command to scan the LUNs echo “- – -” > /sys/class/scsi_host/host0/scan or echo “1” > /sys/class/fc_host/host0/issue_lip also I can easly install following package and run this script yum install sg3_utils /usr/bin/rescan-scsi-bus.sh this with scan our hba card initiator and find disks , to check if we have got the disk run : multipath -ll you can see we have a disk called mpatha with 100G size # multipath -ll mpatha (3600601f0d057000018fc7845f46fe011) dm-1 dgc,raid 0 size=98g features='0' hwhandler='1 emc' wp=rw |-+- policy='round-robin 0' prio=1 status=active | - 11:0:0:0 sdd 8:128 active ready running | - 10:0:0:0 sde 8:64 active ready running -+- policy='round-robin 0' prio=0 status=enabled |- 8:0:0:0 sdc 8:32 active ready running - 9:0:0:0 sdf 8:80 active ready running note that multipathing gave you single 100gb name / mpatha instead of 4 * 100gb disk (sdc,sdd,sde,sdf) or as we call path from storage. i will explain the modes of this multipathing like active/avtive and active/passive later . ok now what to do ? just like same local disk format approuch we do # fdisk /dev/mapper/maptha