Linux drives can expose firmware records of wear and read errors through S.M.A.R.T.. smartctl checks a drive's health status, error counters, and self-test results where the hardware exposes them.
Example output:
Most ATA, SATA, SAS, and NVMe devices store health counters, error logs, and self-test history in firmware. A quick --health check reports whether the drive has crossed its own failure threshold, while --xall exposes counters such as reallocated sectors, pending sectors, media errors, and spare capacity that usually matter before the single health line changes.
USB bridges, hardware RAID controllers, cloud volumes, and guest-visible virtual disks can hide S.M.A.R.T. data. A Raspberry Pi can report SMART health for an attached SATA or NVMe drive when the connection passes it through. Its microSD card, or a Compute Module's eMMC storage, does not expose a standard SMART report through smartctl; an unavailable result proves neither good nor bad health for that storage.
The required smartctl command comes from the smartmontools package, which must already be installed through your distribution's package manager. Reading physical disks usually requires sudo.
Steps to check disk health in Linux:
- List the whole disks. Example output:
$ lsblk -d -o NAME,SIZE,MODEL NAME SIZE MODEL sda 477G Samsung SSD 870 EVO nvme0n1 1.8T Samsung SSD 980
The target is the whole disk, written as /dev/sda or /dev/nvme0n1, not a partition such as /dev/sda1, because S.M.A.R.T. data belongs to the physical disk or controller-visible disk. Any loop entries are not physical disks.
- Read the device identity and health summary. Example output:
$ sudo smartctl --info --health /dev/sda ##### snipped ##### === START OF INFORMATION SECTION === Device Model: Samsung SSD 870 EVO 500GB SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED
PASSED means the drive firmware is not reporting a current threshold failure. It does not rule out growing error counters; the full report can still show a problem.
If smartctl cannot open a SMART-capable disk, sudo smartctl --scan-open prints the device type it needs. That type then belongs in each smartctl command for that disk as --device=TYPE, such as --device=sat for many USB-to-SATA bridges.
- Review the full S.M.A.R.T. report. Example output:
$ sudo smartctl --xall /dev/sda ##### snipped ##### === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED SMART Attributes Data Structure revision number: 16 ID# ATTRIBUTE_NAME FLAGS VALUE WORST THRESH FAIL RAW_VALUE 5 Reallocated_Sector_Ct PO--CK 100 100 010 - 0 194 Temperature_Celsius -O---K 069 058 000 - 31 ##### snipped ##### SMART Error Log Version: 1 No Errors Logged ##### snipped #####
Attribute names and raw-value meanings vary by drive model. Growing Reallocated_Sector_Ct, Current_Pending_Sector, Offline_Uncorrectable, or NVMe Media and Data Integrity Errors, and Available Spare dropping to its threshold, are reasons to preserve data before further testing and plan disk replacement. A PASSED summary does not override those warning signs.
- Start a short self-test when the disk supports it and has no signs of failure.
A short self-test is non-destructive, but it still reads the device in the background and can add latency on a busy disk. If storage latency matters, a maintenance window is appropriate.
Example output:
$ sudo smartctl --test=short /dev/sda ##### snipped ##### === START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION === Sending command: "Execute SMART Short self-test routine immediately in off-line mode". Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful. Testing has begun. Please wait 2 minutes for test to complete. ##### snipped #####
- Confirm that the latest short self-test completed after the reported wait time. Example output:
$ sudo smartctl --log=selftest /dev/sda ##### snipped ##### SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 18423 - ##### snipped #####
Completed without error confirms that the built-in diagnostic finished without recording a failure. If the status shows a read failure or an LBA_of_first_error value, data preservation and replacement take priority.