dmesg | egrep "exception Emask|failed command|Unrecovered read error|I/O error"
参考
http://kledgeb.blogspot.jp/2013/07/ubuntu-6-hdd.html
cat /etc/cron.daily/chkdmesg.sh #!/bin/bash cd `/usr/bin/dirname $0` dmesg | egrep "exception Emask|failed command|Unrecovered read error|I/O error" || exit 0 dmesg -T | mail -s '[Home Server Disk Error]' example@example.com