smartctl command examples
smartctl – Control and Monitor Utility for SMART Disks
#smartctl -a /dev/hda
Print a large amount of SMART information for drive /dev/hda which is typically an ATA (IDE) or SATA disk in Linux.
#smartctl -a /dev/sdb
Print a large amount of SMART information for drive /dev/sdb . This may be a SCSI disk or an ATA (SATA) disk.
#smartctl -s off /dev/hdd
Disable SMART monitoring and data log collection on drive /dev/hdd .
#smartctl --smart=on --offlineauto=on --saveauto=on /dev/hda
Enable SMART on drive /dev/hda, enable automatic offline testing every four hours, and enable autosaving of SMART Attributes. This is a good start-up line for your system´s init files. You can issue this command on a running system.
#smartctl -t long /dev/hdc
Begin an extended self-test of drive /dev/hdc. You can issue this command on a running system. The results can be seen in the self-test log visible with the ´-l selftest´ option after it has completed.
#smartctl -s on -t offline /dev/hda
Enable SMART on the disk, and begin an immediate offline test of drive /dev/hda. You can issue this command on a
running system. The results are only used to update the SMART Attributes, visible with the ´-A´ option. If any
device errors occur, they are logged to the SMART error log, which can be seen with the ´-l error´ option.
#smartctl -A -v 9,minutes /dev/hda
Shows the vendor Attributes, when the disk stores its power-on time internally in minutes rather than hours.
#smartctl -q errorsonly -H -l selftest /dev/hda
Produces output only if the device returns failing SMART status, or if some of the logged self-tests ended with errors.
#smartctl -q silent -a /dev/hda
Examine all SMART data for device /dev/hda, but produce no printed output. You must use the exit status (the $? shell variable) to learn if any Attributes are out of bound, if the SMART status is failing, if there are errors recorded in the self-test log, or if there are errors recorded in the disk error log.
#smartctl -a -d 3ware,0 /dev/sda
Examine all SMART data for the first ATA disk connected to a 3ware RAID controller card.
#smartctl -a -d 3ware,0 /dev/twe0
Examine all SMART data for the first ATA disk connected to a 3ware RAID 6000/7000/8000 controller card.
#smartctl -a -d 3ware,0 /dev/twa0
Examine all SMART data for the first ATA disk connected to a 3ware RAID 9000 controller card.
#smartctl -a -d 3ware,0 /dev/twl0
Examine all SMART data for the first SATA (not SAS) disk connected to a 3ware RAID 9750 controller card.
#smartctl -t short -d 3ware,3 /dev/sdb
Start a short self-test on the fourth ATA disk connected to the 3ware RAID controller card which is the second SCSI device /dev/sdb.
#smartctl -t long -d areca,4 /dev/sg2
Start a long self-test on the fourth SATA disk connected to an Areca RAID controller addressed by /dev/sg2.
#smartctl -a -d hpt,1/3 /dev/sda (under Linux) #smartctl -a -d hpt,1/3 /dev/hptrr (under FreeBSD)
Examine all SMART data for the (S)ATA disk directly connected to the third channel of the first HighPoint RocketRAID controller card.
#smartctl -t short -d hpt,1/1/2 /dev/sda (under Linux) #smartctl -t short -d hpt,1/1/2 /dev/hptrr (under FreeBSD)
Start a short self-test on the (S)ATA disk connected to second pmport on the first channel of the first HighPoint RocketRAID controller card.
#smartctl -t select,10-100 -t select,30-300 -t afterselect,on -t pending,45 /dev/hda
Run a selective self-test on LBAs 10 to 100 and 30 to 300. After the these LBAs have been tested, read-scan the remainder of the disk. If the disk is power-cycled during the read-scan, resume the scan 45 minutes after power to the device is restored.
#smartctl -a -d cciss,0 /dev/cciss/c0d0
Examine all SMART data for the first SCSI disk connected to a cciss RAID controller card.