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
- A disk can fail slowly, or with no warning at all.
- Rising reallocated, pending or uncorrectable sector counts matter most.
- smartctl asks a disk for its health, and a RAID controller may need its own tool.
- A short PASSED verdict does not prove a disk is perfect, so read the full report.
- A warning helps only when someone reads it, and a copy of the data is the real protection.
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
- Reallocated sectors: the disk moved a weak area of its surface to a spare area.
- Pending sectors: the disk could not read an area, and will try it again.
- Uncorrectable errors: an area could not be read, even after retries. Its data is lost unless it was copied.
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.
sudo apt install smartmontoolsThe short check gives one verdict. A PASSED result does not prove that a disk is perfect.
sudo smartctl -H /dev/sdaThe 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.
sudo smartctl -a /dev/sdaWho watches the disk, and where the warning fails
- Your own server: you run smartctl yourself, on a schedule.
- An enterprise array: the array's own tool reads its disks and raises the alarm.
- A public cloud: the provider runs the hardware, so you watch your service instead.
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.
Install the smartmontools package, which contains smartctl.
sudo apt install smartmontoolsWhat you should see: The smartctl tool is installed and ready to query a disk.
Ask the disk for its short health verdict.
sudo smartctl -H /dev/sdaWhat you should see: The verdict reads: SMART overall-health self-assessment test result: PASSED. It does not prove the disk is perfect.
Read the full report, and note the raw counts of reallocated, pending and uncorrectable sectors.
sudo smartctl -a /dev/sdaWhat 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.