Setting persistent SCSI timeout
Environment
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Issue
- What is the preferred way to permanently tune the default timeout
/sys/block/device-name/device/timeout? - The RHEL 5 manual describes the way to set SCSI disk timeouts in a persistent way.
- How to configure the timeout in RHEL6,7,8 & 9?
Resolution
-
A file
/etc/udev/rules.d/99-udev.rulescontaining the following rules will set the timeout permanently:ACTION=="add|change", SUBSYSTEM=="scsi" , ATTR{type}=="0|7|14", \ RUN+="/bin/sh -c 'echo 60 > /sys$$DEVPATH/timeout'"Another rule without invoking a sub-shell would also work:
ACTION=="add|change", SUBSYSTEMS=="scsi", ATTRS{type}=="0|7|14", ATTR{device/timeout}="60" -
RHEL6 would support the same configuration as RHEL5, using the
SYSFSkeyword in the udev rule. RHEL7,8 & 9 requires theATTRkeyword which is also supported by RHEL6. The rules mentioned in this solution will work on RHEL6,7,8 & 9.
Diagnostic Steps
-
After adding or changing the rules,
udevneeds to be informed about changed rules:# udevadm control --reload -
With the new rules activated,
udevneeds to re-enumerate the device# udevadm [--debug] test /block/<device>or
# udevadm trigger /dev/<device> -
cat /sys/block/sd*/device/timeoutwill also show the configured values:60
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.
Comments