SMART Monitoring for External SSDs & HDDs
/ 2 min read
Table of Contents
Overview
Smartmontools provides 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 device type drivers.
Installing Smartmontools
Debian and Ubuntu
Install smartmontools via APT:
sudo apt update && sudo apt install smartmontoolsGeneral Smartctl Commands
1. List the Disks
List attached block devices before querying smartctl:
lsblk2. Check SMART Support
smartctl -i /dev/sdXReplace /dev/sdX with the target drive device node (for example, /dev/sda).
3. Enable SMART on a Drive
smartctl -s on /dev/sdX4. Inspect Full SMART Attributes
smartctl -a /dev/sdX5. Run SMART Self-Tests on HDDs
Short Test (Quick Health Check)
smartctl -t short /dev/sdXLong Test (Comprehensive Surface Scan)
smartctl -t long /dev/sdXView Self-Test Logs
smartctl -l selftest /dev/sdX6. Run SMART Self-Tests on NVMe SSDs
Start a short self-test:
sudo smartctl -t short /dev/nvme1n1Start an extended self-test:
sudo smartctl -t long /dev/nvme1n1Inspect the latest self-test output and health attributes:
sudo smartctl -a /dev/nvme1n1Abort an active self-test:
sudo smartctl -X /dev/nvme1n17. View SMART Error Logs
smartctl -l error /dev/sdXHandling Unknown USB Enclosures
When I connected an external NVMe SSD inside a USB enclosure to my server, smartctl failed to read any health telemetry on its own. Running a basic device info query produced:
smartctl -i /dev/sdb/dev/sdb: Unknown USB bridge [0x0bda:0x0bda (0x2001)]I checked the USB enclosure bridge vendor and device ID with lsusb:
lsusb -v -d 0x0bda:0x0bda...Bus 003 Device 002: ID 0bda:0bda Realtek Semiconductor Corp. RTL9210B...Cross-referencing the smartmontools USB device table confirmed that the Realtek RTL9210B bridge requires the -d sntrealtek driver flag:
smartctl -i -d sntrealtek /dev/sdXWith -d sntrealtek passed explicitly, both health attributes and temperature readings report cleanly across external USB enclosures. For automating this inside a hypervisor daemon so smartd stops flagging false UNKNOWN status emails, see my follow-up notes on fixing unknown SMART status on Proxmox VE.