Back to the main page

Oracle Linux FC tips


If you need to look for a FC HBA installed on Linux (Oracle Linux or Redhat), then have pciutils rpm installed, it has program lspci that list all PCI devices.
#  rpm -qi pciutils
Name        : pciutils                     Relocations: (not relocatable)
Version     : 3.1.10                            Vendor: Oracle America
Release     : 4.el6                         Build Date: Sat 16 Aug 2014 04:00:11 PM EDT
Install Date: Wed 03 Jun 2015 08:57:27 AM EDT      Build Host: ca-buildj3.us.oracle.com
Group       : Applications/System           Source RPM: pciutils-3.1.10-4.el6.src.rpm
Size        : 183936                           License: GPLv2+
Signature   : RSA/8, Mon 25 Aug 2014 08:55:08 PM EDT, Key ID 72f97b74ec551f03
URL         : http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
Summary     : PCI bus related utilities
Description :
The pciutils package contains various utilities for inspecting and
setting devices connected to the PCI bus. The utilities provided
require kernel version 2.1.82 or newer (which support the
/proc/bus/pci interface).

# lspci | grep -i fibre 
40:00.0 Fibre Channel: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter (rev 03)
40:00.1 Fibre Channel: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host Adapter (rev 03)

Another rpm to have installed is lsscsi, so lsscsi command lists SCSI devices
# rpm -qi lsscsi
Name        : lsscsi                       Relocations: (not relocatable)
Version     : 0.23                              Vendor: Oracle America
Release     : 3.el6                         Build Date: Fri 08 May 2015 01:00:38 AM CST
Install Date: Sat 01 Aug 2015 04:09:59 AM CST      Build Host: x86-ol6-builder-08.us.oracle.com
Group       : Applications/System           Source RPM: lsscsi-0.23-3.el6.src.rpm
Size        : 77266                            License: GPLv2+
Signature   : RSA/8, Thu 14 May 2015 07:04:23 AM CST, Key ID 72f97b74ec551f03
URL         : http://sg.danny.cz/scsi/lsscsi.html
Summary     : List SCSI devices (or hosts) and associated information
Description :
Uses information provided by the sysfs pseudo file system in Linux kernel
2.6 series to list SCSI devices or all SCSI hosts. Includes a "classic"
option to mimic the output of "cat /proc/scsi/scsi" that has been widely
used prior to the lk 2.6 series.

Here, some LUNs are presented to a system.
#  lsscsi 
[6:0:0:0]    disk    HITACHI  H109060SESUN600G A690  /dev/sdb
[6:0:1:0]    disk    HITACHI  H109060SESUN600G A690  /dev/sdc
[7:0:0:1]    disk    SUN      ZFS Storage 7120 1.0   /dev/sdd
[8:0:0:0]    disk    ORACLE   SSM              PMAP  /dev/sda

# multipath -ll 
Mar 04 16:48:13 | zram0: No fc_host device for 'host-1'
Mar 04 16:48:13 | zram0: No fc_host device for 'host-1'
Mar 04 16:48:13 | zram0: No fc_remote_port device for 'rport--1:-1-0'
3600144f0f941fba9000051fff0560037 dm-1 SUN     ,ZFS Storage 7120
size=100G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 7:0:0:1 sdd   8:48  active ready  running
ORACLE_SSM_070F31EA2C043146-0:0 dm-2 ORACLE  ,SSM
size=3.6G features='0' hwhandler='0' wp=rw
`-+- policy='service-time 0' prio=1 status=active
  `- 8:0:0:0 sda   8:0   active ready  running

List some info of FC HBA
# ls -la /sys/class/fc_host
total 0
drwxr-xr-x  2 root root 0 Mar  3 13:07 .
drwxr-xr-x 54 root root 0 Mar  3 13:07 ..
lrwxrwxrwx  1 root root 0 Mar  3 13:08 host7 -> ../../devices/pci0000:00/0000:00:03.0/0000:40:00.0/host7/fc_host/host7
lrwxrwxrwx  1 root root 0 Mar  3 13:08 host9 -> ../../devices/pci0000:00/0000:00:03.0/0000:40:00.1/host9/fc_host/host9
# cat /sys/class/fc_host/host*/port_name
0x10000090fa13c9bc
0x10000090fa13c9bd
# cat /sys/class/fc_host/host*/port_state
Online
Linkdown
# cat /sys/class/fc_host/host*/port_type
NPort (fabric via point-to-point)
Unknown

