#!/bin/sh # test-smart-long-test-slowdown.sh {/dev/device} # Tests slowdown of caused by running S.M.A.R.T. Long Self Test. # (c) 2015 Stanislav Brabec, SUSE Linux # License: Public Domain if test -z "$1" ; then echo "Usage: $0 {/dev/device}" exit 1 fi echo "Please stop any disc activity to get reasonable results." echo -n "Then press Return." read echo "Aborting possibly running tests..." smartctl -X "$1" >/dev/null sleep 3 echo "Testing 1G read of idle disk..." echo 3 >/proc/sys/vm/drop_caches dd if="$1" of=/dev/null bs=100M count=10 echo "Initiating long test..." smartctl -t long "$1" >/dev/null sleep 10 echo "Testing 1G read of disk running surface scan..." echo 3 >/proc/sys/vm/drop_caches dd if="$1" of=/dev/null bs=100M count=10 echo "Aborting running long test..." smartctl -X "$1" >/dev/null echo "You can see smart logs by running of \"smartctl -l selftest $1\"."