Use smartctl to check SATA HDD and SSD.

08 Jul 2026, 13:30:37
SMART (Self-Monitoring, Analysis, and Reporting Technology) is a technology for self-monitoring, analyzing, and reporting on the status of a drive, supported by nearly every modern hard drive, SSD, or NVMe drive. During operation, the drive controller collects certain statistics about its status (temperature, working hours, errors, number of power-on cycles, and much more). This information can directly or indirectly indicate problems with the drive or its connection, and reveal signs of degradation leading up to complete failure of the storage device.
In this article, we’ll explore how to use the smartmontools package, which is used to display SMART parameters, run tests, and automatically monitor the status of storage devices.

What is smartctl

smartctl is a utility from the smartmontools package used for manually diagnosing a disk and displaying information about it. The package also includes the smartd daemon, which automatically monitors the disk's status and notifies the user of any detected issues.

Installing smartctl

The utility is installed by default on all dedicated servers provided by Virterion.com. You can install the smartmontools package from the system's standard repositories. All commands in the examples are run as the root user; otherwise, add the sudo command before the main command.

Debian and Ubuntu

apt install smartmontools

AlmaLinux, RHEL

dnf install smartmontools

Arch Linux

pacman -S smartmontools
You can check the version of the installed program using the following command:
smartctl --versionAs of this writing, version 7.4 of smartctl is available in the Ubuntu 24.04 repositories:
20260708_fyPrcU0B
However, as of this writing, the current version of smartmontools is 7.5. To install it, you must compile the utility manually.

Compiling smartmontools from source

Let's install all the necessary dependencies. For Ubuntu and Debian, the command looks like this:
apt update
apt install build-essential git autoconf automake libtool
Download and unzip the archive containing the program:
wget -q https://downloads.sourceforge.net/project/smartmontools/smartmontools/7.5/smartmontools-7.5.tar.gz && tar xf smartmontools-7.5.tar.gz20260708_QTHY9lik
Compile smartmontools and install the package using the following commands:
cd smartmontools-7.5
./configure
make && make install
The build will take only a short time. Once it's finished, you can check the utility's version to make sure you've built the latest version:
smartctl --version20260708_T5wJ1cKo

Update smartmontools

If you already have an older version of smartmontools installed, for example, from the system repositories, you can update it by compiling the program manually (as described in the previous chapter).
After compiling a new version of the program, simply replace the executable file with the new one. You can locate it using the following command:
whereis smartctlOn Ubuntu 24.04 it's /usr/sbin/smartctl.
20260708_nELLLd8V
Let's create a link to the executable file for the new version of the program, replacing the old one:
ln -sf /usr/local/sbin/smartctl /usr/sbin/smartctl
  • -s - create a symbolic link;
  • -f - delete the file at the path specified by the link, if it exists.
20260708_R4vsYQaD

Identifying Drives

Using smartctl, you can list all the drives on the system that the utility can work with:
smartctl --scanThe command displays a list of the devices found and the recommended device type.
20260708_qbwlZQYH

Disk Information

You can view information about the storage device using the following command:
smartctl -i /dev/sda
  • /dev/sda - disk name.
20260708_Euop4VcQ
Main Fields:

Rotation RateHDD spindle speed (SSD used as an example)
TRIM CommandTRIM support (for SSDs only)
Device isinformation about the drive model is available in the SmartMonTools database
SATA Version issupported SATA standard versions and data transfer rates (supported and used)
SMART support istwo lines with the same name: the first ("Available - device has SMART capability") indicates that the drive itself supports SMART technology, while the second ("Enabled") indicates whether SMART is enabled or disabled.

Turn on SMART

If, when checking the disk information, you see the line "SMART support is: Disabled":
20260708_N1XE47gr
You need to enable SMART for the storage device:
smartctl -s on /dev/sda20260708_kI7y0ezV
It's also a good idea to enable automatic disk testing right away:
smartctl -o on /dev/sda20260708_JNweTLGr
And saving parameter values to non-volatile memory:
smartctl -S on /dev/sda20260708_svNwP5wS

Complete Information About the Drive

To display all SMART data for the drive for diagnostic purposes, use the following command:
smartctl -a /dev/sda

Overall disk condition

Earlier, we looked at the attributes of the “START OF INFORMATION SECTION” block; now let's look at the “START OF READ SMART DATA SECTION” block.
The first line, “SMART overall-health self-assessment test result,” indicates the drive's overall “health.”
You can also display it using the command:
smartctl -H /dev/sda20260708_FYuYhYVR
A “PASSED” result indicates that the drive controller did not detect any critical SMART attributes exceeding their thresholds, which would indicate an imminent drive failure. However, this does not mean that the drive was error-free or in good condition.
The "FAILED" status indicates that the disk is in a critical condition. In this case, you should transfer your data as soon as possible and replace the failed disk.

