Blinkenlights for my drives
Just a bit of a departure from all the modelling posts, and not even "somehow related" this time.
I have a couple of 8 TB drives (Seagate IronWolf) hanging off a Lenovo ThinkCentre m920q through SATA-to-USB 3.0 adapters. The m920q runs Proxmox, and the drives are passed through to a Windows VM called freeside. Everything lives in a 3D-printed 10" rack. It works fine, but it had two problems I kept noticing:
- The only activity lights are on the adapters, which sit at the back of the rack, facing the wall.
- I had no idea how the drives were actually doing. A drive can be quietly collecting bad sectors for weeks before anything visibly breaks.
So I wanted a small front panel that tells me, at a glance, whether each drive is busy and whether it's healthy. Think of those old load-monitor lights, but for disks.
What the drives already know
Every modern hard drive keeps a running log of its own health, called SMART. Most of it is noise, but a handful of counters are genuinely good at predicting trouble (Backblaze has years of data from their fleet backing this up):
| ID | What it counts | What it means |
|---|---|---|
| 5 | Reallocated sectors | Bad spots the drive has already swapped out. Should be 0; growth is a warning. |
| 197 | Pending sectors | Spots the drive is struggling to read right now. The best early warning there is. |
| 198 | Offline uncorrectable | Data the drive couldn't recover. |
| 199 | UDMA CRC errors | Errors on the cable between the drive and the adapter, not the disk itself. |
| 194 | Temperature | Drives like being somewhere between 30 and 45 °C. |
That last-but-one is my favourite for a setup like mine. With bare USB adapters, a flaky cable or a tired 12 V power brick is far more likely than a failing disk, and attribute 199 tells the two apart.
The other useful thing I learned: the overall "SMART status: PASSED" that most tools show you is nearly useless. Drives tend to report PASSED right up until they die. What matters is whether those counters are changing, so the whole thing is built around comparing against a baseline rather than looking at raw numbers.
The USB catch
SMART data travels as ATA commands, and over USB those have to be tunnelled through the adapter's
bridge chip. Some cheap adapters simply don't do it, and then you get nothing. Mine turned out to use
an ASMedia chip (USB ID 174c:55aa), which does pass it through. smartctl from smartmontools
reads everything without even needing extra flags.
If you're shopping for adapters for this kind of thing, look for ASMedia (ASM1153, ASM1351) or JMicron (JMS578, JMS567) chips.
The Proxmox layer adds one more catch: the drives have to be passed to the VM as USB devices,
by port. If you attach them as virtual disks, Windows sees a QEMU HARDDISK and SMART can't get
through at all.
What I ended up with
The design went through a few rounds. It started as a little display with gauges, became a pair of LEDs per bay (a plain activity LED and an RGB status LED), and ended up much simpler: one RGB pixel per drive, cut off an addressable LED strip I already had.
The rule is that it stays dark unless there's something worth seeing:
| Light | Meaning |
|---|---|
| Off | Healthy and idle, asleep, or no drive in that bay |
| Flickering blue | Reading or writing, flickering more the busier it is |
| Solid amber | Worth a look: running warm, CRC errors rising, a few old reallocated sectors |
| Solid red | Back it up: pending or uncorrectable sectors, sectors being reallocated, a failed self-test |
| Solid purple | The drive can't be read, or a drive I expect is missing |
| Faint white breathing | The VM stopped talking to the lights |
I didn't want to look at a constant green light reassuring me that everything is fine. Dark means fine. Anything lit means either "it's working" (blue) or "go look" (everything else).
Behind it, a Wemos D1 mini (an ESP8266 board, about the size of a postage stamp) drives the pixels. It's plugged into the m920q and passed through to freeside along with the drives. On freeside, a small Python script reads SMART every five minutes, reads the disk activity counters twenty times a second, and sends both to the board over USB serial. No Wi-Fi, no network, no cloud.
The first reading
The first time it ran, both IronWolfs lit up amber. Not because anything was failing, but because they were sitting at 46 and 48 °C in a rack with no airflow. That's within Seagate's spec (they're rated up to 70 °C), but warmer than I'd like, so I moved the warning threshold to 50 °C and put "add a fan" on the to-do list. Which is exactly the kind of thing I wanted this to tell me.
How it's built, with the parts list, wiring and code, is in the next post.