← 返回命令列表

Linux command

smartctl 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Show drive information

smartctl -i /dev/[sda]

Show all SMART data

smartctl -a /dev/[sda]

Check drive health

smartctl -H /dev/[sda]

Run short self-test

smartctl -t short /dev/[sda]

Run extended self-test

smartctl -t long /dev/[sda]

View self-test results

smartctl -l selftest /dev/[sda]

View error log

smartctl -l error /dev/[sda]

Enable SMART

smartctl -s on /dev/[sda]

Scan for drives

smartctl --scan

说明

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.

参数

-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, selective, offline).
-s _on|off_
Enable/disable SMART.
-d _type_
Specify device type.
--scan
Scan for devices.
-x, --xall
Show all extended information (all SMART and non-SMART data).
-c, --capabilities
Show SMART capabilities of the device.
-C, --captive
Run self-tests in captive mode (blocks device until finished).
-X, --abort
Abort an in-progress self-test.
-n _POWERMODE_, --nocheck= _POWERMODE_
Skip check if device is in a low-power mode (standby, sleep, idle, never).
-q _type_, --quietmode= _type_
Quiet output (errorsonly, silent, noserial).

FAQ

What is the smartctl command used for?

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.

How do I run a basic smartctl example?

Run `smartctl -i /dev/[sda]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -i, --info do in smartctl?

Show device identification.