Self Monitoring And Reporting Technology (SMART) is a useful tool to monitor the physical health of your hard disks.
By using the programs and daemons offered by the smartmontools package together with a special Service Management Facility manifest, you can manage SMART as a service on your machines.
In Solaris, SMART monitoring works on SCSI, SATA and SAS disks. It does not work on IDE drives or on any device that uses the
First, enable the Spec Files Extra repository:
Then install the smartmontools package
Now you have three main components at your disposal:
smartctl command allows you to query the disk status and run short and long tests. You can read the
man page for this command for detailed information as to its use. For example, you can query the status of an example disk like so:
Note: for many controllers, you might need to specify the device type. The most common types are
"scsi", "sat" and
"sat,12". Use this form of the command:
Now, once you have determined the right device type, you can edit the
/etc/smartd.conf file by removing the
DEVICESCAN line and adding the disk raw device followed by the
-d option and device type. A typical line might look like this:
At this point, you might also want to specify automated scheduled disk testing. The /etc/smartd.conf file is full of examples you can adjust to suit your needs.
After you have edited and saved the file, run:
This will parse the config file and check that the disks can be accessed. If successful, it will add the device to the list of monitored disks.
This blog has an XML manifest file and the necessary instructions for its installation. Be careful it is outdated. You need to edit the xml script to the location of the installed location of the init smartd script.
Here is a corrected XML file:
Make sure to configure the smartd.conf from the instructions above and run the pfexec smartd -q onecheck command.
Briefly, copy the file into
/var/smf/manifest/site/smartd.xml, change its owner to
root:sys and import the manifest by running this command:
Check that the service exists and enable it:
The service should now be running.
Congratulations! You have an extra safety feature to ensure your data is safe, by hopefully detecting failing drives before they die completely.