Check NVMe SSD Temperature in Linux: 3 Easy Proven Ways

There are three reliable ways to read NVMe SSD temperature in Linux, and all of them read the same sensor: smartctl from smartmontools, nvme smart-log from nvme-cli, and the kernel's hwmon sensor, which sensors (lm-sensors) shows without root. This guide runs all three on a Debian 12 KVM virtual machine with an emulated NVMe controller (kernel 6.1, smartmontools 7.3, nvme-cli 2.3, lm-sensors 3.6), shows where the numbers differ, and tests what happens when the drive goes over its temperature threshold.

sudo smartctl -A /dev/nvme0 | grep -i temp           # smartmontools
sudo nvme smart-log /dev/nvme0 | grep -i temperature # nvme-cli
sensors | grep -A2 nvme                              # lm-sensors, no root needed
cat /sys/class/nvme/nvme0/hwmon*/temp1_input         # millidegrees C, no root needed

One note on the lab: the QEMU NVMe controller reports a fixed composite temperature of 50°C, so the numbers below do not change with load. The commands, fields and thresholds are the same on real drives, where the value moves with activity and airflow.

Find the NVMe drive first

$ sudo nvme list
Node                  Generic               SN                   Model                                    Namespace Usage                      Format           FW Rev
--------------------- --------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1          /dev/ng0n1            LABNVME0001          QEMU NVMe Ctrl                           1           2.15  GB /   2.15  GB    512   B +  0 B   9.2.4   

/dev/nvme0 is the controller, /dev/nvme0n1 its first namespace (the "disk" you partition). Temperature belongs to the controller, but both names work with the tools below.

Method 1: check NVMe SSD temperature with smartctl

$ sudo apt install smartmontools
$ sudo smartctl -A /dev/nvme0
=== START OF SMART DATA SECTION ===
SMART/Health Information (NVMe Log 0x02)
Critical Warning:                   0x00
Temperature:                        50 Celsius
Available Spare:                    0%
...
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0

$ sudo smartctl -a /dev/nvme0 | grep -i temp
Warning  Comp. Temp. Threshold:     70 Celsius
Critical Comp. Temp. Threshold:     100 Celsius
Temperature:                        50 Celsius
Warning  Comp. Temperature Time:    0
Critical Comp. Temperature Time:    0

smartctl reports the NVMe SSD temperature in the Temperature line. -A prints the SMART/Health log, -a adds the controller data, including the two thresholds the drive itself defines: warning (70°C here) and critical (100°C). Warning/Critical Comp. Temperature Time count the minutes the drive spent above them; on a real drive, a growing number there means it has been running hot, even if it is cool right now. smartctl -A /dev/nvme0n1 gave the same temperature.

Method 2: nvme smart-log from nvme-cli

$ sudo apt install nvme-cli
$ sudo nvme smart-log /dev/nvme0 | grep -iE 'temperature|critical_warning|Thermal'
critical_warning			: 0
temperature				: 50°C (323 Kelvin)
Warning Temperature Time		: 0
Critical Composite Temperature Time	: 0
Thermal Management T1 Trans Count	: 0
Thermal Management T2 Trans Count	: 0
Thermal Management T1 Total Time	: 0
Thermal Management T2 Total Time	: 0

nvme-cli shows the NVMe SSD temperature with its raw unit too: the drive reports Kelvin. The Thermal Management counters show how often the drive throttled itself to cool down, the best evidence that heat is costing performance. For scripts, use JSON, where the temperature is in Kelvin:

$ sudo nvme smart-log /dev/nvme0 -o json | jq '{temperature, critical_warning, warning_temp_time, critical_comp_time}'
{
  "temperature": 323,
  "critical_warning": 0,
  "warning_temp_time": 0,
  "critical_comp_time": 0
}
$ sudo nvme smart-log /dev/nvme0 -o json | jq '.temperature - 273'
50

Method 3: sensors and hwmon, without root

For a quick NVMe SSD temperature reading without sudo, use hwmon. The kernel NVMe driver registers a hwmon sensor for each controller. lm-sensors picks it up with no configuration, and normal users can read it:

Check NVMe SSD temperature in Linux with sensors and hwmon as a normal user
Real output: the hwmon sensor works without root, smartctl does not.
$ sensors
nvme-pci-0080
Adapter: PCI adapter
Composite:    +49.9°C  (low  = -273.1°C, high = +69.8°C)
                       (crit = +99.8°C)

$ d=$(ls -d /sys/class/nvme/nvme0/hwmon*); for f in name temp1_label temp1_input temp1_max temp1_min temp1_crit temp1_alarm; do printf '%s=' $f; cat $d/$f; done
name=nvme
temp1_label=Composite
temp1_input=49850
temp1_max=69850
temp1_min=-273150
temp1_crit=99850
temp1_alarm=0

Why 49.9 and not 50? hwmon converts the drive's 323 K exactly (323 − 273.15 = 49.85°C, stored as 49850 millidegrees), while smartctl and nvme-cli subtract 273. Both are the same reading. high and crit are the drive's warning and critical thresholds. As a normal user:

