DEV Community

Cover image for The cheapest SSD that won't die in a NAS
lowspecai
lowspecai

Posted on

The cheapest SSD that won't die in a NAS

Most home NAS builds do not die of a bad drive. They die of a cheap drive in the wrong slot, on a machine that loses power without warning.

I run two machines from 2011 as NAS boxes. One is a laptop board: Celeron B815, two cores, 4 GB of DDR3, a 100 Mbps port, a 256 GB SATA SSD and a 320 GB 5400 rpm drive. The other is a mini PC with an i5-2520M, 8 GB, gigabit, a 128 GB SSD and a 3 TB WD Red Plus. Neither is fast. Both have been through enough failures that the drive advice I would give now is the opposite of what the spec sheets sell.

This is the short version of a longer guide I keep on my own site, with the numbers measured on those two boxes.

The endurance maths nobody needs

A 500 GB TLC drive rated at 300 TBW. A busy home NAS writes maybe 5 TB a year — Immich thumbnails, container logs, a backup target, some downloads. 300 ÷ 5 = 60 years. Even with 3× write amplification from a copy-on-write filesystem you are still past 20.

TBW is a warranty term, not a lifespan prediction. The 256 GB drive in the small box reports 8 power-on hours, 0 reallocated sectors, wear-levelling count 0. Nothing about its flash is anywhere near tired. What it lacks is any protection against being unplugged mid-write.

So stop shopping on endurance. It is not the constraint.

What actually kills them

Power loss on a drive with no power-loss protection. Capacitors that flush the write cache on power loss exist only on enterprise drives. Consumer drives — including the expensive ones — do not have them. A DRAM-less drive keeps its mapping table in an on-chip buffer, and losing that mid-write is how you get a filesystem that needs a rebuild instead of a reboot. On a single-drive box that is an afternoon. On an array it can take the whole thing.

The SLC cache running out. Cheap QLC drives benchmark beautifully for the first few gigabytes, then collapse to tens of megabytes per second once the pseudo-SLC cache is exhausted. That is slower than the hard drive you were replacing. Copying 40 GB of photos onto a fresh QLC drive is exactly the workload that finds this.

Heat. A 2.5" SATA drive with any airflow at all is fine — mine sits at 45 °C. An M.2 stick bolted behind a drive cage with no airflow will throttle silently and then start dropping off the bus.

The bridge, not the drive. Cheap USB enclosures and add-in SATA controllers fail more often than the disks inside them. The 3 TB drive in the larger box accumulates interface error counters while completely idle, at roughly 0.1 per second, and the count does not grow with I/O volume. That is firmware or link behaviour, not a dying platter. When a drive misbehaves, suspect the cable, the enclosure and the controller before you blame the NAND.

What I measured

Measurement Number What it tells you
Sequential read, 256 GB SATA SSD (hdparm -t) 506 MB/s the drive is nowhere near the bottleneck
Sequential write, 3 TB WD Red Plus (dd, conv=fsync) 107 MB/s a good 5400 rpm-class platter
Buffered read, 320 GB 5400 rpm notebook drive 88 MB/s what the SSD replaced
SMB transfer over the onboard 100 Mbps port 11.4 MB/s up, 11.3 MB/s down the real ceiling of that machine
Web UI first load, before and after the SSD swap 24 s → 0.25 s a 100× win with nothing to do with bandwidth

Read that table twice. The SSD moves data about 45 times faster than the network port feeding it. A drive with 10% more sequential bandwidth would have changed nothing anyone could perceive.

The 100× improvement came from queue depth, not throughput. The 5400 rpm drive choked on a few dozen concurrent small reads — the JavaScript, the CSS, the fonts — and each one waited behind the last. An SSD serves them in parallel. That is the whole mechanism, and it is why the cheapest drive with a DRAM cache already delivers it.

Practical consequence: once you are on an SSD, paying more for a faster SSD buys nothing measurable on a home NAS. Pay for the two things that do not show up in a benchmark — a DRAM cache and a printed TBW — and stop there.

Five lines on the spec sheet

  1. DRAM cache. The datasheet says "DRAM" or names a cache size. If it says nothing, assume none. DRAM-less drives lean harder on the host and degrade faster as they fill.
  2. TLC, not QLC. Capacity per dollar is the QLC pitch and it is the wrong trade for a machine that receives bulk writes. Shortcut: at the same capacity, a QLC drive's TBW is usually about half of a TLC drive's.
  3. A TBW number that is actually printed. A manufacturer that omits it is telling you something.
  4. Power-loss protection — or an admission that there is none. Consumer drives do not have it. This line decides whether you need a UPS, not whether you need a pricier drive.
  5. SMART attributes that are exposed. A decent drive reports reallocated sectors, pending sectors, uncorrectable errors, UDMA CRC errors and total bytes written. Cheap USB bridges hide all of them, so you cannot see a drive dying until it is dead.

The configuration I actually run

  • System disk: a small TLC SATA SSD with a DRAM cache, 240–512 GB. OS, container images, databases. Nothing else.
  • Data disk: a mechanical drive, CMR not SMR, btrfs or ext4. Photos, media, documents, backups.
  • The SSD never holds cold data. A drive that is only read from does not need to be fast, and a platter gives far more capacity per unit of money and per unit of risk.
  • Check for SMR before buying a big 2.5" drive. Many high-capacity portable drives are shingled and fall out of an array during a rebuild — exactly when you cannot afford it.

Unglamorous, and it is what both boxes do. The SSD absorbs everything random and small; the platter absorbs everything sequential and large.

Three commands before you trust a drive

# 1. sequential read, bypassing the page cache
sudo hdparm -t --direct /dev/sdX

# 2. the SMART attributes that matter
sudo smartctl -A -d sat /dev/sdX

# 3. 4K random read - the closest thing to a real NAS workload
sudo fio --name=r4k --rw=randread --bs=4k --iodepth=32 --size=1G --runtime=30 --filename=/dev/sdX
Enter fullscreen mode Exit fullscreen mode

I have run the first two on my own drives. I have not run the third on the drive that is in production, so I am not going to invent a number for it — the command is the honest part of that section.

What matters in the SMART table:

  • 5 Reallocated_Sector_Ct — anything above zero, stop putting new data on it.
  • 187 Reported_Uncorrect and 197 Current_Pending_Sector — same rule.
  • 198 Offline_Uncorrectable — same rule.
  • 199 UDMA_CRC_Error_Count — climbing means the cable, backplane or bridge, not the NAND. Replace the cheap part first.
  • 241 Total_LBAs_Written — a sanity check on how much life has actually been used.

The cheapest reliability upgrade is not an SSD

The larger box died three times in ten days. The drive was not the cause. The kernel is configured not to reboot on a panic, and the hardware watchdog is disabled, so when the machine hangs it hangs forever instead of recovering.

The third time, the smart plug it is plugged into reported 40 W. Idle is 20 W. Power was still flowing — the machine had not lost power, it had stopped responding, and I cut the plug to restart it from another room.

Every one of those events was an unclean shutdown in the middle of writes to an SSD that has no power-loss protection and never will. So the arithmetic is simple: a cheap drive plus a UPS is more reliable than an expensive drive without one. If your budget covers only one, buy the UPS.

If you cannot buy a UPS, at least do this: enable "Restore on AC Power Loss" in the BIOS, and put the box on a plug you can switch remotely. A laptop used as a NAS has this built in — mine has a 43 Wh battery that turns a power cut into a non-event.

What I would not buy

  • No-name drives with no TBW and no SMART. You cannot monitor what you cannot see.
  • QLC marketed on cache speed. The benchmark is real; the workload that follows it is not the one they tested.
  • Used enterprise drives with 50,000 power-on hours. The remaining life is unknowable and the seller knows it.
  • A USB enclosure as permanent storage. Controllers drop off the bus, and a btrfs array that loses a device mid-write is a bad afternoon.
  • An M.2 drive with no airflow in a case designed for platters.

Numbers above were measured on the two machines described at the top; anything from a vendor spec sheet is labelled as such. Original, with the full method and the failing-drive history: lowspechq.com. That page carries one clearly labelled affiliate link to an SSD listing; nothing here is sponsored, and no seller saw this text before you did.

Top comments (0)