Skip to content

Instantly share code, notes, and snippets.

@drewdomi
Created November 24, 2025 16:57
Show Gist options
  • Select an option

  • Save drewdomi/f4580f9d707b12c5a7249177fa270937 to your computer and use it in GitHub Desktop.

Select an option

Save drewdomi/f4580f9d707b12c5a7249177fa270937 to your computer and use it in GitHub Desktop.

ThinkFan Setup Guide and Install for Fedora Silverblue

Table of Contents


Overview

ThinkFan is a simple fan control daemon for ThinkPad laptops that adjusts fan speed based on temperature sensors. This guide covers installation on Fedora Silverblue's immutable filesystem.

System Requirements:

  • Fedora Silverblue
  • ThinkPad laptop with thinkpad_acpi support
  • Root/sudo access

Prerequisites

Check Hardware Support

# Verify thinkpad_acpi module is available
lsmod | grep thinkpad_acpi

# Check fan interface exists
ls -l /proc/acpi/ibm/fan

Identify Temperature Sensors

# Find available temperature sensors
find /sys/devices -type f -name "temp*_input" 2>/dev/null

# Check thinkpad_acpi thermal interface
cat /proc/acpi/ibm/thermal

# Install and run lm_sensors (optional)
rpm-ostree install lm_sensors
systemctl reboot
sensors

Installation

Layer ThinkFan Package

On Silverblue, use rpm-ostree to install packages:

# Install thinkfan into base system
rpm-ostree install thinkfan

# Reboot to apply
systemctl reboot

Verify Installation

# Check package is installed
rpm -q thinkfan

# Verify thinkfan binary
which thinkfan

Kernel Module Configuration

Enable Fan Control

ThinkFan requires the thinkpad_acpi module with fan control enabled:

# Create module configuration
echo "options thinkpad_acpi fan_control=1" | sudo tee /etc/modprobe.d/thinkfan.conf

# Regenerate initramfs with new module options
sudo rpm-ostree initramfs --enable --arg="-I" --arg="/etc/modprobe.d/thinkfan.conf"

# Reboot to apply changes
systemctl reboot

Verify Module Configuration

# Check fan_control parameter (should output: Y)
cat /sys/module/thinkpad_acpi/parameters/fan_control

# Verify fan interface is writable
cat /proc/acpi/ibm/fan

Expected output:

status:         enabled
speed:          3200
level:          auto

ThinkFan Configuration

Create Custom Configuration File

# Create custom config (avoids package manager overwrites)
sudo nano /etc/thinkfan.yaml

Configuration File

Paste the following configuration:

##############################################################################
# ThinkFan Custom Configuration
##############################################################################

sensors:
  # CPU Package + Individual Cores
  - hwmon: /sys/devices/platform/coretemp.0/hwmon
    name: coretemp
    indices: [1, 2, 3, 4, 5]  # Package + 4 cores

  # PCH (Platform Controller Hub) Temperature
  - hwmon: /sys/class/hwmon
    name: pch_skylake
    indices: [1]

fans:
  # ThinkPad ACPI Fan Interface
  - tpacpi: /proc/acpi/ibm/fan

levels:
  # [FAN_LEVEL, TEMP_LOW, TEMP_HIGH]
  - [0, 0, 50]                    # Fan off below 50°C
  - [2, 48, 55]                   # Level 2: 48-55°C
  - [4, 53, 60]                   # Level 4: 53-60°C
  - [6, 58, 65]                   # Level 6: 58-65°C
  - ["level disengaged", 63, 255]  # Full speed above 63°C

Configuration Explanation

Sensors:

  • coretemp indices [1, 2, 3, 4, 5]: CPU Package temperature + 4 individual cores
  • pch_skylake indices [1]: Chipset temperature

Fan Levels:

  • 0: Fan off
  • 1-7: Manual fan speed levels (increasing speed)
  • "level auto": Firmware automatic control
  • "level disengaged": Maximum speed (bypass firmware limits)

Temperature Logic:

  • ThinkFan uses the highest temperature across all sensors
  • Fan switches to higher level when temp reaches TEMP_HIGH
  • Fan switches to lower level when temp drops below TEMP_LOW

Service Setup

Override SystemD Service

Configure the service to use your custom config file:

# Create override directory
sudo mkdir -p /etc/systemd/system/thinkfan.service.d/

# Create override configuration
sudo nano /etc/systemd/system/thinkfan.service.d/custom-config.conf

Paste this:

[Service]
ExecStart=
ExecStart=/usr/sbin/thinkfan -c /etc/thinkfan.yaml

Test Configuration

# Validate syntax (dry-run mode)
sudo thinkfan -c /etc/thinkfan.yaml -n

# Test with verbose output
sudo thinkfan -c /etc/thinkfan.yaml -n -v

Expected output should show detected sensors and fan interface.

Enable and Start Service

# Reload systemd configuration
sudo systemctl daemon-reload

# Enable service at boot
sudo systemctl enable thinkfan

# Start service
sudo systemctl start thinkfan

# Check service status
sudo systemctl status thinkfan

Verification & Monitoring

Check Service Status

# View service status
systemctl status thinkfan

# Verify correct config file is loaded
sudo systemctl cat thinkfan.service

# Check running process
ps aux | grep thinkfan

Monitor Fan Behavior

# Watch fan status in real-time
watch -n 2 'cat /proc/acpi/ibm/fan'