$ cat /sys/class/nvme/nvme0/hwmon*/temp1_input
49850
$ sensors | grep -A2 nvme
nvme-pci-0080
Adapter: PCI adapter
Composite:    +49.9°C  (low  = -273.1°C, high = +69.8°C)
$ smartctl -A /dev/nvme0 | tail -2
Smartctl open device: /dev/nvme0 failed: Permission denied

So to show the NVMe SSD temperature in a panel, a status bar or a monitoring agent that should not run as root, read hwmon. Use sensors -j if you want JSON.

What happens above the temperature threshold

To see the alarm path without heating a drive, the over-temperature threshold (NVMe feature 0x04) was lowered from 70°C to 40°C, below the current 50°C:

$ sudo nvme get-feature /dev/nvme0 -f 4 -H
get-feature:0x04 (Temperature Threshold), Current value:0x00000157
	Threshold Type Select         (THSEL): 0 - Over Temperature Threshold
	Threshold Temperature Select (TMPSEL): 0 - Composite Temperature
	Temperature Threshold         (TMPTH): 70°C (343 Kelvin)

$ sudo nvme set-feature /dev/nvme0 -f 4 -v 0x139
set-feature:0x04 (Temperature Threshold), value:0x00000139, cdw12:00000000, save:0

$ sudo nvme smart-log /dev/nvme0 | grep critical_warning
critical_warning			: 0x2
$ sudo smartctl -H /dev/nvme0 | tail -3
SMART overall-health self-assessment test result: FAILED!
- temperature is above or below threshold
$ sensors | grep -i composite
Composite:    +49.9°C  (low  = -273.1°C, high = +39.9°C)  ALARM

All three tools reacted: critical_warning bit 1 (0x2, temperature) was set, smartctl's health check turned to FAILED, and sensors printed ALARM. That is what a really overheating drive looks like, and it is why smartctl -H can fail on a drive that is otherwise healthy.

The threshold value is in Kelvin (0x139 = 313 K = 40°C), and save:0 means it is not persistent. Setting it back to 0x157 (343 K) cleared the warning and smartctl said PASSED again. Do not lower the threshold on a production drive; this was only to test the alerts.

Watch the NVMe SSD temperature in a script

A small NVMe SSD temperature check that uses hwmon (no root) and logs to the journal when a drive reaches a limit:

#!/bin/sh
# warn when any NVMe drive is at or above LIMIT degrees C (default 70)
LIMIT=${1:-70}
for d in /sys/class/nvme/nvme*; do
  t=$(cat "$d"/hwmon*/temp1_input 2>/dev/null) || continue
  c=$((t / 1000))
  echo "$(basename "$d") ${c}C"
  [ "$c" -ge "$LIMIT" ] && logger -t nvme-temp "$(basename "$d") at ${c}C (limit ${LIMIT}C)" && rc=1
done
exit ${rc:-0}
$ nvme-temp-check; echo rc=$?
nvme0 49C
rc=0
$ nvme-temp-check 45; echo rc=$?; journalctl -t nvme-temp --no-pager | tail -1
nvme0 49C
rc=1
Oct 17 02:22:35 bookworm nvme-temp[1922]: nvme0 at 49C (limit 45C)

Integer division turns 49.85 into 49; that is fine for an alert. Run it from cron or a systemd timer.

Errors when you check NVMe SSD temperature

$ sudo smartctl -A /dev/nvme9
Smartctl open device: /dev/nvme9 failed: No such device

$ sudo nvme smart-log /dev/vda
smart log: Inappropriate ioctl for device

$ sudo smartctl -A /dev/vda
/dev/vda: Unable to detect device type
Please specify device type with the -d option.

"Inappropriate ioctl" means the device is not NVMe (here a virtio disk). Virtual disks and many USB enclosures do not pass SMART data through, so no tool can read a temperature from them.

What is a safe NVMe SSD temperature?

There is no single safe NVMe SSD temperature for all drives. Read the limits from your own drive instead of a generic number: smartctl -a shows the warning and critical composite thresholds, and sensors shows the same values as high and crit. Below the warning threshold the drive works normally; above it a drive may start throttling (watch the Thermal Management counters), and the critical threshold is where data and hardware are at risk.

If the warning-time counter keeps growing, improve airflow or add a heatsink, then check the NVMe SSD temperature again under load. See the smartmontools documentation and the kernel hwmon sysfs interface for the field definitions. When a drive overheated after a change on the server, the Linux history command shows what was run before the NVMe SSD temperature went up.

Comments

Popular posts from this blog

How to Play Minecraft Bedrock Edition on Linux: A Comprehensive Guide for Tech Professionals

Linux desktop frozen? My 5 go-to tricks to try - before forcing a hard reboot

The Ultimate Guide: How to Set Up DXVK in Wine on Linux for Enhanced Gaming Performance