To enable SMART on a drive:
for sd in /dev/sd[a-f]; do echo $sd; smartctl --smart=on --offlineauto=on --saveauto=on $sd; done
For drives in USB enclosures, add the -d sat switch:
for sd in /dev/sd[a-z]; do echo $sd; smartctl --smart=on --offlineauto=on --saveauto=on -d sat $sd; done
for sd in /dev/sd[a-z]; do smartctl -A /dev/sdb | head -7| tail -1; smartctl -A /dev/sdb | grep Error_Rate | grep -v Multi
for sd in /dev/sd[a-e]; do echo $sd; smartctl -a $sd | grep Model ; smartctl -A $sd | head -7| tail -1; smartctl -A $sd | grep Error_Rate | grep -v Multi; done
To get error status for all drives:
for sd in /dev/sd[a-z]; do echo "Device Name: $sd"; smartctl -a $sd | grep Model; smartctl -A $sd | head -7| tail -1; smartctl -A $sd | grep Error_Rate | grep -v Multi | grep -v G-Sense; smartctl -A $sd | grep Sector; echo ; done
To start short test on al drives:
for sd in /dev/sd[a-k]; do smartctl -t short $sd; done
execute as a script with watch:
watch -c -n 1 -d --exec test-status.sh
watch -c -n 1 -d --exec smart-test-status-all.sh
test-status.sh:
smartctl -c /dev/sde | grep status; smartctl -c /dev/sde | grep remaining
smart-test-status-all.sh:
for sd in /dev/sd[a-k]; do smartctl -c $sd | grep status; smartctl -c $sd | grep remaining; done
for sd in /dev/sd[a-z]; do echo $sd; smartctl -c $sd | grep Self-test | grep -v supported; smartctl -c $sd | grep remaining; done