On Windows I open CMD and type chkdsk /r
Then restart
For linux:
To check logs and health
sudo smartctl -a /dev/sda
To do a short scan:
sudo smartctl -t short /dev/sda
To view the results:
sudo smartctl -l selftest /dev/sda
I got something like this on one of my hard drives:
I did not try this but seemed like a nice temporary fix for a failing drive:
sudo badblocks -s -v /dev/sda > /scan_result/badsectors.txt This scan can take a long time Then when done use the file to exclude the bad blocks:
sudo fsck -l /scan_result/badsectors.txt /dev/sda
References:
https://forums.linuxmint.com/viewtopic.php?t=220217
https://www.fosslinux.com/1297/check-hard-disk-for-bad-sectors-and-errors-by-command-line-in-ubuntu-and-linux-mint.htm