How to properly control your Lenovo Thinkpad R61 fan rotation cycles on Linux with ThinkFan

Friday, 11th June 2010

Since quite a long I’m issuing issues with my fan rotation controlling software on Linux.
That is really annoying since every now and then I experience problems with overheats when my systemis under heavy loads.
That would interrupt my proper work with my notebook every now and then and had became a real pain in the asswith time.
I spend a lot time looking for a solution in the meantime trying all kind of scripts which mentioned on thinkwiki.org
I’ve had an unpleasent experiences with tpfand , tp-fancontrol as well as with the automated process to control fan through some kernel module options like:

options thinkpad_acpi fan_control=1

To solve my overheating issues when the temperature shown by lm-sensors was reaching 60 degrees andabove I had to manually change the fan rotation level with the command :

# increase thinkpad fan speed to max
root@noah:~# echo level 7 > /proc/acpi/ibm/fan

The manual way to increase fan rotation when my CPU was under a high load caused by the automated thinkpad_acpi kernel module wrongly controlling the fan speed was really irritating, therefore I looked for something online to manage the fan rotation to cool my cpu in a proper way, after the many failed attems to use some of the forementioned softwares as well as other techniques I found to be explained as a workarounds to tune the automated fan rotation speed.
I finally found Thinkfan . The wonderful guys from Debian has even prepared a packaged deb package of thinkfan, so as a debian user the whole thinkfan installation was as easy as:

root@noah:~# apt-get install thinkfan

Though thinkfan worked just fine most of the time and was able to control my fan speed automatically quite properly most of the time, it failed to do so every now and then.
Since failures to adjust properly the fan rotation speed on my Debian Linux when the system was under a stress was rare, I was quite happy with thinkfan as a fan manager for my desktop linux system most of the time.
The most often cases in which thinkfan failed to properly adjust my fan speed to cool my cpu properly was after system sleeps or hibernate
To work around this issue I have created a crontab which would periodically restart the thinkfan daemon, the crontab I used is as follows:

# restart thinkfan on every 30 minutes to prevent issues with thinkfan after hibernate and sleep on Debian Linux
0,30 * * * * /etc/init.d/thinkfan restart >/dev/null 2>&1

This kind of solution worked until recently when I have used apt-get to upgrade my system software to the latest versions, ever since then thinkfan misbehaving unabling to properly control my notebook lenovo thinkpad r61 fan speed.

The failure to control properly the fan speed was accompanied by the following thinkfan warning messages in /var/log/messages :

Jun 7 15:30:02 noah thinkfan: WARNING: Using default temperature inputs in /proc/acpi/ibm/thermal.
Jun 7 15:30:02 noah thinkfan: WARNING: You have not provided any correction values for any sensor, and your fan will only start at 55 °C. This can be dangerous for your hard drive.

I spend almost two hours Googling for the error and possible articles on how to configure my thinkfan /etc/thinkfan.conf to match my thinkpad r61 fan control but I couldn’t find anything meaningful in Google.

Thus I started experimenting changing values in my /etc/thinkfan.conf until I reached a moment the fan is properly controlled by thinkfan.

I thought this values could be of a great benefit to other Thinkpad R61 Linux users I decided to blog about my issues and my solution to fan control issues.
So if you are also in the same struggles with properly configuring the fan speed for thinkfan to match Thinkpad model R61, you will have to download my thinkpad r61 Correction values thinkfan.conf file
Our you can either just copy paste the following in your /etc/thinkfan.conf configuration file on your system:

(0, 38, 40)
(1, 42, 44)
(2, 46, 48)
(3, 50, 52)
(4, 54, 56)
(5, 58, 60)
(6, 62, 64)
(7, 66, 32767)

For other Lenovo / IBM Thinkpad model types the correction values might be close or even it’s possible that the same configuration to control your fan with thinkfan might be compatible with other Thinkpads.
If you test it on another thinkpad and you find it working or some tweakenings to the up-mentioned correction values help in tuning thinkfan on other Thinkpads, please post here!
Thanks God, now after simply restarting my thinkfan, my notebook fan is automatically properly set to rotate!

