LinuxCommandLibrary

smartctl

TLDR

Show drive information

$ smartctl -i /dev/[sda]
copy
Show all SMART data
$ smartctl -a /dev/[sda]
copy
Check drive health
$ smartctl -H /dev/[sda]
copy
Run short self-test
$ smartctl -t short /dev/[sda]
copy
Run extended self-test
$ smartctl -t long /dev/[sda]
copy
View self-test results
$ smartctl -l selftest /dev/[sda]
copy
View error log
$ smartctl -l error /dev/[sda]
copy
Enable SMART on drive
$ smartctl -s on /dev/[sda]
copy
Scan for drives
$ smartctl --scan
copy

SYNOPSIS

smartctl [options] device

DESCRIPTION

smartctl is a command-line tool for monitoring and controlling SMART (Self-Monitoring, Analysis and Reporting Technology) data on hard drives and SSDs. SMART data can predict drive failures before they occur.
The tool can display drive identity, health status, attributes, error logs, and self-test results. It can also initiate self-tests and control SMART features. Different manufacturers implement SMART differently, so attribute interpretation varies.
smartctl is part of smartmontools and is essential for system administrators monitoring disk health and planning replacements before failure.

PARAMETERS

-i, --info

Show device identification.
-a, --all
Show all SMART information.
-H, --health
Show SMART health status.
-A, --attributes
Show SMART attributes.
-l type, --log= type
Show log (error, selftest, selective).
-t test, --test= test
Run test (short, long, conveyance, select).
-s on|off
Enable/disable SMART.
-d type
Specify device type.
--scan
Scan for devices.
-x, --xall
Show all extended information.
-q type
Quiet output (errorsonly, silent).

KEY ATTRIBUTES

Reallocated Sector Count: Bad sectors moved to spare area
Current Pending Sector Count: Sectors waiting to be remapped
Offline Uncorrectable: Sectors that couldn't be corrected
Power-On Hours: Total operating time
Temperature: Drive temperature

CAVEATS

Requires root privileges for most operations. SMART must be supported and enabled on the drive. Attribute interpretation varies by manufacturer. Self-tests may affect performance while running.

HISTORY

smartmontools was created by Bruce Allen in 2002 as a fork of the smartsuite package. It provides cross-platform SMART monitoring on Linux, BSD, macOS, and Windows. The project continues active development and is the standard SMART monitoring tool on Unix-like systems.

SEE ALSO

smartd(8), hdparm(1), nvme(1), lsblk(1)

> TERMINAL_GEAR

Curated for the Linux community

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

nuphy Air75 V2 Portable 75% Mechanical Keyboard,Wireless Keyboard

$129.95
GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

GMKtec Gaming PC, K11 AMD Ryzen 9 8945HS, 32GB DDR5 RAM 1TB Mini PC Desktop Computer, Oculink, Dual NIC 2.5GbE LAN, HDMI/DisplayPort/USB4*2

$739.99
KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

KIWITATA 2X Classic SNES USB Controller for PC Gamings, Retro SNES Wired USB Game Emulator Controller for Windows XP 7 8 11 Mac Raspberry Pi

$16.99
New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

New Raspberry Pi 3 Model B+ Board Raspberry PI 3B+

$54.00
Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

Lenovo Gen 13 ThinkPad X1 Carbon Touchscreen Laptop with Intel Ultra 7 265U Processor, 14" WUXGA 100% sRGB, 32GB DDR5 RAM, 1TB NVMe Performance SSD, FHD+ IR+ RGB Camera, and Windows 11 Pro

$1,589.00