Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:services:storage_services:backup:tsm:admin:fc_stuff [2023/02/03 08:44] – [manual switch off/on of HBA] bnachtwen:services:storage_services:backup:tsm:admin:fc_stuff [2023/02/03 09:38] (current) bnachtw
Line 1: Line 1:
 ====== some useful commands around fibre channel ====== ====== some useful commands around fibre channel ======
-===== WWN & Co ===== +===== get adapters, WWN, WWPN, etc. ===== 
-==== get the wwn from the adapers ==== +==== get FC adapters / HBAs ====
-==SLES ===+
 <code> <code>
-for i in $(ls -/sys/class/scsi_host/host*/device/fc_host/host*/port_name); do echo $i $(cat $i);done+h212: ls -/sys/class/fc_host 
 +total 0 
 +lrwxrwxrwx 1 root root 0  3. Feb 08:45 host1 -> ../../devices/pci0000:3a/0000:3a:00.0/0000:3b:00.0/host1/fc_host/host1 
 +lrwxrwxrwx 1 root root 0  3. Feb 08:45 host16 -> ../../devices/pci0000:3a/0000:3a:00.0/0000:3b:00.1/host16/fc_host/host16 
 +lrwxrwxrwx 1 root root 0  3. Feb 08:45 host17 -> ../../devices/pci0000:5d/0000:5d:00.0/0000:5e:00.0/host17/fc_host/host17 
 +lrwxrwxrwx 1 root root 0  3. Feb 08:45 host18 -> ../../devices/pci0000:5d/0000:5d:00.0/0000:5e:00.1/host18/fc_host/host18
 </code> </code>
-e.g.+==== get adapter type ====
 <code> <code>
-for i in $(ls -d /sys/class/scsi_host/host*/device/fc_host/host*/port_name); do echo $i $(cat $i);done +h212:lspci | grep Fibre 
-/sys/class/scsi_host/host15/device/fc_host/host15/port_name 0x2100f4e9d455702c +3b:00.0 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02) 
-/sys/class/scsi_host/host16/device/fc_host/host16/port_name 0x2100f4e9d455702d +3b:00.1 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02
-/sys/class/scsi_host/host17/device/fc_host/host17/port_name 0x2100f4e9d45573c8 +5e:00.0 Fibre Channel: QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter (rev 01) 
-/sys/class/scsi_host/host18/device/fc_host/host18/port_name 0x2100f4e9d45573c9+5e:00.1 Fibre Channel: QLogic Corp. ISP2722-based 16/32Gb Fibre Channel to PCIe Adapter (rev 01)
 </code> </code>
 +==== get the wwn from the adapters ====
 +<code>
 +h212:~ # awk '{print "device:" substr(FILENAME, $0)" -- WWN: \"" $0"\" "}'   /sys/class/fc_host/host*/port_name
 +device:/sys/class/fc_host/host16/port_name -- WWN: "0x2001000e1e302d35" 
 +device:/sys/class/fc_host/host17/port_name -- WWN: "0x2100f4e9d45900ca" 
 +device:/sys/class/fc_host/host18/port_name -- WWN: "0x2100f4e9d45900cb" 
 +device:/sys/class/fc_host/host1/port_name -- WWN: "0x2001000e1e302d34" 
 +</code>
 +==== get Port state ====
 +
 === using systool === === using systool ===
 according to [[https://www.thegeekdiary.com/how-to-identify-the-hba-cardsports-and-wwn-in-rheloel/| The Geek Diary]] according to [[https://www.thegeekdiary.com/how-to-identify-the-hba-cardsports-and-wwn-in-rheloel/| The Geek Diary]]
Line 72: Line 86:
 The ''lspci'' command can be used to display the available Fibre Channel  (FC) Adapters: The ''lspci'' command can be used to display the available Fibre Channel  (FC) Adapters:
  
-<code> 
-# lspci | grep Fibre 
-81:00.0 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02) 
-81:00.1 Fibre Channel: QLogic Corp. ISP8324-based 16Gb Fibre Channel to PCI Express Adapter (rev 02) 
-</code> 
  
 The Fibre Channel (FC) HBA port access on RedHat can be temporarily disabled using the unbind string against the pci-device-id bus address. The Fibre Channel (FC) HBA port access on RedHat can be temporarily disabled using the unbind string against the pci-device-id bus address.