Konubinix' opinionated web of thoughts

Detect Hard Drive Failure in Linux Using S.M.A.R.T.

Fleeting

Detect Hard Drive Failure in Linux using S.M.A.R.T. - Informatica Pressapochista

start by taking a look at smartctl.

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

ask to the device to report its S.M.A.R.T. health status using H option.

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

S.M.A.R.T. status is based on information that it has gathered from online and offline tests, which were used to determine/update its SMART vendor-specific attribute values

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

using c option, that it is intended to print the disk’s capabilities and the estimated time to perform short and long disk self-tests (we will see in the next). #smartctl -c /dev/sda

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

possibile to run two types of self-tests, short and long. These can be run with the the following commands. smartctl -t short /dev/sda smartctl -t long /dev/sda

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

the end we can get the result with the a option.

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

Some disk support automatic off-line testing, enabled by the following command. smartctl -o on /dev/<device

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

This command enable an automatically off-line test every few hours

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

he Offline-test do not corrupt data on the disk and do not interfere with the normal functioning of the disk, so you can enable this kind of test on a running system

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

control and fine-tune the behavior of smartd using the configuration file /etc/smartd.conf

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/

Consider the regular replacement of 3 year old disks.

https://www.informaticapressapochista.com/linux/detect-hard-drive-failure-in-linux-using-s-m-a-r-t/