===== FC adapter list WWN ===== # lspci -nn | grep -i hba 07:00.0 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02) 07:00.1 Fibre Channel [0c04]: QLogic Corp. ISP2532-based 8Gb Fibre Channel to PCI Express HBA [1077:2532] (rev 02) # cat /sys/class/fc_host/host*/port_name # yum install sysfsutils To check the available HBA ports : # systool -c fc_host Class = "fc_host" Class Device = "host2" Device = "host2" Class Device = "host3" Device = "host3" To find the WWNs for the HBA ports : # systool -c fc_host -v | grep port_name port_name = "0x500143802426baf4" port_name = "0x500143802426baf6" To check the state of the HBA ports (online/offline) : # systool -c fc_host -v | grep port_state port_state = "Online" port_state = "Online" ===== SAS adapter list WWN, address ===== # cat /sys/class/sas_device/end_device*/sas_address # cat /sys/class/sas_phy/phy-*/sas_address | sort -u ^long option format^short option format^description^ | --brief | -b | reduces single line output to tuple plus primary device name. With --pdt option inserts the PDT (device type) in hex between tuple and primary device name. | | --classic | -c | generate output similar to 'cat /proc/scsi/scsi' | | --controllers | -C | lists NVMe controllers and SCSI hosts. This is a synonym for --hosts | | --device | -d | show device node's major and minor numbers | | --generic | -g | show scsi generic device node name | | --help | -h | print usage message then exit | | --hosts | -H | rather than list SCSI devices (logical units), list SCSI hosts instead | | --kname | -k | show kernel name (as found in sysfs) instead of device node name (as found in the /dev directory) | | --list | -L | show = pairs, one per line, indented by two or more spaces | | --long | -l | show = pairs, several to a line. can be used multiple times for more output and different format. | | --long-unit | -U | show the un-truncated logical unit name. This may cause the "single device per line" form of output to exceed 80 columns with UUID and EUI-128 logical unit names | | --lunhex | -x | show the LUN part of the tuple as hex following T10 (SAM-5) conventions. | | --no-nvme | -N | don't list NVMe devices (or controllers if --hosts is given) | | --pdt | -D | displays Peripheral Device Type (PDT) is hexadecimal, prefixed by "0x" | | --protection | -p | show protection information (T10-DIF). | | --protmode | -P | show negotiated protection information mode | | --scsi_id | -i | show udev derived information in /dev/disk/by-id/ directory | | --size | -s | show disk size in human readable form. | | --sysfsroot=PATH | -y PATH | Uses PATH as sysfs mount point (default sysfs mount point is '/sys') | | --sz-lbs | -S | show disk size as number of logical blocks; when given twice adds a comma followed the logical block size in bytes (typically either 512 or 4096) | | --transport | -t | show transport information. If '--hosts' not given then this will be for targets. If '--hosts' is given then this will be for initiators (i.e. hosts). More information shown when used with '--list'. | | --unit | -u | show the LU name in the place of the manufacturer, model and revision. Needs lk >= 3.15 | | --verbose | -v | increase verbosity of output. May be used multiple times to further increase verbosity. | | --version | -V | print out the version and the date of last code change then exits | | --wwn | -w | show the WWN for disks in the place of the manufacturer, model and revision | # lsscsi -Ht [0] ahci sata: [1] ahci sata: [2] ahci sata: [3] mpt3sas sas:0x500605b006d3b510 [4] ahci sata: [5] ahci sata: [6] ahci sata: [N:0] /dev/nvme0 pcie 0x1b4b:0x1093 # lsscsi -t --list [3:0:2:0] [3:0:2:0] disk fc:0x21000004cf97e385,0x0b10a3 /dev/sde transport=fc node_name=0x20000004cf97e385 port_name=0x21000004cf97e385 port_id=0x0b10a3 port_state=Online roles=FCP Target scsi_target_id=2 supported_classes=Class 3 dev_loss_tmo=35 When the '--hosts' option is used with '--transport' then transport information for the initiator (port) is output: # lsscsi --hosts --transport 3 [3] qla2xxx fc:0x50060b00741cc28e,0x0b1900 This shows for host 3 the driver is called qla2xxx, the transport is FC, the initiator's port name is in NAA-5 format with the final (hex) number being the initiator's port identifier. Adding '--list' will again add "name=value" pairs: # lsscsi -H -t --list 3 [3] qla2xxx fc:0x50060b00741cc28e,0x0b1900 transport=fc node_name=0x50060b00741cc28f port_name=0x50060b00741cc28e port_id=0x0b1900 port_type=NPort (fabric via point-to-point) speed=2 Gbit supported_classes=Class 3 tgtid_bind_type=wwpn (World Wide Port Name)