1:0:0:1 up - - active_drive
1:0:1:1 up - - -
1:0:2:1 up - - active_drive
1:0:3:1 up - - -
sg=/dev/sg2 st=/dev/st1 wwnn=50014382c6c2f007 type=tape
0:0:1:0 up - - wwpn=50014382c6c2f008
0:0:2:0 up open - wwpn=50014382c6c2f009
1:0:1:0 up - - wwpn=50014382c6c2f008
1:0:3:0 up - - wwpn=50014382c6c2f009
In this example, the tape drive at the top of the list can be accessed via either /dev/sg0 or /dev/st0. The
other tape drive is available via either /dev/sg2 or /dev/st1. An application has a device file open to the
drive at the bottom of the list; and the most recent command was sent to the drive via the path 0:0:2:0.
The library is accessed via
/dev/sg1
. The path most recently used to access the library was
0:0:0:1
.
At some time in the past an administrator specified path 0:0:0:1 to be the “preferred” path to the library.
There are four paths to each drive. Since both drives are connected to the library there appear to be eight
paths available to the library. The drive at
/dev/st0
is the “active_drive,” which means that the driver will
use that drive to access the library. The active drive can be inferred by looking at the path numbers. The
last digit (e.g. the 1 in 0:0:0:1) is the lun number of the device accessed by that path. A drive has a LUN
of 0. A library has a LUN of 1. The port names are not reported by the library because the library uses
ports on the drives so the port names are not available in the report.
All of the paths show their status as being “up”. This means that the driver believes that all of those paths
are currently available for use. The state of “down” is temporary. It is only visible while the path is being
destroyed. Once the path becomes completely unusable, the driver removes it from the list. Any path that
remains in a “down” state for more than a second should be disconnected and reconnected to reestablish
a reliable connection. The path cannot be disconnected via the Linux operating system; disconnect the
path by physically disconnecting the FC cable, disabling the port in the FC switch, or power cycling the
drive.
Setting the preferred path
Normally the driver attempts to use the path with the fewest number of open tape drive device files. You
can override the path by selecting a "preferred" path. The preferred path is the path that the driver will
attempt to use at the next
open()
of the device file.
The path will not switch to the preferred path if there is any other thread holding the
/dev
file open. If
multiple threads have the
/dev
file open, the driver will not interfere with the path selection that has been
made by another thread.
The path will not change to the preferred path if it is indicating a library control path using a passive drive.
In this case, the driver will select a control path hosted by an active drive instead.
You can configure the preferred path by writing to a
/sys
file. For example, to configure a preferred path
on /dev/sg5:
echo prefer=8:0:1:0 > /sys/class/pfo/pfo5/ctrl
You can disable the configuration of a preferred path by creating an empty prefer entry in the
crtl
file.
For example:
echo prefer > /sys/class/pfo/pfo5/ctrl
Rebalancing the paths
The rebalance command does a one-time path balancing process, dividing the drives evenly among all
HBA paths. This is especially useful when a path returns to service while using the Less Balancing
algorithm. This command is likely to cause library path failure events.
56
Setting the preferred path