Page 1 of 1

My Thinkpad T420 Experience

Posted: Sat Feb 18, 2012 10:01 pm
by wujj123456
Having switched from Ubuntu to Mint since Christmas, I am pretty happy with the GNOME classic interface. I usually use a desktop, but I just bought a Thinkpad T420 for occasional usage. I spent last two days tinkering around various issues and it's time to share some of my experience, as I got quite a lot of help from others’ discussions.

I have no intention to make it complete (but should be correct). It's just another thread for Googlers to refer to. Please post if you have better ideas or corrections.

For all instructions, DO NOT JUST COPY EVERYTHING. MAKE SURE YOU AT LEAST CHECK EACH COMMAND'S OUTPUT. THE FILE PATH CAN BE VERY DIFFERENT FOR DIFFERENT CONFIGURATION OR MODEL. It's better if you understand them though. (I don’t claim that I fully understand them, but nevertheless, it worked for me. )

$ indicates a command. I skip sudo for convenience. Whenever you have a permission error, try sudo first. Also ignore #BEGIN and #END when editing files.

A. My T420 Hardware
i5 2430M 2.4GHz
6GB DDR1333
HD3000 <- I decided to get rid of NV graphics due to the lack of support of Optimus, and Intel driver is always quite friendly to Linux
14.0 HD+ (1600x900) <- Definitely worth upgrading. Otherwise I would go E420, which is much cheaper
320GB HDD
9-cell battery
Intel centrino wireless-N <- same before, betting on better Linux driver support

B. BIOS/UEFI
Virtualization is disabled by default. Make sure you turn it on if you will be using VM. You also need to turn on "USB power when off" if you want to directly charge your phone when your laptop is off.
Access BIOS by pressing F1. Or the blue "Enter" button for other menus.

C. lm-sensors
There are lots of discussion on this topic. Here is a quick version.
$ apt-get install lm-sensors
$ sensors-detect
Use default suggestions until when asking if you want to write to /etc/modules, select YES.
At this point, you can either manually load the list modules ($ modprobe xxxx) or just reboot.
Then you can use "$ sensors" to check
You should be able to see core temperature and fan speed.

D. Hardware monitor applet
That's the applet which can display temperature, fanspeed on menu bar. My instruction is only for GNOME classic, but I guess it will work for MATE too. To add applet to your menu bar, ALT + right click on the menu bar.
It's no longer in the package system. Go to http://sensors-applet.sourceforge.net/i ... ent=source
Download the source code, untar it
$ ./configure --prefix=/usr
$ make
$ make install
You need to install several dev packages along the process. Once it's done, you should see "Hardware Sensors Monitor" from "Add to Panel". Add it and configure the sensors you want in preference.

E. HDD Temp
If your lm-sensors didn't detect HDD temperature, you can install hddtemp.
$ apt-get install hddtemp
Default config is fine. Then use
$ hddtemp /dev/sd?
to check HDD temperature. Or just add it in your applet display. Your first HDD is /dev/sda, second is /dev/sdb, etc.

F. Control the fan
By default, my fan is stuck at 3300RPM, no matter what. This seems to be a common Thinkpad problem. Here is the thread I used to fix that: http://ubuntuforums.org/showthread.php?t=1749186
Make sure the order is correct and you understand your /etc/thinkfan.conf. Otherwise you could mistakenly stop your fan when CPU is at 80C.

1. $ apt-get install thinkfan
2. make sure coretemp is in /etc/modules (should be done by sensors-detect already)
3. load kernel module coretemp (should be done by sensors-detect already)
4. add sensors to /etc/thinkfan.conf
Here is what my thinkfan.conf looks like. Pretty easy to understand with comments in that file. YOU NEED TO FIGURE OUT THE sensor LINE ON YOUR OWN! IT COULD BE DIFFERENT FOR A DIFFERENT CONFIG/MODEL. Use "$ cat xxxx" to check if its output (in milli-Celsius) matches "$ sensors".
#BEGIN
sensor /sys/devices/platform/coretemp.0/temp1_input
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input

(0, 0, 55)
(1, 48, 60)
(2, 50, 62)
(3, 52, 64)
(4, 56, 66)
(5, 59, 70)
(6, 63, 75)
(7, 66, 32767)
#END
5. add following line to /etc/modprobe.d/thinkfan.conf
options thinkpad_acpi fan_control=1
6. reload kernel module "thinkpad_acpi"
$ modprobe -r thinkpad_acpi && modprobe thinkpad_acpi
7. set START="yes" in /etc/default/thinkfan
8. start thinkfan:
$ /etc/init.d/thinkfan start
9. check whether it works:
$ cat /proc/acpi/ibm/fan

G. Power usage regression
There were a huge buzz about Linux kernel power regression since 2.6.39, from Phoronix. Not sure if it’s true (out of my knowledge), but adding this won’t hurt.
http://www.techytalk.info/linux-kernel- ... orkaround/

H. Extend battery life
It’s better to keep LION battery within 30-85% of charge. Under Windows, you can do it with the Thinkpad software. The tp-smapi tool does the same thing under Linux.
http://www.thinkwiki.org/wiki/Tp_smapi# ... l_features
Thinkwiki has great information, but some of them might be outdated. I generally followed their guideline, except for some changes. Didn’t find a good place to put them back to the wiki though.

1. $ apt-get install tp-smapi-dkms
Now you should be able to set charging threshold:
$ sh -c 'echo 85 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh'
This makes charging stop at 85%. For me, the start_charge_thresh didn’t work, but that’s not critical. There are other interesting things you can do, and please refer to the previous thinkwiki link.
2. Now let’s make the changes persistent
Load tp-smapi on reboot:
$ echo tp-smapi >> /etc/modules
Then set the threshold automatically using sysfs:
$ apt-get install sysfsutils
Add the following line to /etc/sysfs.conf
#BEGIN
devices/platform/smapi/BAT0/stop_charge_thresh = 85
EOF
#END

I. Automatically adjust screen brightness on startup
Each time I boot up, the screen brightness is set to maxmium. Hurts my eyes and hurts the battery.
/sys/class/backlight/acpi_video0/brightness is the special file which controls the brightness. For example, change brightness to level 6 (0-15):
$ echo 6 > /sys/class/backlight/acpi_video0/brightness
To make it automatic
1. Add a new script in /etc/init.d/adjustbrightness, and edit /etc/init.d/adjustbrightness (use whatever filename you want) to:
#!/bin/sh
echo 6 > /sys/class/backlight/acpi_video0/brightness
2. $ chmod 755 /etc/init.d/adjustbrightness
3. $ update-rc.d adjustbrightness defaults

J. CPU frequency stuck at lowest level on AC only
Or when your Laptop is fully loaded, the recharging time becomes 10-20hrs or larger. It’s not your OS’ problem. (I wasted lots of time trying to “fix” this.) Check if you have a 65W adapter. You need to get a 90W one if you want to run full speed on AC only.
http://forums.lenovo.com/t5/T400-T500-a ... d-p/682859

Re: My Thinkpad T420 Experience

Posted: Sun Feb 19, 2012 9:27 am
by xenopeek
Moved here by moderator

You may also put up a hardware review at the http://community.linuxmint.com/ website. Login or create an account, My Places > My Hardware > Add a new hardware device, and describe what works and what doesn't (or link back to this post). That way other users can easier find your help when reviewing the hardware compatibility database.