Allin Cottrell <cottrell at wfu.edu>, July 15, 2011
Wake Forest faculty and students are issued new Lenovo ThinkPads on a two-year rotation. The model I have currently (as of July 2011) is the T420s. And a nice machine it is too.
Specs | Linux summary | Installation | Wrinkles
We have the model 4173A47 with 3GB RAM and Intel graphics. It comes with Windows 7 installed. See here and here for details.
Basically, modern Linux "just works" on this machine. As of this writing I'm using kernel 188.8.131.52 and Xorg server 1.10.3. The Intel HD3000 graphics are supported nicely, with direct rendering enabled. From glxinfo:
display: :0 screen: 0 direct rendering: Yes server glx vendor string: SGI server glx version string: 1.4 ... OpenGL vendor string: Tungsten Graphics, Inc OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile x86/MMX/SSE2 OpenGL version string: 2.1 Mesa 7.12-devel (git-b6df603)
Regarding the kernel modules in use, audio is supported by snd-hda-intel, ethernet by e1000e, wifi by iwlagn, built-in webcam by uvcvideo, video by agpgart and i915. The TrackPoint/Touchpad and extra keys are handled as I described for the ThinkPad T60p back in 2007.
I don't use a Linux "distro" -- I have a system of my own that I have fine-tuned over the years. When I get a new ThinkPad, I back up the old system to DVD in the form of gzipped tarfiles. After setting up the new hard drive, I copy the system over and tweak it as needed for the new machine.
My basic strategy:
The WFU T420s comes with the 320GB hard drive already carved into three partitions: some sort of Windows boot partition then drives C and D, with drive D being used for user-specific data. In previous years there was just a single C drive (/dev/sda1 under Linux), and I set up /dev/sda2 for swap and /dev/sda3 for a Linux filesystem. This time I shrank the D drive (/dev/sda3) and added /dev/sda4 for the Linux filesystem. Since only four primary partitions are supported and I didn't want to mess with extended partitions, I didn't create a swap partition on this machine; instead I created a swapfile once I had Linux running.
So after re-partitioning my hard drive looks like this:
Disk /dev/sda: 320.1 GB, 320072933376 bytes 255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x3c168f3a Device Boot Start End Blocks Id System /dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT /dev/sda2 206848 245762047 122777600 7 HPFS/NTFS/exFAT /dev/sda3 245762048 329653799 41945876 7 HPFS/NTFS/exFAT /dev/sda4 329653800 625137344 147741772+ 83 Linux
After getting Linux up and running I check the kernel config against the machine features to see if any modifications are called for, and recompile as needed. One point to note about the T420s is that the Intel Core i5 has two "real" cores but also Hyper-Threading, so it appears to the OS as four cores. To get full support from the kernel, therefore, it's necessary to set CONFIG_NR_CPUS to at least 4.
A few things were slightly problematic at first.
Initially, I tried using the built-in Windows 7 disk partitioning tool to shrink the D drive to make room for Linux. But Windows told me I could only free 337MB (about 0.2 percent of the space!), allegedly because of "unmovable" files. I wasted quite a while googling for possible fixes, tried turning off the system restore mechanism and so on, but nothing worked. But -- duh! -- after booting from a Linux CD, ntfsresize had no problem shrinking the D drive from about 180GB to 40GB. Moral: don't bother with the Windows tools.
At first I tried using version 2.2.0 of SystemRescueCd. Unfortunately this did not play nicely with the 1600 x 900 display: after the first boot messages I got a mostly black screen with a grey stripe on the right. The system was running but I was typing blind. Happily, an older version of SystemRescueCd (1.3.0, from 2009) worked fine. [Update 2011-07-17: version 2.2.0 works fine if you disable KMS. At the main SystemRescue menu choose A) "Standard 32bit kernel (rescuecd) with more choices...", then at the sub-menu choose 6 "SystemRescueCd with standard VGA console (no KMS)".]
When making the Linux filesystem on /dev/sda4 I used mkfs.ext4. Works fine, except that (at least as configured on SystemRescueCd) this adds huge-file support by default, which means that if your kernel is not configured for huge-file support (CONFIG_LBDAF) the system won't boot! But this can be fixed quite simply. If you don't need huge files:
tune2fs -O ^huge_file /dev/whatever fsck /dev/whatever
Once Linux was running, dmesg showed MTRR errors, as in
mtrr: no more MTRRs available [drm] MTRR allocation failed. Graphics performance may suffer.
It turned out this was a BIOS issue. The machine came with BIOS version 8CET32WW (1.09). I booted into Windows and updated to 8CET36WW (1.13) of 2011-05-27 [Lenovo link]. The doc for this update includes "Fixed an issue where the VRAM size was allocated to fixed 128MB, not up to 1GB with the Intel graphics mode on Windows XP." This seems to apply to Linux too, since after the update the MTRR errors are gone.
2011-07-17: our local hardware guru, Ching-Wan Yip, adds: "there is a side effect on using BIOS >1.09, (also affect X series, not sure about W series) the TOLOD has been changed from 3.0 to 3.5GB, that broke eGPU, there is a petition from those users to Lenovo to get it fix, i am not sure it is going anyway since it affects only few people."
It appears that Linux ACPI does not yet fully support the T420s. There has been some discussion of this on the ibm-acpi-devel mailing list. One symptom is that under Linux the fan runs at about 4000 rpm all the time (even when the CPUs seem reasonably cool). It looks like we'll just have to wait for more information to emerge from Lenovo and for the ibm-acpi guys to update the driver. Maybe in kernel 3.0?
2011-07-17: Ching-Wan Yip adds, "the fan issue is across lines, all the current (and some older) T, W, X series Thinkpad are affected, there is no fix yet at this point. not sure it is the embedded controller or BIOS."
So at this point I'm mostly a happy camper, but it'll be nice to have full support for thermal control on the T420s.