I got tired of randomly finding out a hard drive I thought was good wasn’t actually good, so I built a tool to automatically benchmark and test my drives before I trust them with my data. Here’s what I built and how you can use it to make your homelab more reliable.
Why I benchmark and test drives before trusting them
Just because it worked in the past doesn’t mean it’s reliable now
As someone who is reviewing computers, NAS systems, servers, and other homelab equipment a lot, I have a lot of hard drives. The thing is, that’s not really a change for me. I’ve always had a lot of hard drives around, whether they came from an old system, were used in an old NAS, or were something I recently picked up.
Hard drives aren’t always easy to know if they’re good or not. I recently had a drive that was fine for many years, and after shutting a server down for a few weeks, the drive powered up and was bad. Did it magically go bad in those few weeks? Probably not, but when I sold that server, I tested the drives that were in it and found one was bad — that’s why you always test a drive.
A few months ago, I got a few 20TB drives from a friend who was selling them. When they arrived, I immediately threw them into my NAS because I was excited to have larger-capacity drives.
Two drives worked, two didn’t. I wasn’t sure if it was my NAS acting up, if they weren’t seated right, or what was going on. Eventually, I found out two of the drives were damaged in transit.
So, after those instances, I’m working on making it a habit to test drives before using them now, just to make sure they haven’t failed. However, it’s a hassle to pull my drive dock out of the closet, plug it in, dock the drive, and then manually run a scan. So, I built a tool that would handle it all for me, headless and on a Raspberry Pi, called DriveCheck.
All it takes is a Raspberry Pi and a USB HDD dock
The software does the rest
So, instead of lugging out hardware every time I wanted to test a hard drive, I decided to build a dedicated docking station. The great part is it’s just based on a USB hard drive dock and a Raspberry Pi.
Right now, the Pi is hardwired into my network just because it’s close enough to be. However, I can easily take and move the Pi anywhere it has power and run it wirelessly.
DriveCheck is built simply. DriveCheck deploys via a single installer file that sets everything up for you. I chose not to go the Docker route as passing through different drives automatically with Docker is a bit of a headache.
I built DriveCheck to have both a web dashboard and a Telegram bot agent. You simply supply the Telegram bot credentials (or Discord webhook, but Telegram has more features) if you want to use that.
The web dashboard is where everything lives, and it runs on port 8765 by default. You can configure DriveCheck using either command line arguments or in the web dashboard.
Once configured, it monitors for any hard drive to be docked into the USB dock. It ignores drives that are natively mounted to the system for security purposes, so you can’t accidentally wipe your boot drive.
I have mine configured to be 100% headless, though you don’t have to set it up that way. This means that when I dock a drive into the system, I get a Telegram notification when a scan starts and finishes. Telegram also has built-in buttons for other actions, like running an extended test or formatting. There’s also a button to eject the drive, though that happens automatically after a configurable amount of time.
I built the software to be a check-first tool. That means that the main goal of the software is to simply check and benchmark the drive. So, when I dock a drive, it starts by running a short SMART test, then runs a read sample to measure the attached drive’s read speed.
Then, I can start an extended test if I want to dig deeper into the drive. Typically, a short test with a read sample is enough for me. There are also two format options. Quick erase is similar to Windows’ Quick Format tool, but you can also completely overwrite the drive or use the drive’s firmware to format it if you want.
Overall, this tool has made scanning hard drives extremely simple instead of the cumbersome process it used to be.
A passing result gives me a good starting point
It’s still not a guarantee, though
As I said, I primarily focus on the quick test. It helps me test a drive’s read speeds and run a short SMART test. This typically indicates whether a drive is healthy. However, it’s not a guarantee at all.
So, that’s why I include the extended test. The reason I don’t typically run that is that it can take several hours, sometimes over 24 hours, depending on the size of the drive. I only run an extended test if I’m worried about a drive’s reliability.
However, if the drive comes back good with the quick test and the read speed test, then I’ll normally just roll with it. That gives me a good starting point and helps me know what’s going on with the drive.
On the web dashboard, I’ve also designed DriveCheck to show some of the SMART results at a glance. You can export the full raw SMART output if you want to dig deeper, but the most important metrics are shown at a glance for each drive.
Compatible Devices
2.5- and 3.5-inch drives
Brand
SABRENT
Transfer rate
10Gb/s
SABRENT’s USB-C hard drive docking station is the perfect way to access a HDD or SSD from your computer. It is a powered station, meaning it supports both 2.5- and 3.5-inch drives. Plus, being USB-C, it can easily plug into any device you already own.
Checking your drives before mounting them is a great way to save yourself a headache
If I had had a system like this in place when I got those 20TB drives in, then it would have made things so much easier. Instead, I spent many, many hours debugging them. Now, I don’t have to anymore — and neither do you.
