How to recognise a bad drive in Linux
Quick answer
Check a drive's health with two tools: hdparm to benchmark read speed against the expected range for that drive type, and smartmontools (smartctl) to read its SMART attributes. Consistently low speeds or failing SMART values point to a drive that needs a closer look. NVMe drives use their own commands, covered at the end.
The commands in the first four sections cover SATA drives, both spinning disks and SSDs. You compare read speed against the typical range for that drive type, then inspect the drive's SMART attributes. NVMe drives report health differently and need their own commands, covered in the last section. Use the results to decide whether a disk needs assessing.
Identify your drives
Use the lsblk command to list the drives in your system:
lsblkDepending on your disk layout, this shows the available drives, for example sda, sdb, sdc and sdd.
Test disk speed
Benchmark disk speed with hdparm. Install it first:
# Ubuntu / Debian
apt-get install -y hdparm
# AlmaLinux / Rocky Linux
yum install -y hdparmhdparm is Linux-only, it relies on Linux-specific ATA/SCSI ioctls and isn't packaged for FreeBSD. On FreeBSD, use camcontrol or diskinfo instead for the equivalent checks.
Then run hdparm against the drive you want to test, for example:
hdparm -t /dev/sdaFor more reliable results:
- Run the test on an inactive system, ideally after a reboot, so a minimal amount of system resources are in use.
- Run the command two or three times and take the average of the results.
| Type | Typical minimum | Typical maximum |
|---|---|---|
| HDD | 150 MB/sec | 250 MB/sec |
| SATA SSD | 400 MB/sec | 500 MB/sec |
| Enterprise SSD | 500 MB/sec | 550 MB/sec |
These are generic, industry-typical ranges for the drive class, not Worldstream-specific benchmarks. They apply to SATA drives only, see NVMe drives for why hdparm figures mean nothing on NVMe.
Actual speeds vary with your specific configuration. Contact support to check whether the speed you're seeing is normal for your setup, and include the test output when you do.
Check disk status (SMART)
Use smartmontools to read a drive's S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) data. Install it first:
# Ubuntu / Debian
apt-get install -y smartmontools
# AlmaLinux / Rocky Linux
yum install -y smartmontools
# FreeBSD
pkg install -y smartmontoolsThe examples below use /dev/sdb; replace this with the drive you're checking.
Check basic drive information
smartctl -i /dev/sdbEnable SMART support if it's disabled
smartctl -s on /dev/sdbRun a short self-test
smartctl -t short /dev/sdbThis takes about one to two minutes to complete.
Read the self-test result
smartctl -l selftest /dev/sdbCheck the SMART attributes
smartctl -A /dev/sdbFocus on the values below:
| Attribute | Description | Expected value |
|---|---|---|
| SMART overall-health | The drive's general health according to the manufacturer's own standard. | PASSED |
| Reallocated_Sector_Ct | Number of sectors already reallocated on the disk. | 0 |
| Current_Pending_Sector | Number of sectors awaiting reallocation. | 0 |
| Reported_Uncorrect | Number of uncorrectable errors reported to the disk's SMART controller. | 0 |
Any value above 0 on the three counters warrants investigation, even a single one: it means the drive returned or nearly returned data it could not correct. If any of these values is outside the expected range, open a support ticket with the smartctl output so the disk can be assessed.
Check for ATA errors
SMART attributes don't cover ATA-level errors. Check the kernel log for those instead:
dmesg | grep -i ataNVMe drives
NVMe drives need different commands throughout. They are not ATA devices, so lsblk lists them as nvme0n1 rather than sda, and the SMART attributes above (Reallocated_Sector_Ct, Current_Pending_Sector, Reported_Uncorrect) do not exist on them.
hdparm -t also understates NVMe badly. It measures buffered sequential reads one request at a time, which is nowhere near what an NVMe drive delivers in parallel, so a healthy drive will look like it fails. Treat any hdparm figure on NVMe as a comparison against that same drive's earlier results, never as a pass or fail. For a real throughput measurement, use fio with several jobs and a queue depth above 1.
Read NVMe health from the controller device:
smartctl -a /dev/nvme0| Field | Description | Expected value |
|---|---|---|
| Critical Warning | Controller-level warning flags, for example read-only mode or overheating. | 0x00 |
| Available Spare | Remaining spare capacity, as a percentage. | Well above the drive's own Available Spare Threshold |
| Percentage Used | Vendor estimate of write endurance consumed. It can exceed 100 without immediate failure, but the drive is past its rated life. | Well below 100 |
| Media and Data Integrity Errors | Unrecovered data integrity errors. | 0 |
Kernel-level NVMe errors show up under a different tag than ATA ones:
dmesg | grep -i nvmeAs with SATA drives, open a support ticket with the smartctl output if anything looks wrong.