How to Check Disk Health on Linux with smartctl

12 min read - May 18, 2026

hero section cover
Table of contents
  • How to Check Disk Health on Linux with smartctl
  • Installing smartmontools
  • Identifying Drives and Enabling SMART
  • Running Health Checks and Self-Tests
  • Key SMART Attributes to Watch
  • Automating Monitoring with smartd
Share

Use smartctl and smartd to monitor drive health, run SMART tests, and set up automated alerts on Linux servers. Tags: smartctl, smartmontools, SMART, disk health, Linux, server monitoring, smartd, NVMe, SSD, HDD.

How to Check Disk Health on Linux with smartctl

smartctl is a command-line tool for monitoring storage drive health on Linux. It reads S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology) data from HDDs, SSDs, and NVMe drives, tracking metrics like reallocated sectors, temperature, and error counts. If a drive is heading toward failure, smartctl gives you warning signs before you lose data. This guide covers installation, running health checks and self-tests, understanding the key SMART attributes, and setting up automated monitoring with smartd.


Installing smartmontools

smartctl is part of the smartmontools package. You need root or sudo privileges to install it and to run most smartctl commands, since they require direct hardware access.

DistributionCommand
Debian / Ubuntu / Linux Mintsudo apt update && sudo apt install smartmontools -y
CentOS / RHEL / Rocky / Alma (8+)sudo dnf install smartmontools -y
CentOS / RHEL 7 and oldersudo yum install smartmontools -y
Arch Linux / Manjarosudo pacman -S smartmontools
Fedorasudo dnf install smartmontools

Confirm the installation with smartctl --version.

Identifying Drives and Enabling SMART

Before you can check anything, you need to know which drives are in your server and whether they support SMART.

List all block devices:

lsblk

Scan for SMART-compatible drives:

sudo smartctl --scan

This returns device names, types, and protocols (ATA, SCSI, NVMe). SATA and SAS drives show up as /dev/sda, /dev/sdb, etc. NVMe drives appear as /dev/nvme0n1, /dev/nvme1n1.

Check whether SMART is available and enabled on a specific drive:

sudo smartctl -i /dev/sda

Look for "SMART support is: Available" and "SMART support is: Enabled" in the output. If it's available but not enabled, turn it on:

sudo smartctl -s on /dev/sda

This setting persists across reboots.

For drives behind RAID controllers, use the -d flag to specify the controller type. For MegaRAID: -d megaraid,N. For HP Smart Array: -d cciss,N. Without this flag, smartctl won't see the individual physical drives.

SMART monitoring is not available for virtual disks in VPS environments or most USB flash drives. The virtualisation layer or USB enclosure blocks access to hardware telemetry.

Running Health Checks and Self-Tests

A quick health check queries the drive's firmware for critical failures:

sudo smartctl -H /dev/sda

A PASSED result means the drive hasn't tripped its internal failure threshold. A FAILED result means the drive expects to fail imminently. Back up your data immediately.

For full SMART data, including all attributes and error logs:

sudo smartctl -a /dev/sda

Self-tests

smartctl can run three types of self-test, all in the background while the system stays operational:

  • Short test (1-5 minutes): checks electrical and mechanical components. sudo smartctl -t short /dev/sda
  • Long test (hours): scans every sector on the drive. sudo smartctl -t long /dev/sda
  • Conveyance test (~5 minutes): detects physical damage from shipping. sudo smartctl -t conveyance /dev/sda

Check estimated completion time before starting a long test:

sudo smartctl -c /dev/sda

View test results:

sudo smartctl -l selftest /dev/sda

You want to see "Completed without error." If a test fails, the output includes LBA_of_first_error, which pinpoints where on the disk the damage is.

Key SMART Attributes to Watch

The pass/fail health check is useful but limited. A drive can report PASSED while individual attributes are trending badly. These are the ones that matter most:

  • Reallocated Sector Count (ID 5): Bad sectors the drive has swapped out for spare ones. Any non-zero value means physical wear. A single reallocated sector on an old drive isn't necessarily urgent, but a rising count is a clear warning.
  • Current Pending Sector Count (ID 197): Sectors the drive couldn't read or write, waiting to be remapped. If this count keeps climbing, the drive is deteriorating.
  • Offline Uncorrectable (ID 198): Uncorrectable errors found during background scans. Indicates surface damage.
  • UDMA CRC Error Count (ID 199): Data transfer errors. This usually points to a faulty SATA cable or loose connector, not a failing drive. Check your cables first.

For SSDs and NVMe drives, watch Available Spare and Percentage Used instead. When Percentage Used approaches 100%, the drive has reached its write endurance limit.

Temperature matters too. HDDs become unreliable above 50°C. SSDs can tolerate more heat but should stay below 70°C. View all vendor-specific attributes with smartctl -A /dev/sda, or check recent command failures with smartctl -l error /dev/sda.

Automating Monitoring with smartd

Checking drives manually is fine for one-off diagnostics. For ongoing monitoring, use smartd, the daemon included with smartmontools. It polls your drives every 30 minutes by default and logs attribute changes to syslog.

Edit the configuration file at /etc/smartd.conf (or /etc/smartmontools/smartd.conf on RHEL/CentOS). Rather than relying on DEVICESCAN to auto-detect everything, list your drives explicitly. This avoids hangs from incompatible devices.

Example configuration:

/dev/sda -a -m admin@example.com -s (S/../.././02|L/../../6/03) -W 4,45,55
/dev/sdb -a -m admin@example.com -n standby,q

What the flags do:

  • -a: monitor all SMART attributes
  • -m: send email alerts on failure
  • -s: schedule a short test daily at 2:00 AM and a long test every Saturday at 3:00 AM
  • -W 4,45,55: log a 4°C temperature shift, warn at 45°C, critical alert at 55°C
  • -n standby,q: skip polling drives in standby mode to avoid unnecessary spin-ups

For drives behind RAID controllers, specify the type per drive:

/dev/sda -d megaraid,0 -a -m admin@example.com
/dev/sda -d megaraid,1 -a -m admin@example.com

Enable and start the service:

sudo systemctl enable --now smartd

On Debian-based systems, also uncomment start_smartd=yes in /etc/default/smartmontools.

To test email alerts, add -M test to a config line, restart smartd, then remove it. Reload config changes without restarting the service with killall -HUP smartd.

A short daily test takes 1-2 minutes and catches most surface-level defects. A weekly long test covers every sector. Combined with email alerts, this gives you reliable early warning before a drive fails completely.

background image
Is your server holding back your growth?

Tired of slow deployments or bandwidth limits? FDC Servers offers instant dedicated power, global reach, and flexible plans built for any scale.

Upgrade now

Blog

Featured this week

More articles
Zombie Processes in Linux: Find, Remove, Prevent

Zombie Processes in Linux: Find, Remove, Prevent

Learn how to identify, remove, and prevent zombie processes in Linux. Commands, code fixes, and monitoring tips for server admins.

15 min read - May 19, 2026

#dedicated-servers#vps

Linux Server Hardening Checklist

15 min read - May 8, 2026

More articles
background image

Have questions or need a custom solution?

icon

Flexible options

icon

Global reach

icon

Instant deployment

icon

Flexible options

icon

Global reach

icon

Instant deployment