General SMART Values

The "General SMART Values" section contains information about the progress of testing, the estimated duration of checks, and the status of offline tests.

SMART disk attributes

The SMART attribute block contains a table of attributes and values, which we will discuss in more detail below. These are partially standardized and may vary by manufacturer; we will cover the most basic ones.
20260708_rd5ogFbd
Let's break down the main columns in the table below:

IDattribute identifier
ATTRIBUTE_NAMEattribute name
FLAGan array of bit flags describing the attribute's properties
VALUEthe current normalized value of the attribute (typically between 1 and 253)
WORSTthe lowest VALUE ever recorded by SMART
THRESHthe VALUE threshold, upon reaching which the overall status of the medium will change to FAILED
TYPEattribute type (Pre-fail - attributes that determine the overall condition of the disk; Old_age - operational metrics)
UPDATEDattribute update (Always - automatic, Offline - during tests)
WHEN_FAILEDwhen the attribute crosses the THRESH threshold ("-" means never)
RAW_VALUEinitial value of the attribute
We mainly look at the RAW_VALUE column, since the values can vary depending on the drive type or manufacturer, and the utility's normalized value doesn't always give the full picture.

Let's take a look at the SMART Attributes:

Reallocated_Sector_Ctthe number of sectors (blocks) that were marked as defective and replaced with spare ones
Power_On_Hoursnumber of working hours of the drive
Power_Cycle_Countnumber of turns
Wear_Leveling_Countthe degree of memory "wear" (for Samsung and Intel, the higher the value, the better)
Used_Rsvd_Blk_Cnt_Totnumber of reserve blocks used
Program_Fail_Cnt_Totalnumber of errors when writing data to memory cells
Erase_Fail_Count_Totalnumber of memory cell erasure errors
Runtime_Bad_Blockthe number of faulty blocks detected during routine operations
Uncorrectable_Error_Cntthe number of unrecoverable errors (the controller was unable to recover data when reading from or writing to a damaged memory sector)
Airflow_Temperature_Celdisk temperature
ECC_Error_Ratethe number of errors corrected by correction algorithms
CRC_Error_Countthe number of interface errors (errors in data transmission between the disk controller on the motherboard and the disk itself) almost always indicates a problem with the drive's connection cable or connector
POR_Recovery_Countthe number of times the disk has recovered after an unexpected power loss
Total_LBAs_Writtenan important indicator of a drive's lifespan; specifically, it indicates how many logical blocks have been written over its entire lifetime. It is from this figure that the TBW specified by the manufacturer can be calculated

SMART Error Log

If the disk is in good working order, you will see the message "No Errors Logged" in the error log section. However, if any entries appear there, this is a reason to run a full disk test and then replace the disk. As a rule, almost any error in the log is a reason to replace the hardware, with the exception of very old errors and errors related to the connection (cable) or a power failure.
You can view the error log separately using the command:
smartctl -l error /dev/sda20260708_rCyzWNAj

Disk Testing

The condition of the storage medium can already be assessed based on the attributes listed earlier, for example Reallocated_Sector_Ct, ECC_Error_Rate, Runtime_Bad_Block, Uncorrectable_Error_Cnt, and the error log. However, the final verdict on the storage medium is determined by the results of the tests described in the next section.
20260708_ndlTeT0N
The smartmontools utility offers two types of tests:
  • Short - a quick check (~2 minutes); the test verifies all major mechanisms, the cache, the disk controller, and portions of memory;
  • Extended (Long) - full scan (~3 hours, depending on the disk); checks the same things as the "short" scan, plus every memory cell.
To run one of the tests, enter the following command:
smartctl -t short /dev/sda
  • -t - test type (short or long);
  • /dev/sda - disk name.
20260708_Y6jPVMQh
To display only the test results, you can use the following command:
smartctl -l selftest /dev/sda
  • /dev/sda - test drive.
20260708_8Ckf2tri
A quick test can be used to monitor the condition of your drives on an ongoing basis; a full test should be performed when a drive shows signs of trouble (deteriorating SMART metrics, decreased performance). Errors detected during a full drive test are a clear indication that the drive needs to be replaced. For this, you can contact our support team 24/7.

Conclusion

The smartmontools package serves as a foundation for disk testing and SMART parameter analysis, not only for Linux systems. It allows you to assess the health of SSDs, HDDs, and NVMe drives, detect early signs of device degradation, and prevent potential data loss. Running a quick test periodically and a full test at least once a month is a best practice for safe server management, especially when not using mirrored RAID arrays.
If you are a Virterion.com customer, you don’t need to understand the intricacies of this utility; you can always contact our support team, and we’ll check the health of the drives on your dedicated server completely free of charge.

SSD Storage VPS

Browse Configurations

Windows SSD Storage VPS

Browse Configurations