November 10, 2025
Debian - Disk Drive Monitoring
Checking devices health with S.M.A.R.T. Monitoring Tools
List the devices on the machine
Use with one of these two commands:
lsblk
sudo fdisk -l
Install S.M.A.R.T. Monitoring Tools
sudo apt install smartmontools
smartctl arguments
-i, --info
Prints device info. If SMART is supported on it, should print the following:
SMART support is: Available - device has SMART capability.
SMART support is: Enabled
Usage:
sudo smartctl -i /dev/sdX | grep support
-d TYPE, --device=TYPE
It could be possible that smartctl could not detect the device type automatically. In that case run -d to specify device type.
With "-d test", smartctl will try to detect the correct device type.
Otherwise, sat is needed for most USB enclosures.
You will need to combine -d with the rest of the options if smartctl fails to detect the device type automatically.
Usage:
sudo smartctl -a -d sat /dev/sdX
-s VALUE, --smart=VALUE
If SMART is supported but disabled, enable. The valid arguments to this option are on and off.
Usage:
sudo smartctl -s on /dev/sdX
-H, --health
Run an overall-health test. If the test is passed, should print the following at the end ouf output:
=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED
Usage:
sudo smartctl -H /dev/sdX
-A, --attributes
Prints vendor Specific SMART Attribute values.
The column RAW_VALUE prints the actual value, and the column VALUE prints the normalized value.
For instance, the attribute 12 (Power_Cycle_Count) would be the actual number of times that the disk has been power-cycled, example: 365 times if the disk has been turned on once per day for exactly one year.
The critcal attributes to watch are:
- Reallocated_Sector_Ct
- Current_Pending_Sector
- Offline_Uncorrectable
Usage:
sudo smartctl -A /dev/sdX | egrep "Reallocated_Sector_Ct|Current_Pending_Sector|Offline_Uncorrectable|UDMA_CRC_Error_Count|Power_On_Hours|Temperature_Celsius"
-t TEST, --test=TEST
Runs a background self-test, it can be short or long. The short test may take a few minutes, while the long test is more specific but may take hours.
Once the test is completed, run -A again to check the status.
-t will show the estimated time of completion as well.
Usage:
sudo smartctl -t long /dev/sdX
Conclusion
Monitor your drives health one in a while. Do a general test with --health, analyze the output of --attributes and try to run a long test on the drives with --test.