smartmontools

smartctl notes

Below is a list of smartctl commands I frequently use to quickly verify disk health and status, specially when you have smartd logging errors to messages log file.

  • Print all SMART (Self-Monitoring, Analysis and Reporting Technology) information for drive /dev/sda (Primary Master).

    smartctl -a /dev/sda

  • Enable SMART on device.

    smartctl --smart=on /dev/sda

  • Get info about the device:

    smartctl -i /dev/sda

  • Show the capabilities of drive. Also provides status when tests are being carried out.

    smartctl -c /dev/sda

  • Basic health status:

    smartctl -H /dev/sda

  • Display attributes. The attributes to look out for failing disk is Reallocated_Sector_Ct, Reallocated_Event_Count, Current_Pending_Sector and Offline_Uncorrectable. Their RAW_VALUE should normally be "0".

    smartctl -A /dev/sda

  • Immediate offline test which updates attributes value. Good to run after a badblocks fsck check before checking on the attributes values.

    smartctl -t offline /dev/sda

  • Run a thorough long test if you see suspect attributes with -A option as mentioned above.

    smartctl -t long /dev/sda

  • Examine self-test log. Shows if tests failed or passed.

    smartctl -l selftest /dev/sda

  • Display most recent error log.

    smartctl -l error /dev/sda

There are more examples in man smartctl.

Comment