Probably Fine

The SSD said PASSED until the day it didn't

· disks

The box in the closet off the kitchen is an office desktop I bought used in 2019 for ninety dollars. It has a 500 GB SATA SSD for the operating system and two 4 TB spinning disks in a mirror for everything that matters: photos, documents, the scanner inbox, a couple of small databases. The SSD was the part I worried about least. It had been in there for four and a half years without a single complaint.

On a Tuesday in January it went read-only halfway through a package upgrade. The kernel log had a screenful of I/O errors on sda, the root filesystem remounted itself read-only, and the upgrade left two packages half-configured. A reboot brought everything back. Nothing looked wrong afterward, which is the worst kind of fixed.

What SMART had been saying

I ran smartctl and read the attributes instead of the summary. The summary still said the overall health self-assessment had PASSED. The attributes told a different story:

# smartctl -A /dev/sda | grep -E 'Realloc|Uncorrect|Pending'
  5 Reallocated_Sector_Ct   0x0033   095   095   010    Pre-fail  Always       -       112
187 Reported_Uncorrect      0x0032   100   100   000    Old_age   Always       -       3
197 Current_Pending_Sector  0x0032   100   100   000    Old_age   Always       -       0

112 reallocated sectors. The normalized value was 95 against a threshold of 10, so by the drive's own arithmetic it had a long way to go before it would call itself failing. That's all PASSED means: no normalized value has crossed its threshold yet, and the drive's maker picks both numbers.

As it turns out, I had smartd running with its default config, and it had been paying attention. Going back through the system log, the reallocated count was 0 in early December, 8 on the 19th, 41 on New Year's Day and 112 by the time the drive fell over. It logged every change, faithfully, to a file I never read.

The wear figures, for the record, were fine: about 61 TB written over the drive's life, against a rated endurance several times that. This drive didn't wear out. It had a bad patch of flash and quietly worked around it until it couldn't.

The replacement

A new 1 TB SSD cost me $54. I didn't try to clone the old one. Copying a disk that is actively going bad is a good way to copy its problems too, and the system drive on this box holds nothing I can't rebuild. Three things made a fresh install realistic:

The install took about forty minutes. Restoring /etc piece by piece, reinstalling packages from the list and reassembling the mirror took the rest of the afternoon, a little over four hours in total. The mirror came up on the first try with its data untouched. It was never the problem.

The notes file was missing two things, both obvious only in hindsight: a udev rule for the label printer, and a kernel setting I changed in 2021 for reasons I still can't reconstruct. I put the udev rule back and left the other one out. Nothing has complained in three weeks.

What changed

Two things. First, smartd now runs a small script when an attribute changes, instead of only logging it. The script appends a line to a text file in my notes inbox, which I do read, because it's also where the shopping list lives.

/dev/sda -a -o on -S on -s (S/../.././02|L/../../6/03) -m <nomailer> -M exec /usr/local/bin/smart-note
/dev/sdb -a -o on -S on -s (S/../.././02|L/../../6/03) -m <nomailer> -M exec /usr/local/bin/smart-note
/dev/sdc -a -o on -S on -s (S/../.././02|L/../../6/03) -m <nomailer> -M exec /usr/local/bin/smart-note

The <nomailer> part tells it not to try sending anything, only to run the script. Short self-tests run every night at two, and a long one on Saturdays at three.

Second, I stopped treating PASSED as an answer. Once a month I look at three raw numbers per drive: reallocated, pending and uncorrectable. If any of them is above zero and moving, that drive goes on the list to be replaced. It's a two-minute job, and this time it would have given me about six weeks of warning.

The old SSD is in a drawer with a strip of masking tape on it that says BAD. I'm not sure why I'm keeping it.

← all posts