Checking the disk for errors and bad sectors

This script helps to notify me by e-mail about the condition of the disk. Remember to indicate the disk accordingly – in this case it is “/dev/sda” and change the e-mail address from “” to your own. Save the script in “/root/“:

You can also download it from

Remember to grant permission to perform it:

On my server I added it once a month so that it would be performed periodically in the crontab:

You should receive an email similar to the one below:

Good luck and I wish you no errors!