this is obsolete doc -- see http://doc.nethence.com/ instead

Monitoring disk health 

(draft) 

 

On NetBSD 

cd ~/
mkdir -p bin/
cd bin/
wget http://pbraun.nethence.com/scripts/sysutils/smart.ksh
chmod +x smart.ksh
crontab -e
0       *       *       *       *       /root/bin/smart.ksh

 

On any other systems 

Make sure smartmontools and e2fsprogs are installed. 

smartctl -a /dev/sda
badlocks -sv /dev/sda

 

smartctl -t short /dev/rwd4d
smartctl -l selftest /dev/rwd4d

 

Recovering bad sectors 

Low format the HDD with vendor provided format tool, and see if some bad sectors have been recovered, 

badblocks -wsv /dev/sda

Ref. https://wiki.archlinux.org/index.php/Badblocks 

 

References 

http://superuser.com/questions/171195/how-to-check-the-health-of-a-hard-drive 

http://serverfault.com/questions/419007/understanding-smartctl-a-output 

http://serverfault.com/questions/313649/how-to-interpret-this-smartctl-smartmon-data 

http://ubuntuforums.org/showthread.php?t=920041 

http://serverfault.com/questions/313649/how-to-interpret-this-smartctl-smartmon-data 

https://www.thomas-krenn.com/en/wiki/SMART_tests_with_smartctl