Linux and hardware

How to check an HDD temperature on Debian

The short version

For a SATA or USB HDD, start with smartctl. First check which device is the disk you want. /dev/sda can change after a reboot or after reconnecting a USB disk.

1. Identify the disk

lsblk -o NAME,MODEL,SERIAL,SIZE,TRAN,MOUNTPOINTS

Do not assume that /dev/sda is always the same disk. Check the model, size, and mount point.

2. Read the temperature from SMART

sudo smartctl -A /dev/sda | grep -i temperature

If the disk is inside a USB enclosure and the command cannot see SMART, try:

sudo smartctl -d sat -A /dev/sda

Some USB adapters do not pass all SMART commands. No output does not always mean that the disk is bad.

3. Check the overall health too

sudo smartctl -H /dev/sda
sudo smartctl -a /dev/sda

Look especially at reallocated sectors, uncorrectable sectors, and communication errors. Read the temperature together with these values and the room temperature.

Common mistakes

  • running the commands on the wrong disk;
  • confusing the enclosure temperature with the HDD temperature;
  • treating one temperature reading as proof that the disk is bad;
  • ignoring strange noises, USB disconnects, or journal errors.

Sources