S.M.A.R.T., or Self-Monitoring, Analysis, and Reporting Technology, is a system designed to monitor hard drive health. It is integrated into both traditional magnetic and SSD drives and can help predict drive failure, allowing you to take action before a problem occurs.

The smartctl tool, part of the smartmontools package, allows you to check the status of your S.M.A.R.T.-enabled hard disk drive (HDD) in Linux. This package is available in most Linux distributions, including Ubuntu.

To assess disk health in Ubuntu and other Linux distributions, install the smartmontools package and use the smartctl utility from the terminal. Note that S.M.A.R.T. does not cover disk errors like bad sectors or corrupted filesystems, so you may need additional methods for these issues.

Steps to check hard drive health status in Linux:

  1. Open the terminal.
  2. Install the smartmontools package for your system.
    $ sudo apt update && sudo apt install --assume-yes smartmontools # Ubuntu and Debian
  3. List the hard drives installed on your system.
    $ lsblk | grep disk
    sda      8:0    0   20G  0 disk
    sdb      8:16   0    5G  0 disk
  4. Use smartctl to instruct the hard drive to perform a self-test.
    $ sudo smartctl -t short /dev/sda
    smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-47-generic] (local build)
    Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
    
    
    === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
    Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
    Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
    Testing has begun.
    Please wait 2 minutes for test to complete.
    Test will complete after Wed Jul 17 15:58:30 2019
    
    Use smartctl -X to abort test.
  5. After the self-test is complete, use smartctl to check the health status of the selected hard drive.
    $ sudo smartctl -H /dev/sda
    smartctl 7.1 2019-12-30 r5022 [x86_64-linux-5.4.0-47-generic] (local build)
    Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
    
    === START OF READ SMART DATA SECTION ===
    SMART Health Status: OK
Discuss the article:

Comment anonymously. Login not required.