[Debian] Thinkfan Installation Guide + Configuration Tutorial
Posted: Sun Nov 15, 2015 8:40 pm
Hi everyone. This community has been extremely helpful to me and I've decided to write a beginner friendly guide to installing and configuring thinkfan.
I've been running thinkfan on my T420 Debian 8 setup for about 2 months now, and it's been running great. Although this package is not required, I would highly recommend installing it because by default, the fan will be stuck at a fixed rate (3300 RPM) without setup. This means that your laptop might be improperly cooled, leading to either overheating or overcooling, wasting precious battery power.
I would like to remind everyone that although I've tested and done the research to make sure these settings are safe to use, I am NOT responsible for what happens to your computer should something go wrong. Improper configuration can definitely harm the hardware of your computer so please do take your time to understand what each step does and double check your inputs.
Let's get started!
0. Make sure you have root privileges by either typing $ sudo or log in as root:
1. Download and install the thinkfan package:
2. Add the 'coretemp' kernel module to be loaded at boot time
If that looks cryptic to you, it's a very simple command to add 'coretemp' to the end of the file. You can use your favorite text editor to open 'modules' and add in 'coretemp' yourself if you prefer.
3. Since your changes won't take place until you restart your computer, let's manually load 'coretemp' this one time to continue with our configuration
4. This is the most IMPORTANT step. You will be editing your fan speed parameters by defining upper bound and lower bound levels to trigger different fan speeds. There are several levels ranging from 0 to 7 and 127. 0 is when your fan is completely disabled, 1 is the slowest rotational speed and 7 is the highest. 127 is the maximum fan speed and it's there in case the rare chance that computer fails to cool even at level 7. The temperature is expressed in Celsius NOT Fahrenheit!
Format:
Example:
(0, 0, 42)
(1, 40, 48)
(2, 46, 53)
...
The above example turns the fan on when the temperature reaches 43 Celsius. As level 1 fan cools your computer down, when it reaches below 40, say 39, it will switch to fan_level_0, turning the fan off completely. If you are doing lots of processing, the temperature will rise and if it goes above 48, fan_level_2 is activated and so forth!
5. Now that you understand how thinkfan works, let's make some edits. Open up your thinkfan.conf with your favorite editor. I will use gedit in this example:
Add the following line to the configuration file to allow thinkfan to read from your sensors:
You can make your own lower and upper bound but if you want to use my configuration (which is based on another user's T420 setup) here it is:
6. Enable fan control to modprobe.d by adding the following lines. This file did not exist for me so go ahead and create it if you need to.
7. Reload kernel module 'thinkpad_acpi' and finish setting up thinkfan with auto startup at boot
Make sure to set START="yes" here:
8. Either restart or start thinkfan manually:
9. Final check to make sure everything is running correctly!
To see the current fan speed, level, and status information, type:
To see current coretemp, type:
If your temperatures aren't showing up, you may have to detect sensors and add them.
Run the following command and keep pressing ENTER or type YES when the the choice offer is capitalized and NO when the choice is capitalized. I would just press ENTER because that will select the default options automatically.
You can also check to make sure the thinkfan service is running the background by typing:
10. Congratulations! Now you know everything you need to install, troubleshoot, and optimize your fan control settings. If you have any questions, please do not PM me. Just post here so other's can view it too, and I will do my best to answer you as timely as I can. Thanks.
I've been running thinkfan on my T420 Debian 8 setup for about 2 months now, and it's been running great. Although this package is not required, I would highly recommend installing it because by default, the fan will be stuck at a fixed rate (3300 RPM) without setup. This means that your laptop might be improperly cooled, leading to either overheating or overcooling, wasting precious battery power.
I would like to remind everyone that although I've tested and done the research to make sure these settings are safe to use, I am NOT responsible for what happens to your computer should something go wrong. Improper configuration can definitely harm the hardware of your computer so please do take your time to understand what each step does and double check your inputs.
Let's get started!
0. Make sure you have root privileges by either typing $ sudo or log in as root:
Code: Select all
$ su Code: Select all
$ sudo apt-get install thinkfanCode: Select all
$ sudo sh -c 'echo coretemp >> /etc/modules'3. Since your changes won't take place until you restart your computer, let's manually load 'coretemp' this one time to continue with our configuration
Code: Select all
$ sudo modprobe coretempFormat:
Code: Select all
(fan_level_#, lower_bound_temp, upper_bound_temp)(0, 0, 42)
(1, 40, 48)
(2, 46, 53)
...
The above example turns the fan on when the temperature reaches 43 Celsius. As level 1 fan cools your computer down, when it reaches below 40, say 39, it will switch to fan_level_0, turning the fan off completely. If you are doing lots of processing, the temperature will rise and if it goes above 48, fan_level_2 is activated and so forth!
5. Now that you understand how thinkfan works, let's make some edits. Open up your thinkfan.conf with your favorite editor. I will use gedit in this example:
Code: Select all
$ gedit /etc/thinkfan.confCode: Select all
hwmon /sys/devices/virtual/thermal/thermal_zone0/tempCode: Select all
hwmon /sys/devices/virtual/thermal/thermal_zone0/temp
(0, 0, 42)
(1, 40, 47)
(2, 45, 52)
(3, 50, 57)
(4, 55, 62)
(5, 60, 67)
(6, 65, 72)
(7, 70, 77)
(127, 75, 32767)Code: Select all
$ touch /etc/modprobe.d/thinkfan.conf
$ sudo sh -c 'echo "options thinkpad_acpi fan_control=1" >> /etc/modprobe.d/thinkfan.conf'Code: Select all
$ sudo modprobe -r thinkpad_acpi
$ sudo modprobe thinkpad_acpiCode: Select all
$ sudo gedit /etc/default/thinkfanCode: Select all
$ sudo /etc/init.d/thinkfan startTo see the current fan speed, level, and status information, type:
Code: Select all
$ sudo cat /proc/acpi/ibm/fanCode: Select all
$ sensorsRun the following command and keep pressing ENTER or type YES when the the choice offer is capitalized and NO when the choice is capitalized. I would just press ENTER because that will select the default options automatically.
Code: Select all
$ sensors-detectCode: Select all
$ systemctl status thinkfan.service