---
title: Temperature Monitoring on Linux
url: https://photostructure.com/server/temperature-monitoring/
description: How to set up hardware temperature monitoring for PhotoStructure on Linux, including lm-sensors, hwmon, thermal zones, and drive temperatures.
date: 2026-02-22
keywords: Linux, Docker, health-checks, settings, Synology
---


PhotoStructure monitors hardware temperatures on Linux and will automatically
pause the sync process when any sensor exceeds the
[`maxTempCelsius`](/getting-started/advanced-settings/) threshold (default:
80&deg;C / 176&deg;F). This prevents hardware damage from sustained high
temperatures during CPU-intensive operations like image hashing and video
transcoding.

PhotoStructure reads temperatures from three sources, and merges the results:

1. **lm-sensors** &mdash; the standard Linux sensor monitoring package
2. **hwmon sysfs** &mdash; direct kernel sensor readings from `/sys/class/hwmon/`
3. **thermal zones** &mdash; ACPI and platform thermal data from `/sys/class/thermal/`

No root access is required for any of these methods.

## lm-sensors

[lm-sensors](https://hwmon.wiki.kernel.org/lm_sensors) is the most
full-featured option. It provides calibrated readings, human-readable sensor
labels, and supports a wide range of hardware.

### Installation

On **Debian/Ubuntu**:

```bash
sudo apt install lm-sensors
sudo sensors-detect
```

On **Fedora/RHEL**:

```bash
sudo dnf install lm_sensors
sudo sensors-detect
```

On **Arch Linux**:

```bash
sudo pacman -S lm_sensors
sudo sensors-detect
```

The [`sensors-detect`](https://linux.die.net/man/8/sensors-detect) command
scans your hardware and configures the appropriate kernel modules. Answer
"yes" to its prompts to load the detected modules.

After setup, verify it's working:

```bash
sensors
```

You should see output listing your CPU, motherboard, and other sensor
temperatures.

### References

- [lm-sensors project wiki](https://hwmon.wiki.kernel.org/lm_sensors)
- [`sensors-detect(8)` man page](https://linux.die.net/man/8/sensors-detect)
- [Arch Wiki: lm_sensors](https://wiki.archlinux.org/title/Lm_sensors)

## hwmon sysfs

The Linux kernel exposes hardware sensor data directly through the
[hwmon sysfs interface](https://www.kernel.org/doc/html/latest/hwmon/sysfs-interface.html)
at `/sys/class/hwmon/`. PhotoStructure reads these files directly, so
temperature monitoring works even without lm-sensors installed.

This is especially useful in **Docker containers** and **minimal Linux
installs** where installing additional packages may not be desirable.

Each sensor chip gets a directory like `/sys/class/hwmon/hwmon0/` containing:

- `name` &mdash; the kernel driver name (e.g., `k10temp`, `nct6798`, `nvme`)
- `temp1_input`, `temp2_input`, &hellip; &mdash; temperatures in millidegrees
  Celsius

PhotoStructure automatically reads all available hwmon sensors. If lm-sensors
is also installed, PhotoStructure deduplicates results so you don't see the
same sensor twice.

### Docker

For Docker containers, you may need to bind-mount the hwmon sysfs directory:

```yaml
volumes:
  - /sys/class/hwmon:/sys/class/hwmon:ro
```

### NVMe drives

NVMe SSDs typically expose their temperatures through hwmon automatically via
the kernel's [NVMe driver](https://www.kernel.org/doc/html/latest/driver-api/nvme.html),
with no additional configuration needed.

### References

- [Linux kernel hwmon sysfs interface](https://www.kernel.org/doc/html/latest/hwmon/sysfs-interface.html)
- [Linux kernel hardware monitoring](https://www.kernel.org/doc/html/latest/hwmon/index.html)

## Thermal zones

The Linux kernel's
[thermal framework](https://www.kernel.org/doc/html/latest/driver-api/thermal/sysfs-api.html)
exposes temperature data at `/sys/class/thermal/thermal_zone*/`. This
interface is commonly used by:

- **ACPI thermal zones** on x86 systems (type: `acpitz`)
- **Realtek SoCs** in some Synology NAS models
- **ARM platforms** like Raspberry Pi

Each thermal zone directory contains:

- `type` &mdash; a label like `acpitz`, `x86_pkg_temp`, or `cpu-thermal`
- `temp` &mdash; the current temperature in millidegrees Celsius

PhotoStructure reads all available thermal zones automatically.

### Docker

For Docker containers, bind-mount the thermal sysfs directory:

```yaml
volumes:
  - /sys/class/thermal:/sys/class/thermal:ro
```

### References

- [Linux kernel thermal sysfs API](https://www.kernel.org/doc/html/latest/driver-api/thermal/sysfs-api.html)

## SATA/SAS drive temperatures

SATA and SAS hard drives report their temperatures through
[S.M.A.R.T.](https://en.wikipedia.org/wiki/Self-Monitoring,_Analysis_and_Reporting_Technology)
monitoring. On Linux, the
[`drivetemp`](https://www.kernel.org/doc/html/latest/hwmon/drivetemp.html)
kernel module exposes these temperatures through the hwmon sysfs interface,
making them readable without root access.

### Enabling drivetemp

Load the module:

```bash
sudo modprobe drivetemp
```

To load it automatically on boot, create a module configuration file (see
[`modules-load.d(5)`](https://man7.org/linux/man-pages/man5/modules-load.d.5.html)):

```bash
echo drivetemp | sudo tee /etc/modules-load.d/drivetemp.conf
```

Verify it's working:

```bash
# Look for drivetemp entries in hwmon
for h in /sys/class/hwmon/hwmon*; do
  name=$(cat "$h/name" 2>/dev/null)
  if [ "$name" = "drivetemp" ]; then
    temp=$(cat "$h/temp1_input" 2>/dev/null)
    echo "$h: ${temp%???}.${temp: -3}°C"
  fi
done
```

### Why not smartctl?

The traditional tool for reading drive temperatures is
[`smartctl`](https://www.smartmontools.org/), but it
[requires root access](https://github.com/smartmontools/smartmontools/issues/205)
to query SATA/SCSI devices. The `drivetemp` kernel module provides the same
temperature data through hwmon sysfs files that are readable by any user.

### Docker

For Docker containers, the `drivetemp` module must be loaded on the **host**
(not inside the container), and `/sys/class/hwmon` must be bind-mounted as
described above.

### Synology NAS

Synology DSM may already expose drive temperatures through hwmon. If not,
you can load the module via SSH:

```bash
sudo modprobe drivetemp
```

Note that Synology DSM may reset loaded modules after a reboot or DSM update.
You may need to use a
[scheduled task](https://kb.synology.com/en-global/DSM/help/DSM/AdminCenter/system_taskscheduler?version=7)
to re-load the module on boot.

### References

- [Linux kernel drivetemp documentation](https://www.kernel.org/doc/html/latest/hwmon/drivetemp.html)
- [`smartmontools` project](https://www.smartmontools.org/)
- [`smartctl` root access discussion](https://github.com/smartmontools/smartmontools/issues/205)

## PhotoStructure settings

### `maxTempCelsius`

The temperature threshold at which PhotoStructure pauses sync. Default:
**80&deg;C** (176&deg;F). Set to `0` to disable temperature monitoring.

### `excludedSensorNames`

A list of glob patterns for sensor names to ignore. Default:
`["*calibration*", "*fan*"]`. Useful for filtering out sensors that report
incorrect or irrelevant readings.

See [advanced settings](/getting-started/advanced-settings/) for how to
configure these values.

