Installation guide
Removing a Path to a Storage Device
127
Another variation of this operation is echo 1 > /sys/class/scsi_device/h:c:t:l/
device/delete, where h is the HBA number, c is the channel on the HBA, t is the SCSI target
ID, and l is the LUN.
Note
The older form of these commands, echo "scsi remove-single-device 0 0 0 0"
> /proc/scsi/scsi, is deprecated.
You can determine the device-name, HBA number, HBA channel, SCSI target ID and LUN for a
device from various commands, such as lsscsi, scsi_id, multipath -l, and ls -l /dev/
disk/by-*.
After performing Procedure 21.1, “Ensuring a Clean Device Removal”, a device can be physically
removed safely from a running system. It is not necessary to stop I/O to other devices while doing so.
Other procedures, such as the physical removal of the device, followed by a rescan of the SCSI bus
(as described in Section 21.9, “Scanning Storage Interconnects”) to cause the operating system state
to be updated to reflect the change, are not recommended. This will cause delays due to I/O timeouts,
and devices may be removed unexpectedly. If it is necessary to perform a rescan of an interconnect, it
must be done while I/O is paused, as described in Section 21.9, “Scanning Storage Interconnects”.
21.5. Removing a Path to a Storage Device
If you are removing a path to a device that uses multipathing (without affecting other paths to the
device), then the general procedure is as follows:
Procedure 21.2. Removing a Path to a Storage Device
1. Remove any reference to the device's path-based name, like /dev/sd or /dev/disk/by-path
or the major:minor number, in applications, scripts, or utilities on the system. This is important
in ensuring that different devices added in the future will not be mistaken for the current device.
2. Take the path offline using echo offline > /sys/block/sda/device/state.
This will cause any subsequent I/O sent to the device on this path to be failed immediately.
Device-mapper-multipath will continue to use the remaining paths to the device.
3. Remove the path from the SCSI subsystem. To do so, use the command echo 1 > /sys/
block/device-name/device/delete where device-name may be sde, for example (as
described in Procedure 21.1, “Ensuring a Clean Device Removal”).
After performing Procedure 21.2, “Removing a Path to a Storage Device”, the path can be safely
removed from the running system. It is not necessary to stop I/O while this is done, as device-
mapper-multipath will re-route I/O to remaining paths according to the configured path grouping and
failover policies.
Other procedures, such as the physical removal of the cable, followed by a rescan of the SCSI bus
to cause the operating system state to be updated to reflect the change, are not recommended. This
will cause delays due to I/O timeouts, and devices may be removed unexpectedly. If it is necessary to
perform a rescan of an interconnect, it must be done while I/O is paused, as described in Section 21.9,
“Scanning Storage Interconnects”.