smartctl Command in Linux: Check Disk Health with SMART

Disks rarely die without warning. Long before a drive stops responding, it usually accumulates reallocated sectors, read errors, or climbing temperatures, and the drive itself keeps count through SMART (Self-Monitoring, Analysis and Reporting Technology). The smartctl command reads those counters, so the question “is this disk failing?” gets an answer based on the drive’s own bookkeeping instead of guesswork.
This guide explains how to use smartctl to check drive health, read the attributes that actually predict failure, run self-tests, and keep an eye on NVMe wear.
smartctl Syntax
The basic syntax is:
smartctl [OPTIONS] DEVICEDEVICE is normally a whole disk such as /dev/sda, /dev/sdb, or /dev/nvme0, not a mounted directory. Most checks need root because smartctl sends commands directly to the drive. If you are not sure which device names your disks have, run lsblk first.
Installing smartctl
smartctl is part of the smartmontools package.
On Ubuntu, Debian, and Derivatives:
sudo apt install smartmontoolsOn Fedora, RHEL, and Derivatives:
sudo dnf install smartmontoolsAfter installation, run smartctl with sudo unless your distribution has granted your user direct access to storage devices.
Checking Whether a Drive Supports SMART
Start with the identity summary:
sudo smartctl -i /dev/sdaModel Family: Samsung based SSDs
Device Model: Samsung SSD 870 EVO 1TB
Serial Number: S6PTNM0T812345A
Firmware Version: SVT02B6Q
User Capacity: 1,000,204,886,016 bytes [1.00 TB]
SMART support is: Available - device has SMART capability.
SMART support is: EnabledBesides confirming SMART support, this output gives you the model and serial number, which you will want when matching a physical drive to a device name or claiming a warranty. In the rare case SMART is available but disabled, enable it with sudo smartctl -s on /dev/sda.
Checking Overall Health
The quickest check is the drive’s own verdict:
sudo smartctl -H /dev/sdaSMART overall-health self-assessment test result: PASSEDA FAILED result means the drive predicts its own failure within 24 hours and warranty replacement is justified; back up immediately.
PASSED as “healthy”. The overall verdict flips only when an attribute crosses the manufacturer’s failure threshold, and drives regularly corrupt data while still technically passing. The attributes in the next section tell the real story, and no SMART output replaces working backups.Reading SMART Attributes
The attribute table is where failure announces itself early:
sudo smartctl -A /dev/sdaID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
5 Reallocated_Sector_Ct 0x0033 100 100 010 Pre-fail Always - 0
9 Power_On_Hours 0x0032 097 097 000 Old_age Always - 11284
12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 413
177 Wear_Leveling_Count 0x0013 099 099 000 Pre-fail Always - 8
187 Reported_Uncorrect 0x0032 100 100 000 Old_age Always - 0
194 Temperature_Celsius 0x0022 067 052 000 Old_age Always - 33
197 Current_Pending_Sector 0x0032 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0030 100 100 000 Old_age Offline - 0Two number systems live in this table. VALUE is a normalized score where higher is better; the drive flags failure when it drops to THRESH. RAW_VALUE is the actual count, and for the attributes that matter, the raw count is what you read.
Four attributes predict failure well, and their healthy raw value is zero:
Reallocated_Sector_Ct(5) - Sectors the drive has retired and remapped to spares. A handful may stay stable for years, but a count that grows between checks is the classic sign of a dying disk.Reported_Uncorrect(187) - Errors the drive could not correct internally. Any nonzero value correlates strongly with failure.Current_Pending_Sector(197) - Sectors the drive could not read and is waiting to remap. Pending sectors mean data in those spots is already at risk.Offline_Uncorrectable(198) - Confirmed unreadable sectors found during offline scanning.
Note the raw values now, check again in a week, and treat growth in any of these four as your cue to replace the drive. Temperature (194) is worth a glance too: sustained operation above roughly 50°C shortens drive life, and a spike often points at a failed case fan.
Running Self-Tests
Attributes are passive bookkeeping; self-tests actively exercise the drive. The test runs inside the drive’s firmware, so you can keep using the system while it works. Start with the short test, which takes a couple of minutes:
sudo smartctl -t short /dev/sda=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Testing has begun.
Please wait 2 minutes for test to complete.The long test (-t long) reads the entire surface and takes from under an hour on an SSD to many hours on a large hard drive; it is the right choice when a short test passes but you still suspect the drive. Check the results once the wait time has passed:
sudo smartctl -l selftest /dev/sdaNum Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
# 1 Short offline Completed without error 00% 11284 -
# 2 Extended offline Completed without error 00% 10102 -A failed entry lists the LBA of the first error, which is the drive telling you exactly where it can no longer read. At that point the useful response is replacement, not repair; filesystem-level checks like fsck
fix filesystem structures, not failing hardware underneath them.
Checking NVMe Drives
NVMe drives report health through a different log format, and smartctl -a presents the main fields directly:
sudo smartctl -a /dev/nvme0=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Critical Warning: 0x00
Temperature: 41 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 3%
Data Units Written: 18,536,442 [9.49 TB]
Media and Data Integrity Errors: 0
Error Information Log Entries: 0Three fields carry the signal. Percentage Used is the drive’s own wear estimate against its rated endurance, so 3% after a year of use projects decades of life, while a value racing toward 100% on a young drive means the workload is chewing through it. Available Spare falling toward its threshold plays the role reallocated sectors play on SATA drives. Media and Data Integrity Errors should be zero, full stop.
Checking Drives in USB Enclosures
USB adapters often hide the drive behind a bridge chip, and smartctl reports Unknown USB bridge instead of SMART data. Most bridges pass SMART through when asked explicitly:
sudo smartctl -a -d sat /dev/sdbThe -d sat option tells smartctl to tunnel ATA commands through the bridge. If that fails, -d sntasmedia or -d sntjmicron handle common NVMe-to-USB chips, and some cheap enclosures simply do not pass SMART at all.
Continuous Monitoring with smartd
The smartmontools package also ships smartd, a daemon that polls your drives and warns you instead of waiting for you to remember. A single line in /etc/smartd.conf covers all drives:
DEVICESCAN -a -o on -S on -s (S/../.././02|L/../../6/03) -m root -M exec /usr/share/smartmontools/smartd-runnerThis monitors all detected devices, runs a short self-test daily at 02:00 and a long test on Saturdays at 03:00, and reports problems to root’s mail. Enable it with:
sudo systemctl enable --now smartdDistribution packages ship a commented default config that is close to this already, so often you only need to enable the service.
Troubleshooting
Permission denied or operation not permitted
Run the command with sudo. smartctl needs direct device access, and an unprivileged shell usually cannot send SMART commands to a disk.
SMART support is disabled
If smartctl -i says SMART is available but disabled, turn it on with sudo smartctl -s on /dev/sda, replacing /dev/sda with the correct device.
Unknown USB bridge
Try the SAT passthrough driver with sudo smartctl -a -d sat /dev/sdb. If that fails on an NVMe-to-USB enclosure, try -d sntasmedia or -d sntjmicron. Some adapters do not expose SMART data at all.
No such device or wrong disk shown
Confirm the device path with lsblk before running smartctl. SATA disks usually appear as /dev/sdX, while NVMe drives usually appear as /dev/nvme0 or /dev/nvme0n1.
Quick Reference
| Task | Command |
|---|---|
| Identify drive and SMART support | sudo smartctl -i /dev/sda |
| Overall pass/fail verdict | sudo smartctl -H /dev/sda |
| Attribute table | sudo smartctl -A /dev/sda |
| Full ATA disk report | sudo smartctl -x /dev/sda |
| NVMe health | sudo smartctl -a /dev/nvme0 |
| Start a short self-test | sudo smartctl -t short /dev/sda |
| Start a full-surface test | sudo smartctl -t long /dev/sda |
| View self-test results | sudo smartctl -l selftest /dev/sda |
| Drive behind a USB adapter | sudo smartctl -a -d sat /dev/sdb |
Conclusion
A monthly smartctl -A glance at reallocated, pending, and uncorrectable counts, or smartd doing the same automatically, converts most disk failures from surprises into scheduled replacements. When the numbers start moving, copy the data off first and experiment second; a drive that is reallocating sectors owes you nothing. For checking the filesystems that live on top of healthy drives, see our guide on the fsck command
.
Tags
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author page