Skip to content

Instantly share code, notes, and snippets.

@tairov
Created September 30, 2014 13:19
Show Gist options
  • Save tairov/7cb0324867ac0e53951e to your computer and use it in GitHub Desktop.
Save tairov/7cb0324867ac0e53951e to your computer and use it in GitHub Desktop.
smartcheck.sh
#!/bin/bash
for DISK in $(ls /dev/sd?);
do echo $DISK;
smartctl -a $DISK| grep -i "Failing now\|Device Model\|Short offline\|Extended Offline\|Reallocated_Sector_Ct\|Offline_Uncorrectable\|Raw_Read_Error_Rate\|Serial Number\|Power_On_Hours\|End-to-End_Error\|Self-test routine in progress...\|remaining";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment