SMART Monitoring for External SSDs & HDDs

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 smartmontools
General Smartctl Commands
1. List the Disks
Check the connected disks available to run smartctl
.
lsblk
2. Check if a Drive Supports SMART
smartctl -i /dev/sdX
Replace /dev/sdX
with your actual drive (e.g., /dev/sda
).
3. Enable SMART on a Drive
smartctl -s on /dev/sdX
4. Get Detailed SMART Information
smartctl -a /dev/sdX
5. Run SMART Tests (For HDDs)
Short Test (Quick Health Check)
smartctl -t short /dev/sdX
Long Test (Comprehensive Test)
smartctl -t long /dev/sdX
Check Test Results
smartctl -l selftest /dev/sdX
6. View SMART Error Logs
smartctl -l error /dev/sdX
If 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/sdb
If the output looks like:
/dev/sdb: Unknown USB bridge [0x0bda:0x0bda (0x2001)]
Check the USB enclosure chip vendor:
lsusb -v -d 0x0bda:0x0bda
Output:
...
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/sdX
This way, you can check smart and temperature values without any error on internal and external disks successfully.