Smartctl is a command-line utility or a tool in UNIX. It performs tasks such as printing the SMART self-test and error logs, enabling and disabling SMART automatic testing, initiating device self-tests, & report conditions that may indicate impending failure.

It is a free software package that can monitor S.M.A.R.T. attributes and runs on several platforms; I will cover the installation and show how to configure it on Linux.

What is smartctl Utility?

The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology. In many cases, these utilities will provide advanced warning of disk degradation and failure. This tool performs SMART tasks such as printing the SMART self-test and error logs, enabling and disabling SMART automatic testing and initiating device self-tests.

 

Steps to install Smartcl in CentOS:

1. Log in to your server via SSH as a root user.

2. Use the yum command to install Smartctl.

#yum install smartmontools

3. As installation completes, start the service of Smartctl.

#service smartd start 
# chkconfig smartd on

4. To enable Smart Capability for the disk run below command.

#smartctl -s on /dev/sdb

5. To disable Smart Capability for the disk run below command.

#smartctl -s off /dev/sdb

6. To display details Smart info for the disk run below command.

#smartctl -a /dev/sdb // For IDE drive
#smartctl -a -d ata /dev/sdb // For SATA drive


The SMART test helps us detect any potential hardware problems and can analyze a faulty drive or perform an ATA/SCSI test based on our HDD type. That's all!!

Was this answer helpful? 3 Users Found This Useful (3 Votes)