Skip to main content

SAS Disk - SCSI Command Timer in Linux

When read or write SCSI command isn't able to complete, Linux kernel reports this type of messages.

sd 11:0:5:0: attempting task abort!scmd(0x00000000ec158cca), outstanding for 30206 ms & timeout 30000 ms
sd 11:0:5:0: [sdp] tag#1015 CDB: Write(16) 8a 00 00 00 00 00 04 e3 47 b1 00 00 00 25 00 00
scsi target11:0:5: handle(0x000c), sas_address(0x5000cca03b49baf5), phy(4)
scsi target11:0:5: enclosure logical id(0x500062b202ad92c0), slot(7)
scsi target11:0:5: enclosure level(0x0000), connector name(     )
sd 11:0:5:0: task abort: SUCCESS scmd(0x00000000ec158cca)
sd 11:0:5:0: Power-on or device reset occurred
sd 11:0:5:0: device_block, handle(0x000c)
sd 11:0:5:0: device_unblock and setting to running, handle(0x000c)

Recurring issues of that type usually indicate hardware problem with the SAS drive.

SCSI write command wasn't able to complete for over 30 seconds (30206 ms). SCSI command timer expired, and that triggers SCSI layer driver's error handler. Sequence of events is the following:

  1. Abort the command
  2. Reset the device
  3. Reset the bus
  4. Reset the host

If all of these operations fail, the device will be set to the offline state. In the example above only first two steps are performed.

To check /dev/sdm device state look at the content of /sys/block/sdm/device/state file.

Sample udev rule to increase SCSI command timer to 60 seconds. Block device in the example below is identified based on device vendor and model.

ACTION=="add", SUBSYSTEMS=="block" , ATTRS{vendor}=="HGST", ATTRS{model}=="H7240AS60SUN4.0T", RUN+="/bin/sh -c 'echo 60 > /sys/class/block/%k/device/timeout'"

To explore other device attributes, use udevadm utility. Adjust block device name.

udevadm info --attribute-walk --name /dev/sdm

udevadm-info.txt