skip to content
Burak Berk

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:

Terminal window
sudo apt update && sudo apt install smartmontools

General Smartctl Commands

1. List the Disks

Check the connected disks available to run smartctl.

Terminal window
lsblk

2. Check if a Drive Supports SMART

Terminal window
smartctl -i /dev/sdX

Replace /dev/sdX with your actual drive (e.g., /dev/sda).

3. Enable SMART on a Drive

Terminal window
smartctl -s on /dev/sdX

4. Get Detailed SMART Information

Terminal window
smartctl -a /dev/sdX

5. Run SMART Tests (For HDDs)

Short Test (Quick Health Check)

Terminal window
smartctl -t short /dev/sdX

Long Test (Comprehensive Test)

Terminal window
smartctl -t long /dev/sdX

Check Test Results

Terminal window
smartctl -l selftest /dev/sdX

6. Run SMART Tests (For SSDs)

Run a short SMART self-test:

Terminal window
sudo smartctl -t short /dev/nvme1n1

Run a long SMART self-test:

Terminal window
sudo smartctl -t long /dev/nvme1n1

Check the results of the latest self-test:

Terminal window
sudo smartctl -a /dev/nvme1n1

Abort a running self-test:

Terminal window
sudo smartctl -X /dev/nvme1n1

7. View SMART Error Logs

Terminal window
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:

Terminal window
smartctl -i /dev/sdb

If the output looks like:

Terminal window
/dev/sdb: Unknown USB bridge [0x0bda:0x0bda (0x2001)]

Check the USB enclosure chip vendor:

Terminal window
lsusb -v -d 0x0bda:0x0bda

Output:

Terminal window
...
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:

Terminal window
smartctl -i -d sntrealtek /dev/sdX

This way, you can check smart and temperature values without any error on internal and external disks successfully.