Hard Disk Drive

Self-Monitoring, Analysis and Reporting Technology System (S.M.A.R.T.)
Linux uses SmartMonTools to access the SMART information.

smartctl 5.43 2012-06-30 r3573 [x86_64-linux-3.3.8-gentoo] (local build) Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.net

The examples below use /dev/sda as the first internal hard disk drive, and /dev/sdb as the external usb drive.

Device Driver
smartctl --device=test /dev/sda /dev/sda: Device of type 'scsi' [SCSI] detected /dev/sda [SAT]: Device open changed type from 'scsi' to 'sat' /dev/sda [SAT]: Device of type 'sat' [ATA] opened

So, we use the sat driver for this drive.

Information
smartctl --device=sat --all /dev/sda

Health Check
smartctl --device=sat --health /dev/sda

Tests
Self-Test: Short (internal SATA)

smartctl --device=sat --test=short /dev/sda

Self-Test: Long (internal SATA)

smartctl --device=sat --test=long /dev/sda

Self-Test: Short (external USB)

smartctl --device=sat,16 --test=short /dev/sdb

Self-Test: Long (external USB)

smartctl --device=sat,16 --test=long /dev/sdb

Logs
smartctl --device=sat --log=selftest /dev/sda