Thursday, February 11, 2010

Linux Thinkpad overheating problem? Try this!

Ever since my Jaunty upgrade, my thinkpad t61 has been running extremely hot! At a point it even hit close to 100 degrees C!. This seems to a bug in the kernel mainline and hence might affect all distros.

Here is a quick fix for thinkpad users. From the kernel version 2.6.22 kernel is using thinkpad_acpi to control the fan/temperature/power. First you need to load this module with an option to modify the fan settings.

For this first run the following command:

$ sudo echo “options thinkpad_acpi fan_control=1″ >> /etc/modprobe.d/options
$ sudo rmmod thinkpad_acpi
$ sudo modprobe thinkpad_acpi

The last command loads the thinkpad_acpi module with the specified options.

The fan values can be controlled/viewed on a linux system by simply reading the file /proc/acpi/ibm/fan for e.g.

root@EntePC:~# cat /proc/acpi/ibm/fan
status: enabled
speed: 4998
level: disengaged
commands: level ( is 0-7, auto, disengaged, full-speed)
commands: enable, disable
commands: watchdog ( is 0 (off), 1-120 (seconds))
root@EntePC:~#

Please issue the following command so that we can disengage, the control of the fan and set the fan to go at full speed.

$ sudo echo level full-speed > /proc/acpi/ibm/fan

Once this command is issued, if u cat /proc/acpi/ibm/fan you will see an output as shown above. Please give it some time for this output to show the fan rotating at full speed.

This is a temporary solution and is in no way a fully acceptable long term solution. For the long term, the solution seems to lie in the updated kernel 2.6.30 version. Below you can find the steps required to do the following.

First you need the infrastructure to compile a kernel.

sudo apt-get install libc6-dev kernel-package libncurses5 libncurses5-dev

Once you have this, download the kernel source and copy the .bz2 file to /usr/src

$ cd /usr/src
$ sudo bunzip linux-2.6.30.1.tar.bz2
$ sudo tar -xf linux-2.6.30.1.tar
$ cd linux-2.6.30.1
$ sudo cp /boot/config-`uname -r` ./.config
$ sudo make menuconfig

This shows a configurable user screen. You can simply exit this screen and everything should be fine. Once this is done, simply type

$ sudo make-kpkg –initrd –append-to-version=-avallark kernel_image kernel_headers

Now wait for the whole process to complete. Make sure your fan is running at full speed at this time, cos this is a heavily CPU intensive process.

Once the whole process is done, the system automatically creates two .deb files in the parent directory at /usr/src.

$ cd /usr/src/
$ sudo dpkg -i linux-image-xxxxxxxx.deb
$ sudo dpkg -i linux-headers-xxxxxxx.deb

Replace the xxx with the actual file names from /usr/src directory.

Verify the /boot/grub/menu.lst to see if the new 2.6.30.1 linux image has been picked and reboot using this kernel and you should have your troubles resolved!

Update: Anyone who does not want to follow the above steps to sit and compile everything here are ubuntu’s kernel updates :

Follow the below steps to complete

http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.1/linux-image-2.6.30-02063001-generic_2.6.30-02063001_i386.deb

and

http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30.1/linux-headers-2.6.30-02063001-generic_2.6.30-02063001_i386.deb


No comments:

Post a Comment