⌁ Hardware & electronics

SMART data: how to read the health of SSDs and hard disks

What SMART data is, which attributes to check on hard disks and SSDs, how to read them with smartctl and graphical tools, and when to replace a drive.

Almost every modern drive keeps a logbook about itself. It's called SMART (Self-Monitoring, Analysis and Reporting Technology) and it records error counters, power-on hours, temperature and wear. Reading it doesn't require expensive tools and it can give you the warning you need to save your data before a drive fails completely.

What SMART measures

Each drive exposes a series of attributes. On a SATA hard disk each attribute has a numeric ID, a normalised value, a worst recorded value, a threshold and a raw value. On NVMe SSDs the structure is different and simpler: a health log with fixed fields, such as percentage of life used, data written, media errors and temperature.

The normalised value usually starts at 100 or 200 and drops as things get worse. When it falls below the threshold, the drive reports a predicted failure. The problem is that many drives fail before this happens: that's why it's worth looking at the raw values too.

Attributes to check on a hard disk

ID Name What it indicates
5 Reallocated Sectors Count faulty sectors replaced with spare sectors
197 Current Pending Sector Count unstable sectors waiting to be remapped
198 Offline Uncorrectable sectors that could not be read during tests
199 UDMA CRC Error Count transmission errors on the cable, not on the surface
9 Power-On Hours total hours of operation
194 Temperature current temperature

As a rule of thumb, a healthy drive has raw values of zero for attributes 5, 197 and 198. A few reallocated sectors don't mean imminent death, but a number that grows over time is a clear signal: the drive is degrading.

Attribute 199 deserves a separate note: if it rises, the culprit is almost always the SATA cable or connector. Replacing the cable costs little and often fixes it.

What to check on an SSD

For NVMe SSDs the most useful fields are:

  • Percentage Used: an estimate of wear relative to rated endurance. It can exceed 100% and the drive keep working, but it's time to plan a replacement.
  • Available Spare: the percentage of spare blocks still available, to be compared with the stated threshold.
  • Media and Data Integrity Errors: uncorrectable errors; this should be zero.
  • Data Units Written: total amount of data written, useful to compare with the warranty TBW.
  • Critical Warning: a field that, if non-zero, signals a serious problem.

SATA SSDs use attributes similar to hard disks, but names and numbering vary by manufacturer: it's worth checking the model's documentation.

How to read the data

On Linux, macOS and Windows the reference tool is smartctl, from the smartmontools package:

smartctl -a /dev/sda        # all information for a SATA drive
smartctl -a /dev/nvme0      # health log of an NVMe SSD
smartctl -t short /dev/sda  # start a short test
smartctl -t long /dev/sda   # start a full surface test

On Windows there are also free graphical programs that present the same data with an overall verdict. They are handy, but the verdict should be taken as a hint: it's better to look directly at the critical attributes.

Be careful with external USB drives: some adapters don't pass SMART commands through. In that case the data can't be read, or only with specific options, and missing data doesn't mean the drive is fine.

Built-in tests

Besides reading counters, you can start internal tests:

  • the short test takes a few minutes and checks the main functions;
  • the extended test reads the whole surface and can take hours on large drives;
  • the conveyance test, on some models, checks for damage caused by shipping.

A failed extended test on a hard disk is a serious sign. In my work, when I receive a suspect drive, the first thing I do is read SMART without starting long tests: if there are unstable sectors, the priority is to copy the data, because a test lasting hours can put further strain on a drive that is already ailing.

Monitoring over time

SMART's real value emerges from comparing successive readings. The smartd daemon can check drives periodically and send an alert when an attribute changes. On a NAS or home server this feature is almost always already available in the management panel: you just need to enable it and set up email notifications.

When to replace the drive

  • Reallocated or pending sectors that increase from one reading to the next.
  • Uncorrectable errors on an SSD.
  • SSD wear close to or above 100%, or spare capacity below the threshold.
  • A failed extended test.
  • New mechanical noises from a hard disk, even with apparently clean SMART data.

In short

  • SMART is the drive's internal health log and it's free to check.
  • On HDDs, reallocated, pending and uncorrectable sectors matter most.
  • On SSDs, look at wear, available spare and integrity errors.
  • The trend over time matters more than any single reading.
  • At the first signs of degradation, copy your data immediately and then investigate.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. With degrees in computer science and psychology, he combines technical analysis with an understanding of the human factor.

Read also