Tests –
To run a short test :
sudo smartctl --test=short /dev/sda
The goal of the short test is the rapid identification of a defective hard drive. Therefore, the maximum run time for the short test is 2 min. To run a long test:
sudo smartctl --test=long /dev/sda
Long tests also identify defects but here, there is no time restriction. The test is more thorough. To check the results of the test:
sudo smartctl -l selftest /dev/sda
Python | Monitor hard-disk health using smartmontools
Smartmontools, an acronym for ‘S.M.A.R.T monitoring’ tools is a package that is used to control and monitor computer storage systems using S.M.A.R.T. (Self-Monitoring, Analysis and Reporting Technology) system built into most modern (P)ATA, Serial ATA, SCSI/SAS devices. It contains 2 utility programs: smartctl and smartd. These utilities give warnings or alerts of disk degradation and failure. smartmontools can be used in any Unix/Linux-based operating system. It allows us to run various tests to check the health of the HDD or SSD in your system.