Also install sysfsutils rpm to get program systool
#  systool -c fc_host -v 
Class = "fc_host"

  Class Device = "host7"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:40:00.0/host7/fc_host/host7"
    active_fc4s         = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    dev_loss_tmo        = "30"
    fabric_name         = "0x100000051e35d698"
    issue_lip           = 
    max_npiv_vports     = "255"
    maxframe_size       = "2048 bytes"
    node_name           = "0x20000090fa13c9bc"
    npiv_vports_inuse   = "0"
    port_id             = "0x510900"
    port_name           = "0x10000090fa13c9bc"
    port_state          = "Online"
    port_type           = "NPort (fabric via point-to-point)"
    speed               = "2 Gbit"
    supported_classes   = "Class 3"
    supported_fc4s      = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 "
    supported_speeds    = "2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "Emulex LPe12002-S FV2.01A10 DV10.6.61.0 HN:host.etcfstab.com OS:Linux"
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = 
    vport_delete        = 

    Device = "host7"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:40:00.0/host7"
      uevent              = "DEVTYPE=scsi_host"

  Class Device = "host9"
  Class Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:40:00.1/host9/fc_host/host9"
    active_fc4s         = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00  0x00 0x00 0x00 0x00 "
    dev_loss_tmo        = "30"
    fabric_name         = "0x0"
    issue_lip           = 
    max_npiv_vports     = "255"
    maxframe_size       = "2048 bytes"
    node_name           = "0x20000090fa13c9bd"
    npiv_vports_inuse   = "0"
    port_id             = "0x000000"
    port_name           = "0x10000090fa13c9bd"
    port_state          = "Linkdown"
    port_type           = "Unknown"
    speed               = "unknown"
    supported_classes   = "Class 3"
    supported_fc4s      = "0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00 "
    supported_speeds    = "2 Gbit, 4 Gbit, 8 Gbit"
    symbolic_name       = "Emulex LPe12002-S FV2.01A10 DV10.6.61.0 HN:host.etcfstab.com OS:Linux"
    tgtid_bind_type     = "wwpn (World Wide Port Name)"
    uevent              =
    vport_create        = 
    vport_delete        = 

    Device = "host9"
    Device path = "/sys/devices/pci0000:00/0000:00:03.0/0000:40:00.1/host9"
      uevent              = "DEVTYPE=scsi_host"

Let's see what info we see on the FC switch side (in this case it's some HP FC switch). Login to the FC switch and look info for the port 9.
somehpfcswitch:admin> portshow 9
portName:
portHealth: No License
Authentication: None
portDisableReason: None
portCFlags: 0x1
portFlags: 0x24b03 PRESENT ACTIVE F_PORT G_PORT U_PORT LOGICAL_ONLINE LOGIN NOELP LED ACCEPT
portType:  11.0
POD Port: License available to enable the port
portState: 1    Online
portPhys:  6    In_Sync
portScn:   32   F_Port
port generation number:    2023
portId:    510900
portIfId:    43020009
portWwn:   20:09:00:05:1e:35:d6:98
portWwn of device(s) connected:
        10:00:00:90:fa:13:c9:bc  < ----- this is the server hba wwn 
Distance:  normal
portSpeed: N2Gbps

Interrupts:        0          Link_failure: 48         Frjt:         0
Unknown:           0          Loss_of_sync: 55         Fbsy:         0
Lli:               317        Loss_of_sig:  50
Proc_rqrd:         0          Protocol_err: 0
Timed_out:         0          Invalid_word: 0
Rx_flushed:        0          Invalid_crc:  0
Tx_unavail:        0          Delim_err:    0
Free_buffer:       0          Address_err:  0
Overrun:           0          Lr_in:        50
Suspended:         0          Lr_out:       48
Parity_err:        0          Ols_in:       48
2_parity_err:      0          Ols_out:      50
CMI_bus_err:       0

Back to the main page