Skip to content

Instantly share code, notes, and snippets.

@bitfolk
Created November 8, 2013 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bitfolk/7374253 to your computer and use it in GitHub Desktop.
Save bitfolk/7374253 to your computer and use it in GitHub Desktop.
Use something like this on boot to check that all your SCSI devices either support Error Recovery Control at 7 seconds, or else have a large enough SCSI layer timeout to prevent them being kicked from a RAID array on bad sector reads.
#!/bin/sh
for disk in `find /sys/block -maxdepth 1 -name 'sd*' | xargs -n 1 basename`
do
smartctl -q errorsonly -l scterc,70,70 /dev/${disk}
if test $? -eq 4
then
echo "/dev/${disk} doesn't support scterc, setting timeout to 180s /o\\"
echo 180 > /sys/block/${disk}/device/timeout
else
echo "/dev/${disk} supports scterc \\o/"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment