Overview

Storage addition is a routine job for system administrators. There are various methods  to identify the WWN number and number of HBA card in Linux OS. Let’s go through those different methods for same.

 Detailed Step

Below is the output were we can see server having 2 HBA Card Connected and WWN number highlighted.

Method :1

Sysfsutils – Install sysfsutils

#yum install sysfsutils

[root@axelq7 ~]# systool -c fc_transport -v

Class = “fc_transport”

 

  Class Device = “target1:0:0”

  Class Device path = “/sys/class/fc_transport/target1:0:0”

    node_name           = “0x50060e8006fe9333”

    port_id             = “0x64b6c0”

    port_name           = “0x50060e8006fe9333”

 

    Device = “target1:0:0”

    Device path = “/sys/devices/pci0000:00/0000:00:01.0/0000:14:00.0/host1/target1:0:0”

      detach_state        = “0”

 

  Class Device = “target4:0:0”

  Class Device path = “/sys/class/fc_transport/target4:0:0”

    node_name           = “0x50060e8006fe9323”

    port_id             = “0x64b6c0”

    port_name           = “0x50060e8006fe9323”

 

    Device = “target4:0:0”

    Device path = “/sys/devices/pci0000:00/0000:00:06.0/0000:10:00.0/0000:11:02.0/0000:13:00.0/host4/target4:0:0”

      detach_state        = “0”

 

Method :2

On Redhat 4 and below , view the /proc/scsi/<adapter-type>/n file that contains the HBA WWN information.

Adapter-type can be either qlaxxxx for QLogic adapters (or) lpfc for Emulex adapters.

Please substitute n with either 0, 1, 2.. n

The example belows shows the WWN number of the qlogic 2300 adapter on RedHat 3

 

$ cat /etc/redhat-release

Enterprise Linux Enterprise Linux AS release 3 (Update 9)

 

$ cat /proc/scsi/qla2600/1

QLogic PCI to Fibre Channel Host Adapter for QLA2460:

        Firmware version:  4.00.23, Driver version 7.07.05

Entry address = f888d060

Request Queue = 0x37280000, Response Queue = 0x37270000

<truncated long output>A

Method :3

 RHEL5:

 # ls -1c /sys/class/fc_transport/target*/*_name  2> /dev/null | xargs -I {} grep -H -v “ZzZz” {} | sort

 # ls -1c /sys/class/fc_transport/target*/port_id 2> /dev/null | xargs -I {} grep -H -v “ZzZz” {} | sort

 RHEL6,7:

    # ls -1c /sys/bus/scsi/devices/target*/fc_transport/target*/*_name  2> /dev/null | xargs -I {} grep -H -v “ZzZz” {} | sort

    # ls -1c /sys/bus/scsi/devices/target*/fc_transport/target*/port_id 2> /dev/null | xargs -I {} grep -H -v “ZzZz” {} | sort

Method :4

  • Alternatively the device WWID can be found via the sg_inq -p 0x83 /dev/sdNcommand:

Method :5

  • Or using the scsi_id -g -u -s /block/sdNcommand:

RHEL5:

    # scsi_id -g -u -s /block/sdm    360014380125989a100004000013a0000

RHEL6:

# scsi_id –replace-whitespace –whitelisted –device /dev/sdm    360014380125989a100004000013a0000

RHEL7:

On RHEL 7, the scsi_id command does not exist. A partial replacement is lsscsi –scsi_id, but that will only work for disk devices.

  # lsscsi –scsi_id -g [4:0:0:0]    disk    HP       LOGICAL VOLUME   5.70  /dev/sda   3600508b1001c072a93d8825b16500fea  /dev/sg1  Ø  Using udevadm info –name, Ø  # udevadm info –name sdN   

Conclusion

Thus, we learnt different ways to identify the WWN and HBA details. These information can be supplied as pre-requisites for Storage team to present the storage LUNS before adding the same on OS.

Leave a Comment