guy labs guy labs

Monitor S.M.A.R.T. with smartmontools in Ubuntu 13.04

    Today we want to install and configure smartmontools to monitor the S.M.A.R.T. attributes. Additionally we want to be notified by email if a warning or an error occurred. Install and check hard drives Ok let's start by installing smartmontools with the following command: After that we want to check the hard drives with the following command: Replace the /dev/sda with the hard drive you want to check. If smartctl doesn't succeed you need to add the type of the hard drive interface to the command. To do this add the -d {TYPE} argument to the previous command and subsitute the {TYPE} with ata, scsi or sat (for sata). This command outputs some information about your hard drive. Next we want to enable additional features by executing the following command: This enables the S.M.A.R.T. support (-s on), the offline data collection (-o on) and the autosave of device vendor-specific attributes (-S on). You will find more information about the arguments in the man pages of smartctl. After that we can check the overall health of the hard drive by executing the following command: If the test result isn't PASSED you should backup your data now and exchange the hard drive. We also want to check if your hard drive supports the self checks. To do this execute the following command: Now check the ouput where it says "Offline data collection capabilities" and one of the values should be "Self-test supported". Then your hard drive supports the self tests. What you also see in the output is how long the short...