Setting persistent SCSI timeout

https://access.redhat.com/solutions/2470541

Setting persistent SCSI timeout Solution Verified - Updated August 2 2024 at 5:09 AM - English 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.rules containing the following rules will set the timeout permanently:

Raw 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:

Raw ACTION==”add|change”, SUBSYSTEMS==”scsi”, ATTRS{type}==”0|7|14”, ATTR{device/timeout}=”60” RHEL6 would support the same configuration as RHEL5, using the SYSFS keyword in the udev rule. RHEL7,8 & 9 requires the ATTR keyword 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, udev needs to be informed about changed rules:

Raw

udevadm control –reload

With the new rules activated, udev needs to re-enumerate the device

Raw

udevadm [–debug] test /block/

or

Raw

udevadm trigger /dev/

cat /sys/block/sd*/device/timeout will also show the configured values:

Raw 60 Product(s) Red Hat Enterprise LinuxComponent udevCategory Customise or extendTags fibre_channel rhel rhel_6 rhel_7 scsi udev 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.

Was this helpful?

People who viewed this solution also viewed I cannot set a persistent SCSI timeout value on a VMware guest. Solution - 14 Jun 2024 What is scsi timeout value and how to set it? Solution - 6 Aug 2024 SCSI timeouts and RO Filesystem Solution - 6 Aug 2024 Get notified when this content is updated Comments Newbie Add your comment: Add comment Send notifications to content followers Submit Newbie 12 points May 9, 2017 10:39 PM Yann says: Hi,

From a Red Hat 7.3, I have to change the value /sys\(DEVPATH/device/timeout instead of /sys\)DEVPATH/timeout

Indeed, here is an extract of the output of udevadm test /block/sdd :

DEVLINKS=/dev/disk/by-path/pci-0000:03:00.0-scsi-0:0:11:0 DEVNAME=/dev/sdd DEVPATH=/devices/pci0000:00/0000:00:15.0/0000:03:00.0/host2/target2:0:11/2:0:11:0/block/sdd DEVTYPE=disk ID_BUS=scsi and :

[root@xxxxx rules.d]# DEVPATH=”/devices/pci0000:00/0000:00:15.0/0000:03:00.0/host2/target2:0:11/2:0:11:0/block/sdd” [root@xxxxx rules.d]# ls /sys$DEVPATH/ alignment_offset bdi dev discard_alignment events_async ext_range inflight queue removable size stat trace badblocks capability device events events_poll_msecs holders power range ro slaves subsystem uevent There is no timeout value. The timeout value seems to be located here :

[root@xxxxx rules.d]# ls /sys$DEVPATH/device/t* /sys/devices/pci0000:00/0000:00:15.0/0000:03:00.0/host2/target2:0:11/2:0:11:0/block/sdd/device/timeout /sys/devices/pci0000:00/0000:00:15.0/0000:03:00.0/host2/target2:0:11/2:0:11:0/block/sdd/device/type Tests made on a VM hosted on VMware.

Updated: