Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.
Install lm-sensors
and thinkfan
.
sudo apt-get install lm-sensors thinkfan
Find the temperature control devices with
find /sys/devices -type f -name "temp*_input"
Add them to /etc/thinkfan.conf
, including (level, min_temperature, max_temperature):
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp3_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp4_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp5_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp1_input
hwmon /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp2_input
(0, 0, 60)
(1, 60, 65)
(2, 65, 70)
(3, 70, 75)
(4, 75, 80)
(5, 80, 85)
(7, 85, 32767)
echo "options thinkpad_acpi fan_control=1" > /etc/modprobe.d/thinkfan.conf
modprobe thinkpad_acpi
- You can check with
lsmod
ifthinkfan_acpi
is running - To reload a module you need to remove it with
sudo modprobe -r <module>
, but this is not always possible, so we might need a reboot here.
To test thinkfan, use:
thinkfan -n
And to run it, use:
sudo service thinkfan start
And to retrieve the status, use:
service thinkfan status
To make it run at startup, we need to edit /etc/modules
and add the lines below, to make the modules thinkpad_acpi
and coretemp
load at boot time. The thinkpad_acpi
has to be loaded before coretemp
.
thinkpad_acpi
coretemp
Note that this may change the /sys/devices/platform/coretemp.0/hwmon/hwmon3/temp*_input
paths (hwmon3
can become hwmon2
or vice versa), probably because of the order in which the modules are loaded or something. So, in the /etc/thinkfan.conf
config, you might need to update these lines.
Furthermore, we need to enable the thinkfan
service via systemctl
.
sudo systemctl enable thinkfan.service
@lukaspour
Actually, I have changed the
thinkfan.conf
file recently because of/proc/acpi/ibm/thermal
consisting of 8 temperatures on battery and 16 temperatures on AC.Every time I plugged/unplugged AC and rebooted, I got an unexpected behavior or an error from the
thinkfan.service
saying:This variable number of temperatures (8 on battery vs 16 on AC) didn't let me use the simple syntax below.
As I couldn't find any relevant info about this problem online, I tried experimenting with the complex example syntax (
/usr/share/doc/thinkfan/examples/thinkfan.conf.complex
).Finally, this config below fixed my problem of variable number of temperatures to correct. Of course, fan levels and min/max thresholds are just an example that happens to work for my machine. I hope it will help you or anyone having a simiar problem.