Linux: display World Wide Port Names (WWPNs)

To display World Wide Port Names (WWPNs) and other information about Fibre Channel (FC) adapters on a Linux system, you can use various commands depending on the tools available on your system. Here are a few common methods:

  1. Using lsscsi and sg_map commands:This method requires the lsscsi and sg_map utilities, which are commonly available on many Linux distributions.sudo lsscsi -g This command lists SCSI devices, including Fibre Channel adapters. Note down the device corresponding to your Fibre Channel adapter.Then, use sg_map to map SCSI generic (sg) device names to WWPNs:sudo sg_map -i This command will show the mapping of SCSI generic devices to WWPNs and other information.
  2. Using systool:On systems with sysfs support, you can use the systool command to display information about Fibre Channel adapters:sudo systool -c fc_host -v This command lists information about Fibre Channel host adapters, including WWPNs and other details.
  3. Using fcinfo (For systems with Emulex HBAs):If you’re using Emulex HBAs, you can use the fcinfo command:sudo fcinfo <adapter_name> Replace <adapter_name> with the name of your Fibre Channel adapter (e.g., lpfc0). This command will display detailed information about the adapter, including WWPNs.
  4. Using scli (For systems with QLogic HBAs):If you’re using QLogic HBAs, you can use the scli command:sudo scli -p <port_number> -g Replace <port_number> with the port number of your Fibre Channel adapter (e.g., 0). This command will display detailed information about the HBA, including WWPNs.

Choose the method that best fits your system configuration and the tools available. These commands should provide you with the necessary information about WWPNs and other details of your Fibre Channel adapters on Linux.

Leave a comment