Sunday 9 August 2009

Linux/Ubuntu on a Lenovo ThinkPad

I installed Ubuntu 9.04 onto my ThinkPad T61. ThinkPad series is famous to be Linux friendly, and also because the big improvement of Linux/Ubuntu, after I finished the installation, I found most hardware drivers are installed and ready to use, even including the Fn keys. It is a shame that I still have more than 569 MB ThinkPad driver files for Windows XP stored on my harddisk.

* CPU Temperature and the Cooling Fans

A very useful tool GNOME Sensors Applet can indicate CPU, harddisk and GPU temperatures as well as cooling fan speed. Use apt-get to install the applet and monitor what you want.

:/$ sudo apt-get install sensors-applet

Although it is BIOS's responsibility to optimize the cooling fan speed in order to limit the temperatures, another tool ThinkPad Fan Control (tp-fan) allow you to control the fan speed manually. To install tp-fan, enable its PPA source, and then use apt-get

:/$ sudo apt-get install tpfand

However, it is not recommended to use tp-fan to adjust the temperature thresholds controlling the fan running level.

Actually, by looking up proc files under /proc/acpi/ibm ThinkPad runtime status can be obtained, including the cooling fan. Then it is known that the fan has 0-7 eight levels to be running at.

:/$ cat /proc/acpi/ibm/fan

* FingerPrint Reader

Install ThinkFinger to use the FingerPrint Reader device.

:/$ sudo apt-get install thinkfinger-tools

Its usage is detailedly described on "Install ThinkFinger on Ubuntu".

* Harddisk Active Protection System (APS)

First of all, it is necessary to download these packages. You have to compile them manually except the third one, the script. Actually, the first one is already available in the system, and the second one can be easily installed by using apt-get; however, these binary versions cannot work as expected.1. Unpack, compile and install tp_smapi. Then modify /etc/modules and /etc/modprobe.d/local.conf. Load the modules

:/$ sudo modprobe thinkpad_ec tp_smapi hdaps

Please refer to Reference 1.

2. Use typical "./configure --prefix=/usr/ && make && sudo make install" to build hdapsd. hdapsd will be installed into /usr/sbin/. hdaps-gl, in package hdaps-utils, can be used to test hdaps. Refer to Reference 2.

3. Make the hdapsd script executable, copy it into /etc/init.d/, and then run it.

:/$ chmod +x hdapsd
:/$ sudo cp hdapsd /etc/init.d/
:/$ sudo /etc/init.d/hdapsd start

4. Build the GNOME hdaps applet and install it. Then add the applet onto a GNOME panel. The applet is an indicator to show whether the magnetic head of the harddisk is parked.

:/$ sudo apt-get install libpanel-applet2-dev
:/$ cd ~/gnome-hdaps-applet-20081204
:/$ gcc $(pkg-config --cflags --libs libpanelapplet-2.0) -o gnome-hdaps-applet gnome-hdaps-applet.c
:/$ sudo cp gnome-hdaps-applet /usr/bin/
:/$ sudo mkdir /usr/share/pixmaps/gnome-hdaps-applet/
:/$ sudo cp *.png /usr/share/pixmaps/gnome-hdaps-applet/
:/$ sudo cp GNOME_HDAPS_StatusApplet.server /usr/lib/bonobo/servers/

5. Refering to Reference 2, smartctl can be used to look up the park times of the magnetic head of harddisks. Among the smartctl output, the last number of the line, which contains "Load_Cycle", is the park times.

:/$ sudo apt-get install smartmontools
:/$ sudo smartctl -a /dev/sda | grep Load_Cycle

This park times has a limitation in an alive harddisk. It implies frequently parking the head is not a good idea either. Therefore, default value for the parameter "SENSITIVITY", 15, is too low. We can make it higher, for example, to 50, by modifying /etc/default/hdapsd.

# sensitivity
SENSITIVITY=50

Actually, on Windows I guess it is also necessary to adjust the 'shock detection sensitivity' lower to 'medium'.



References:

1. Enabling Active Protection System on a ThinkPad T61

2. X200下的HDAPS妖魔鬼怪

No comments:

Post a Comment