# Monitor system temperatures
watch -n 2 'sensors'

# View thinkfan logs
sudo journalctl -u thinkfan -f

# View recent logs
sudo journalctl -u thinkfan -e

Fan Status Output

status:         enabled
speed:          2800        # Current RPM
level:          2           # Current fan level (0-7, auto, or disengaged)

Troubleshooting

Service Fails to Start

# Check detailed error logs
sudo journalctl -u thinkfan -xe

# Verify config syntax
sudo thinkfan -c /etc/thinkfan.yaml -n

# Check PID file conflicts
sudo rm -f /run/thinkfan.pid
sudo systemctl restart thinkfan

Fan Control Not Working

# Verify module parameter
cat /sys/module/thinkpad_acpi/parameters/fan_control
# Should output: Y

# Check module is loaded
lsmod | grep thinkpad_acpi

# Verify fan interface permissions
ls -l /proc/acpi/ibm/fan

# Test manual fan control
echo "level 3" | sudo tee /proc/acpi/ibm/fan
cat /proc/acpi/ibm/fan

Sensors Not Detected

# Re-scan for sensors
find /sys/devices -type f -name "temp*_input" 2>/dev/null

# Check sensor names
cat /sys/class/hwmon/hwmon*/name

# Verify coretemp module is loaded
lsmod | grep coretemp

# Install lm_sensors for detailed info
rpm-ostree install lm_sensors
systemctl reboot
sensors-detect
sensors

Configuration Persists After Updates

Silverblue preserves /etc/ across updates, so your configuration will persist. After major system updates, verify:

# Check system status
rpm-ostree status

# Verify service is running
systemctl status thinkfan

# Confirm fan control is enabled
cat /sys/module/thinkpad_acpi/parameters/fan_control

# Check config file exists
cat /etc/thinkfan.yaml

Manual Fan Control

Test Individual Fan Levels

# Set fan to specific level (0-7)
echo "level 0" | sudo tee /proc/acpi/ibm/fan   # Off
echo "level 2" | sudo tee /proc/acpi/ibm/fan   # Low
echo "level 4" | sudo tee /proc/acpi/ibm/fan   # Medium
echo "level 6" | sudo tee /proc/acpi/ibm/fan   # High
echo "level 7" | sudo tee /proc/acpi/ibm/fan   # Max manual

# Special modes
echo "level auto" | sudo tee /proc/acpi/ibm/fan        # Firmware control
echo "level disengaged" | sudo tee /proc/acpi/ibm/fan  # Full speed (no limits)

# Check current state
cat /proc/acpi/ibm/fan

# Return control to thinkfan
sudo systemctl restart thinkfan

Stress Test Fan Response

# Install stress-ng (optional)
rpm-ostree install stress-ng
systemctl reboot

# Run CPU stress test
stress-ng --cpu 4 --timeout 60s

# Monitor fan response in another terminal
watch -n 1 'cat /proc/acpi/ibm/fan'

Advanced Configuration

Add More Temperature Thresholds

For finer control, add intermediate fan levels:

levels:
  - [0, 0, 45]                    # Off
  - [1, 43, 50]                   # Level 1
  - [2, 48, 55]                   # Level 2
  - [3, 53, 60]                   # Level 3
  - [4, 58, 65]                   # Level 4
  - [5, 63, 70]                   # Level 5
  - [6, 68, 75]                   # Level 6
  - [7, 73, 80]                   # Level 7
  - ["level auto", 78, 85]        # Auto mode
  - ["level disengaged", 83, 255] # Full blast

Use Detailed Mode (Per-Sensor Limits)

For different temperature thresholds per sensor:

sensors:
  - hwmon: /sys/devices/platform/coretemp.0/hwmon
    name: coretemp
    indices: [1, 2, 3]

fans:
  - tpacpi: /proc/acpi/ibm/fan

levels:
  - speed: 0
    upper_limit: [50, 50, 50]  # [sensor1, sensor2, sensor3]

  - speed: 4
    lower_limit: [45, 45, 45]
    upper_limit: [65, 65, 65]

  - speed: "level disengaged"
    lower_limit: [60, 60, 60]

Note: Array length must match number of sensors.


Uninstallation

# Stop and disable service
sudo systemctl stop thinkfan
sudo systemctl disable thinkfan

# Remove package
rpm-ostree uninstall thinkfan
systemctl reboot

# Remove configurations (after reboot)
sudo rm /etc/thinkfan.yaml
sudo rm /etc/modprobe.d/thinkfan.conf
sudo rm -rf /etc/systemd/system/thinkfan.service.d/
sudo systemctl daemon-reload

References

Official Documentation

Useful Commands Reference

# Service management
systemctl status thinkfan
systemctl restart thinkfan
journalctl -u thinkfan -f

# Fan control
cat /proc/acpi/ibm/fan
echo "level auto" | sudo tee /proc/acpi/ibm/fan

# Temperature monitoring
sensors
cat /proc/acpi/ibm/thermal

# Configuration testing
sudo thinkfan -c /etc/thinkfan.yaml -n

License

This guide is provided as-is for educational purposes. ThinkFan is licensed under GPLv3.

Warning: Improper fan control can cause hardware damage due to overheating. Always monitor temperatures when testing new configurations.


Last Updated: 2025-11-24
Tested On: Fedora Silverblue 43
Hardware: ThinkPad t480 with thinkpad_acpi support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment