SMART Monitoring for External SSDs & HDDs
/ 2 min read
Updated:Table of Contents
Overview
Smartmontools is a package that provides utilities (smartctl and
smartd) to monitor and manage the health of storage devices using
S.M.A.R.T. (Self-Monitoring, Analysis, and Reporting Technology). It
supports ATA/SATA, NVMe, and USB-connected drives through different
interfaces.
Installing Smartmontools
Linux (Debian/Ubuntu)
To install it on Debian, simply run:
sudo apt update && sudo apt install smartmontoolsGeneral Smartctl Commands
1. List the Disks
Check the connected disks available to run smartctl.
lsblk2. Check if a Drive Supports SMART
smartctl -i /dev/sdXReplace /dev/sdX with your actual drive (e.g., /dev/sda).
3. Enable SMART on a Drive
smartctl -s on /dev/sdX4. Get Detailed SMART Information
smartctl -a /dev/sdX5. Run SMART Tests (For HDDs)
Short Test (Quick Health Check)
smartctl -t short /dev/sdXLong Test (Comprehensive Test)
smartctl -t long /dev/sdXCheck Test Results
smartctl -l selftest /dev/sdX6. Run SMART Tests (For SSDs)
Run a short SMART self-test:
sudo smartctl -t short /dev/nvme1n1Run a long SMART self-test:
sudo smartctl -t long /dev/nvme1n1Check the results of the latest self-test:
sudo smartctl -a /dev/nvme1n1Abort a running self-test:
sudo smartctl -X /dev/nvme1n17. View SMART Error Logs
smartctl -l error /dev/sdXIf you use USB enclosure
In my case, I was using an external NVME ssd enclosure and the
smartctl couldn’t detect the smart values. This is the case that I
write the blog for.
Try to run smartctl:
smartctl -i /dev/sdbIf the output looks like:
/dev/sdb: Unknown USB bridge [0x0bda:0x0bda (0x2001)]Check the USB enclosure chip vendor:
lsusb -v -d 0x0bda:0x0bdaOutput:
...Bus 003 Device 002: ID 0bda:0bda Realtek Semiconductor Corp. RTL9210B...Check the vendor from official documentation: https://www.smartmontools.org/wiki/USB
For my example, the USB enclosure chip vendor is Realtek and I need to
ad -d sntrealtek on all the commands above.
For example:
smartctl -i -d sntrealtek /dev/sdXThis way, you can check smart and temperature values without any error on internal and external disks successfully.