What is an rport and how do I gather more information about it?
Environment
- Red Hat Enterprise Linux (RHEL) 7
- Red Hat Enterprise Linux (RHEL) 6
- Red Hat Enterprise Linux (RHEL) 5
Issue
- What is an rport and how do I gather more information about it?
Resolution
- "rport" is the short form for remote port. On your host the remote port(s) would ideally be the ports that the fiber connection is connected to on the other end. For example, if a system is connected to a storage array with two controllers (i.e., nothing but the ports), then the remote port information and state can be checked. There are a few ways for checking this:
1. The information related to rhost ports is at the location:
/sys/class/fc_remote_ports/rport-*
where information like the node_name, port_name, port_status, scsi_target_id, etc. can be checked with the cat command. For example, the following command will check the state of the port and if it is online or not:
$ cat /sys/class/fc_remote_ports/rport-1:0-0/port_state
which will show "Online", if the port is online and working normally. A simple grep command can be used to see all port states at once:
$ grep -Hv "zz" /sys/class/fc_remote_ports/rport*/port_state
2. Another very good utility is the systool command from the sysfsutils package (see: man systool). With this command the information from the remote ports can be gathered in one pass by running the command with following options:
$ systool -c fc_remote_ports -v
where -c indicates class, and -v is for verbose.
- Not all "rports" are storage ports. Examine the "roles" parameter under rport to determine if the remote port is a storage target.
$ grep -Hv "zz" /sys/class/fc_remote_ports/rport-*/roles
/sys/class/fc_remote_ports/rport-6:0-0/roles:FCP Target << storage target
/sys/class/fc_remote_ports/rport-6:0-3/roles:FCP Target << storage target
/sys/class/fc_remote_ports/rport-6:0-4/roles:FCP Initiator << HBA
/sys/class/fc_remote_ports/rport-8:0-8/roles:Fabric Port << fabric port
/sys/class/fc_remote_ports/rport-8:0-9/roles:Directory Server << fabric directory server
Remote ports associated with storage ports with also have a positive (not -1) value assigned to its scsi_target_id value.
$ grep -Hv "zz" /sys/class/fc_remote_ports/rport-*/scsi_target_id
/sys/class/fc_remote_ports/rport-6:0-0/scsi_target_id:0
/sys/class/fc_remote_ports/rport-6:0-3/scsi_target_id:1
/sys/class/fc_remote_ports/rport-6:0-4/scsi_target_id:-1
/sys/class/fc_remote_ports/rport-8:0-8/scsi_target_id:-1
/sys/class/fc_remote_ports/rport-8:0-9/scsi_target_id:-1
Diagnostic Steps
See "How do I find the FC ID (WWN) of a scsi device/LUN on Red Hat Enterprise Linux?" for additional information on gathering and following device -> hba -> san -> port -> lun via information available within sysfs.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.