Share this on:

Download PDFDownload PDF

Tags:

18 Responses to “How to properly control your Lenovo Thinkpad R61 fan rotation cycles on Linux with ThinkFan”

  1. Petar Milin says:
    IceWeasel 3.5.12 IceWeasel 3.5.12 GNU/Linux GNU/Linux
    Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100911 Iceweasel/3.5.12 (like Firefox/3.5.12)

    I wonder whether you could give more detailed explanation how to properly add crontab for thinkfan? Moreover, do we need it if we addjust /etc/thinkfan.conf?

    Thanks!
    PM

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Hi having the crontab is not absolutely necessery, however it works well for me that’s why I mentioned it.
      To add crontab type in your terminal for instance “crontab -u root -e”. Then you will have to deal with saving it after you paste what I point in the article should go in the crontab. Here it depends on your text editor if it’s vim or nano. If you’re with vi/vim you need to press “i” when the editor opens and laters press “esc” then “:x!” this will save the crontab and install it. If you’re with nano just place the crontab just like it’s said in the article and press “ctrl+x” this will save the edit.

      Regards,
      Georgi

      View CommentView Comment
  2. Jospeh Milich says:
    Firefox 3.5.3 Firefox 3.5.3 Windows XP Windows XP
    Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)

    Hello! I’ve read some of your publish right here and uncovered it fascinating and it makes a whole lot of sense. Plus i love your theme below. Thumbs up! Maintain on sharing!

    View CommentView Comment
  3. Stone says:
    Firefox 6.0a1 Firefox 6.0a1 GNU/Linux GNU/Linux
    Mozilla/5.0 (X11; Linux i686; rv:6.0a1) Gecko/20110522 Firefox/6.0a1

    Well I’m sorry, but the values listed there don’t seem to work with the latest thinkfan, for the LOWER limits don’t overlap with the previous UPPER limits.
    I believe some easy adjustments will work.

    Cheers!

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      if you have values that work and you can post info about your exact linux version it will be great.
      Hope it might benefit others.

      View CommentView Comment
      • Stone says:
        Firefox 7.0a1 Firefox 7.0a1 GNU/Linux GNU/Linux
        Mozilla/5.0 (X11; Linux i686; rv:7.0a1) Gecko/20110525 Firefox/7.0a1

        just like this: (/etc/thinkfan.conf)
        (0, 38, 42)
        (1, 40, 46)
        (2, 44, 50)
        (3, 48, 54)
        (4, 52, 58)
        (5, 56, 62)
        (6, 60, 66)
        (7, 64, 32767)

        I’m using Arch Linux, kernel 2.6.39, i686 Intel Pentium Dual, ThinkPad R61i.

        View CommentView Comment
  4. kleskjr says:
    Chromium 14.0.811.0 Chromium 14.0.811.0 Ubuntu 10.04 x64 Ubuntu 10.04 x64
    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/10.04 Chromium/14.0.811.0 Chrome/14.0.811.0 Safari/535.1

    Zdrasti Georgi,

    I have a question concerning the auto-start of the thinkfan daemon. The line “0,30 * * * * killall -HUP thinkfan” restarts the thinkfan every 30 minutes, but it does not start it when I boot the machine. Do you have a suggestion how thinkfan can be started automatically through crontab as well?

    Cheers for the posts,
    Nikolay

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Здрасти Nikolay,

      You can configure /etc/init.d/thinkfan to start up.
      Or if you’re missing the thinkfan script I can put a link here for you.

      Поздрав! 🙂

      View CommentView Comment
  5. nikolay says:
    Chromium 14.0.813.0 Chromium 14.0.813.0 Ubuntu 10.04 x64 Ubuntu 10.04 x64
    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/10.04 Chromium/14.0.813.0 Chrome/14.0.813.0 Safari/535.1

    Здрасти и thanks for the fast reply,

    I made a thinkfan_auto script which looks like this:
    #!/bin/bash
    sleep 30 && thinkfan ;

    Then I copied it it /etc/init.d/ and run sudo update-rc.d thinkfan_auto defaults. But the program still doesn’t start at boot.

    Any suggestion on how the script should look like is welcomed.

    Благодаря!
    Николай

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Здрасти и ur welcome 🙂
      You can download the script I use from below link.
      http://www.pc-freak.net/files/thinkfan

      Add the script to be loaded in your runlelvel, the Debian standard desktop runlevel is 2.

      hipo@noah:/etc/init.d$ /sbin/runlevel
      N 2

      Issue the commands to add them in runlevel 2.
      # cd /etc/rc2.d/; ln -sf /etc/init.d/thinkfan S19thinkfan

      To be honest I never get used to update-rc.d 😉

      If I can further help it will be a pleasure.

      Всичко най!
      Георги

      View CommentView Comment
  6. nikolay says:
    Chromium 14.0.813.0 Chromium 14.0.813.0 Ubuntu 10.04 x64 Ubuntu 10.04 x64
    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.1 (KHTML, like Gecko) Ubuntu/10.04 Chromium/14.0.813.0 Chrome/14.0.813.0 Safari/535.1

    Thanks for the reply Georgi,

    somehow I managed to get it working yesterday. I found the script you posted, and then enabled thinkfan in /etc/default/thinkfan (as said in the script). As I put the program thinkfan (the binary file) in /usr/local/sbin, I had to change the path in the script from DAEMON=/usr/sbin/$NAME to DAEMON=/usr/local/sbin/$NAME. At the end I run sudo update-rc.d -f thinkfan start 99 2 3 4 5 . and it worked 🙂

    I don’t get why the scripts in /etc/init.d can not be a simple one line code (like in my previous post). Is that a security reason, or there is something deeper that I can’t understand?

    Благодаря за помощта!
    Поздравления из блога ти, доста интересни статии имаш. Най-вероятно ще се видим пак по коментарите под тях 😉
    Поздрави, Николай

    View CommentView Comment
    • admin says:
      Epiphany 2.30.6 Epiphany 2.30.6 Debian GNU/Linux x64 Debian GNU/Linux x64
      Mozilla/5.0 (X11; U; Linux x86_64; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Version/5.0 Safari/531.2+ Debian/squeeze (2.30.6-1) Epiphany/2.30.6

      Ur welcome 😉
      Glad you make it. The reason behind the scripts are not just few lines is that if there are just few lines is versatile, it needs to make different checks related to the service activity up/down restart/stop/start options for the service etc.

      Няма проблем за помощта, радвам се че съм помогнал и че с нещо ти е бил полезен блога.
      Ще се виждаме из коментарите.

      Всичко най!
      Георги

      View CommentView Comment
  7. tm says:
    Internet Explorer 8.0 Internet Explorer 8.0 Windows 7 Windows 7
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB7.1; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8)

    Is there a way to do this for idiots

    View CommentView Comment
    • admin says:
      Firefox 3.6.17 Firefox 3.6.17 Ubuntu 8.04 Ubuntu 8.04
      Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110422 Ubuntu/8.04 (hardy) Firefox/3.6.17

      Do that for idiots? 🙂 I think I know what you mean. But I don’t know by so far for another way

      View CommentView Comment
  8. Tamera says:
    Firefox 3.8 Firefox 3.8 Ubuntu 9.25 Ubuntu 9.25
    Mozilla/5.0 (X11; U; Linux i686; it-IT; rv:1.9.0.2) Gecko/2008092313 Ubuntu/9.25 (jaunty) Firefox/3.8

    É pá! É que nao quero que te falte nada!!!

    View CommentView Comment
  9. Idiot's advice says:
    Google Chrome 24.0.1312.68 Google Chrome 24.0.1312.68 GNU/Linux x64 GNU/Linux x64
    Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.68 Safari/537.17

    Your blog sucks, hard.

    http://sourceforge.net/p/thinkfan/discussion/905019/thread/24c3cd47

    View CommentView Comment

Leave a Reply

CommentLuv badge