Why
I noticed that my backups were very slow. So I decided to test the speed of my backup disks.
Then and Now
Before coding agents, I would have spent hours to learn and run disk benchmarks.
Now I use a coding agent. I asked Claude to do the tests. Claude made a plan to test many disks. Claude tested each disk when I plugged it in.
This article shows how I used Claude Code to test my backup disks and the findings and takeaways.
Setup
- Linux Mint 22.2 with Claude Code.
- Install
smartctlandhdparm. On Debian or Ubuntu, use this command:sudo apt install smartmontools hdparm. Theddtool is part of the standard Linux tools. - Plug in one disk at a time. Each disk takes 10 to 15 minutes.
The prompt, and the plan it produced
I did not write a long prompt. This is the complete text that I typed, with the spelling errors:
verifying backup disks
ok I am sick of slow backup disks..
I want to check a few disks to see how good they are..
I am going to plug them one by one..
you are goint to test them.
sounds good?
Claude Code replied “Sounds good”. It checked which tools were installed. It checked which disks were attached. Then it proposed this plan:
- Identify. I diff
lsblkagainst this baseline to find the new disk. I tell you the model and size so you can confirm it’s the right one.- Health. I run
smartctl -a, checking reallocated and pending sectors, power-on hours, error log and negotiated link speed (USB 2 vs USB 3 is a common cause of “slow”).- Read speed. I run
hdparm -tand a large sequentialddread with direct I/O. This is non-destructive.- Write speed (optional). I only do this if you OK it. On a mounted filesystem, I write and delete a temporary 4 to 8 GB file, which is safe. On a raw disk whose data you don’t need, I do a full-surface test. That is destructive, so I’ll ask first for each disk.
- Sustained speed. Many SMR drives and cheap SSDs are fast for the first minutes and then collapse. If a disk looks suspicious, I’ll run a longer write to catch that.
Plug in the first disk when you’re ready and tell me. Also tell me whether it holds data you care about, so I know whether destructive tests are allowed.
The plan changed during the session. The write test became a fixed test of 150 seconds. Claude Code recorded the write speed every 15 seconds. This is the final version of the prompt. Paste it into Claude Code to save time. Claude Code does not do a destructive write before it asks you.
I'm going to plug in backup disks one at a time and want you to test each. For every disk:
1. Detect the new disk by diffing lsblk against the baseline. Tell me the model, serial and size, and don't touch disks that were already attached.
2. Check health: smartctl -a -d sat (reallocated, pending, CRC errors, power-on hours, temperature, error log) and the USB link speed (it should be 5000 Mbps or more).
3. Run read tests, non-destructive: hdparm -t, plus dd iflag=direct samples at the start, middle and end of the disk. If any region is slow, re-test it and map its extent.
4. Run a write test on the mounted filesystem: a 150 s time-limited dd of /dev/urandom with oflag=direct, logging MB/s every 15 s to catch SMR slowdowns. Use sudo if the volume is root-owned, delete the temp file afterwards and confirm it's gone. If the disk is locked, ask me to unlock it. Never do destructive raw writes without asking me first.
5. Report a short table (SMART, age, temperature, read range, write MB/s, verdict) and keep a running scoreboard across disks.
Flag anything suspicious: reallocated or pending sectors, a flat-then-collapsing write curve (likely SMR), or slow regions. Then wait for me to plug in the next disk.
Plug in a disk, then tell Claude
Type “plugged in the next disk”. Claude Code does the same checks each time. At the end, it shows a table of results and a scoreboard. Note these two points:
- Claude Code identifies each disk by its serial number. Linux can use the same name for different drives, for example
/dev/sdd. Make sure that the serial number is for the correct disk. - Claude Code does not type your passphrase. If a disk is encrypted and locked, Claude Code asks you to unlock it. Then it does the write test and deletes the temporary file.
Results
After each disk, Claude Code shows a row like these. This is a short extract of the table:
| Disk | Size | Write (MB/s) | Read (MB/s) | SMART | Verdict |
|---|---|---|---|---|---|
| WD40NDZW | 4 TB | 78 | 75–114 | Clean | Good |
| WD20NMVW | 2 TB | 85 | 57–115 | 1 reallocated sector | Good. Watch it. |
| WD20NMVW | 2 TB | 69 | 47–101 | Clean | Good |
| WD40NMZW | 4 TB | 5 | 57–98 | Clean | Bad. Do not use for backups. |
At the end, I had seven disks. Six went into the good bin. One went into the bad bin.
This chart shows the same batch of tests. The shaded area shows the healthy range in my batch. One disk is far outside this range.
HD vs SSD
An SSD is much faster than a hard disk. The write speed of an SSD can decrease when its fast cache is full.
Fun fact: How long does a backup of 1 TB take? The chart shows the time at the speeds I measured. I used a no-name brand SSD for these tests, so the SSD numbers are for that disk. Other SSDs can be faster or slower.
Disk bandwidth on a scale
This chart shows the speeds against the limits of each interface. A faster disk does not help if the disk is near the limit of its USB or SATA interface.
The interface values are approximate limits for real use. The NVMe value comes from the manufacturer specification. I did not measure it.
Takeaways
- Describe the goal. Let Claude make the plan. A few lines were enough. Claude proposed the tests. I only plugged in the disks.
- Make the tests safe. Do the read-only tests first. Identify each disk by its serial number. Do not allow a destructive action without a clear yes.
- Trust the results, but test again. Record the write speed over time. Repeat each unexpected result. Compare each disk with your other disks.
A note on how I made this article: I use AI tools to help create this blog. The ideas and the experiments are mine. The AI helped me run the tests, make the charts, and write the draft. I decided what to test and what to say.
Loading comments…