Knowledgebase

Find frequently asked questions and setup guides by searching or by browsing the categories.

The Short Answer

An SSD is faster in almost every way, and the difference is largest for small reads and writes spread across the disk, which is what databases, mail servers, and busy websites do all day. An HDD is slower but offers large capacity per drive, which keeps it in use for backups and archives. Which one suits a server depends on whether the work is many small requests or a few long streams.

How an HDD Stores Data

Inside a hard drive, one or more platters spin at a fixed speed while an arm moves a read and write head across them. To read a block, the arm must move to the right track (seek time) and wait for the block to rotate under the head (rotational latency). Both are mechanical, so each random request costs milliseconds. Once the head is in place, reading a long run of neighboring blocks is fast, which is why hard drives handle sequential work far better than random work.

How an SSD Stores Data

An SSD keeps data in NAND flash cells, managed by a controller that spreads writes across the chips. There is nothing to move, so a random read costs about the same as a sequential one, and latency is measured in microseconds rather than milliseconds. Flash cannot overwrite a cell in place: the controller writes new data to empty pages and erases old blocks in the background. The TRIM command tells the drive which blocks the file system no longer uses, so it can prepare them in advance.

Side by Side

SSDHDD
StorageFlash chipsSpinning platters
Random accessMuch fasterSlow, mechanical
LatencyMicrosecondsMilliseconds
Sequential speedHigherReasonable
Capacity per driveSmaller at the top endLarger
WearLimited writes per cellMechanical wear
Typical server useSystem, databases, sitesBackups, archives

In numbers of operations per second, a hard drive handles random requests in the hundreds at most, while SSDs reach tens of thousands and more. Real figures depend on the drive, the interface, and the workload. The measure itself is explained in what is IOPS, and the step from SATA SSDs to NVMe in NVMe vs SSD.

Endurance and Failure Modes

  • SSD wear: each flash cell survives a limited number of write cycles. Makers state endurance as TBW (terabytes written) or DWPD (drive writes per day over the warranty period). Server drives are built for heavier write loads than desktop drives.
  • SSD failures: a worn or failing SSD may switch to read-only mode or stop responding with little warning.
  • HDD failures: motors, bearings, and heads wear out. Growing counts of reallocated or pending sectors often warn of trouble ahead.

Neither type replaces a backup. Watch drive health with smartctl and protect against a single failed drive with RAID.

Check Which Kind Your Server Has

lsblk -d -o NAME,ROTA,SIZE,MODEL

The ROTA column is 1 for a rotating disk and 0 for a non-rotating one. On a virtual server, the virtual disk may report a value that does not match the physical drives on the host, so read it as a hint there. On a dedicated server, sudo smartctl -i /dev/sda shows the model and a Rotation Rate line: a speed in rpm for a hard drive, or Solid State Device for an SSD.

Check that TRIM runs on SSDs:

systemctl status fstrim.timer

The timer ships with util-linux and runs fstrim once a week. Whether it is enabled out of the box depends on the distribution, so if it shows as inactive, sudo systemctl enable --now fstrim.timer turns it on.

Where HDDs Still Fit

  • Backup targets: backups are written in long streams and read rarely.
  • Archives and media libraries: large files read from start to end.
  • Cold data: logs and records kept for years but seldom opened.

For the operating system, databases, and anything users wait on, choose SSD storage. To see whether a disk is the bottleneck on a running server, see how to check disk I/O in Linux.

Was this answer helpful?
Loading...