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 smartctl and hdparm. On Debian or Ubuntu, use this command: sudo apt install smartmontools hdparm. The dd tool 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:

  1. Identify. I diff lsblk against this baseline to find the new disk. I tell you the model and size so you can confirm it’s the right one.
  2. 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”).
  3. Read speed. I run hdparm -t and a large sequential dd read with direct I/O. This is non-destructive.
  4. 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.
  5. 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:

DiskSizeWrite (MB/s)Read (MB/s)SMARTVerdict
WD40NDZW4 TB7875–114CleanGood
WD20NMVW2 TB8557–1151 reallocated sectorGood. Watch it.
WD20NMVW2 TB6947–101CleanGood
WD40NMZW4 TB557–98CleanBad. Do not use for backups.

At the end, I had seven disks. Six went into the good bin. One went into the bad bin.

Drawing of two bins. The good bin holds a pile of six smiling hard disks. The bad bin holds one sad hard disk.

PNG version

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.

Bar chart of the write speed of seven hard disks. Six disks wrote at 64 to 85 megabytes per second. One disk wrote at 5.

PNG version

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.

Bar chart of a hard disk and an SSD. The hard disk writes at about 77 megabytes per second and reads at about 95. The SSD writes at 880 at first, then at 153 when its cache is full. The SSD reads at about 450.

PNG version

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.

Bar chart of the time to back up 1 terabyte. A hard disk needs about 3 hours 36 minutes. An SSD needs about 1 hour 18 minutes.

PNG version

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.

Linear chart of disk bandwidth in megabytes per second, from 0 to 1,000. Hard disks are near 100. The SSD is between 150 and 900. The limits are: USB 2 about 40, USB 3 about 450, SATA III about 550, USB 3.2 about 1,000. NVMe is about 7,000 and is not on the chart.

PNG version

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.