How disks fail, and how SMART warns you

Video 085 of 140 in Virtualization Foundations, in the unit “Hardware failure and health”. 4:01, with English and Hindi audio.

Every server has disks, and every disk wears out in the end. Some give warning signs for days or weeks, while others fail with no warning at all. A disk also keeps its own count of trouble, which it reports through a system called SMART. This article explains the counts that matter, how to ask a disk for its health with smartctl, and why a warning helps only when someone reads it.

What you will learn

How a disk wears out

Picture a database server in a Harbor Point data centre. Its disk has worked quietly for years, until one night the logs fill with read errors. Disks do wear out. Some give warning signs for days or weeks, and others fail with no warning. Without a copy of the data, a dead disk means lost data.

The counts a disk keeps about itself

On a young disk, a few of these counts may mean little. A count that keeps rising is the warning that matters.

Ask a disk for its health with smartctl

To ask a disk for its health, install the smartmontools package. Then run smartctl with the name of the disk.

Install the SMART tools
sudo apt install smartmontools

The short check gives one verdict. A PASSED result does not prove that a disk is perfect.

Show the short health verdict of a disk
sudo smartctl -H /dev/sda

The full report lists every attribute, with its raw count. Watch the raw counts of reallocated, pending and uncorrectable sectors, and check whether they grow. Solid-state drives report in their own layout, and smartctl reads those too.

Show the full SMART report of a disk
sudo smartctl -a /dev/sda

Who watches the disk, and where the warning fails

Note: SMART is a warning, not a promise. Some RAID controllers hide the disks from the operating system, so smartctl sees nothing and you need the controller's own tool.

Check the health of one disk

You need a Linux machine with sudo rights and a disk to query. Replace /dev/sda with the name of your own disk.

  1. Install the smartmontools package, which contains smartctl.

    sudo apt install smartmontools

    What you should see: The smartctl tool is installed and ready to query a disk.

  2. Ask the disk for its short health verdict.

    sudo smartctl -H /dev/sda

    What you should see: The verdict reads: SMART overall-health self-assessment test result: PASSED. It does not prove the disk is perfect.

  3. Read the full report, and note the raw counts of reallocated, pending and uncorrectable sectors.

    sudo smartctl -a /dev/sda

    What you should see: The report lists every attribute with its raw count. Check whether those counts grow over time.

Terms

SMART
A health monitoring system built into most disks. It reports the disk's condition and counts the signs of wear.
Reallocated sector
A weak area of a disk's surface that the disk has moved to a spare area.
Uncorrectable error
An area of a disk that could not be read, even after retries. Its data is lost unless it was copied.

Check yourself

What does a PASSED result from smartctl -H prove?

Only the short verdict. It does not prove the disk is perfect, so read the full report as well.

Which SMART counts matter most when they keep rising?

Reallocated, pending and uncorrectable sectors. A count that keeps rising is the warning that matters.

Why might smartctl show nothing for some disks?

Some RAID controllers hide the disks from the operating system, so you need the controller's own tool.

Previous: Safety and change rules on site. Next: Memory errors: the ones fixed and the ones that are not.