Thinkpad x220 – the (almost) perfect setup (Fedora 16)

So here I am – sitting in front of my new laptop – Lenovo Thinkpad X220. The date is November 8, 2011 which happens to be the release date of Fedora 16 codenamed “Jules Verne”. It’s 11:00pm, everybody are already asleep and it’s quite and peaceful in my home (thanks to my son that rarely happens ūüôā – it’s time to start with that perfect setup that I’ve had in my mind for quite some time now. I suppose that this is not going to be a short post – so if you are in same state of mind – thrilled, excited and willing to start that Fedora setup any minute now – this is the time to go grab a cup of coffee, tea or beer maybe ūüôā I’m going to describe all the specific things that I’ve done during the install (leaving the boring stuff behind ūüôā

The Hardware (4291-2WG)

  • Intel i5-2540M
  • 1 x 4GB memory
  • 12.5” HD Premium Display (the one with the IPS panel)
  • 320GB 7200 HDD
  • 80GB Intel mSATA SDD
  • Wireless – Intel 6205
  • Video – Intel HD 3000
  • 720p webcam, fingerprint reader, bluethooth
  • 9 cell battery
  • Thinkpad Ultrabase 3 + DVD Burner

Some thoughts about the hardware – first of all I had some doubts about my choice, but after I’ve received the package – they are *all* gone. What where my main concerns:

  • Display size would be too small – that turned out to be fine by me, but still I had to do some tricks to further “improve” it
  • Lack of USB3 ports – not a dealbreaker in the end as you can always stick an additional ExpressCard that sits flush in the laptop (like this one) whenever you get the need of USB 3.0 speeds
  • The IPS panel would suffer from ghosting – there is a huge thread about that, but the issue was actually addressed by Lenovo in the mid of August and after I’ve received mine I’ve even didn’t bother to check whether it has the new or old panel – the screen is (almost) perfect and is miles away from those TN panels. It has some bleeding from the bottom bezel though noticeable at boot time or at the console (when the screen is almost black), but that is not something that you’ll notice during your day to day work.

One more remark about the hardware that I’ve choose – if you don’t have the option to order a customized device (like me) you can get all available options from the so called “tabook” – Personal Systems Reference Lenovo¬ģ ThinkPad ¬ģ Notebooks. Truly a must read if you are in a position of deciding what Thinkpad to buy.

The Installation

So, enough about the hardware itself – lets get it rolling. You’ll need a boot media first. A couple of options here, but as I wanted to go with the latest and greatest of the available technology I’ve decided to go with UEFI boot on the machine (I really wasn’t able to find any major benefits of using UEFI instead of BIOS BOOT, besides maybe the possibly faster boot times) with got me to the first part of this setup.

1. Preparing bootable media (USB Stick)

I’ve decided to continue using 64bit OS despite the numerous problems that I had with some proprietary¬† software/packages, so I’ve downloaded the Fedora-16-x86_64-netinst.iso. From the Fedora documentation¬† – the are not UEFI bootable media by default – you’ll need the installation ISO file readily downloaded somewhere (on the preinstalled Windows 7 perhaps? or boot the Fedora Live CD image), mount it and extract the UEFI bootable image located under /images/efidisk.img on the iso itself.¬† The Network installation iso contains that file also so you can stick with it. After that you can put it on whatever USB stick you’ve got (the image is around 140MB) using dd:

mount -o loop /<path>/<to>/<file>.iso /mnt/cdrom

dd if=/mnt/cdrom/images/efidisk.img of=/dev/sdc #where /dev/sdc is your USB flash disk (be careful here!)

When this is finished the machine is ready to be rebooted.

REMARK: You’ll need to enter BIOS settings (F1) and select as boot method either only UEFI or at least select UEFI as preferred boot method. After that pressing F12 at boot time will allow you to select the USB stick as temporary boot device.

2. Booting the installation

Nothing special here – I used the Intel SSD of course for the system installation, creating EFI, BOOT and SYSTEM partitions. If everything is correct the Fedora installer will know that it was booted from UEFI and will create GPT table instead of MBR on the SSD, which will automatically be also aligned to the 2048 sector which is exactly at 1MB. To verify that, you can do the following. First select “Review and modify partitioning layout” during the installation setup and then check that the EFI partition is created:

You could also verify the alignment and the partition table format from command line after the disk was formatted:

[root@yggdrasil ~]# parted /dev/sdb
GNU Parted 3.0
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
(parted) print
Model: ATA INTEL SSDMAEMC08 (scsi)
Disk /dev/sdb: 156301488s
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start     End         Size        File system  Name                  Flags
1      2048s     5974015s    5971968s    fat32        EFI System Partition  boot
2      5974016s  6998015s    1024000s    ext4
3      6998016s  156301311s  149303296s                                     lvm

What packages are you going to install is entirely a matter of personal taste, but for me – the most important was to switch the default Desktop Environment that is going to be installed from GNOME to KDE. Also I’ve removed almost all packages in the Base System -> Hardware Support section that were not needed anyway on my system.

Tagged , , , ,

8 thoughts on “Thinkpad x220 – the (almost) perfect setup (Fedora 16)

  1. Anonymous says:

    Any problems with the graphics?

  2. The only “problem” that I see is this message in dmesg:

    [ 2.392269] mtrr: no more MTRRs available
    [ 2.392271] [drm] MTRR allocation failed. Graphics performance may suffer.

    Beside that fact – I cannot say there are any performance/speed issues, screen tearing etc …

    • Anonymous says:

      Awesome…I’m looking at a Dell with the same graphics card and I was concerned. Your blog post was incredibly insightful and interesting thanks so much for shearing!


  3. beesdee says:

    I want to know if you had success with powersaving. I am having trouble on FreeBSD and am looking at Fedora as a temporary solution. I can’t get below 50C with the default fan options. I don’t want to be manually setting anything. What are some good throttling configurations?

    • Indeed I’ve done what I’ve could to get down the power consumption, but it was not related with controlling the fans …

      I plan to write about what I’ve done, but as I don’t have the time to do it now I’ll just post the script with all settings:

      # Enable USB autosuspend
      for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
      # Enable SATA Power Management
      for h in /sys/class/scsi_host/*/link_power_management_policy; do echo min_power > $h; done
      # Disable WOL 
      ethtool -s em1 wol 
      # Enable Power Aware CPU scheduler 
      echo 1 > /sys/devices/system/cpu/sched_mc_power_savings
      # Enable Audio codec power management
      echo 1 > /sys/module/snd_hda_intel/parameters/power_save
      echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller
      # Enable power management for all PCI devices
      for c in  /sys/bus/pci/devices/*/power/control; do echo auto > $c; done
      # Extend VM writeback timeout
      echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
      # Disable NMI watchdog
      echo 0 > /proc/sys/kernel/nmi_watchdog
      echo 0 > /proc/sys/kernel/watchdog

      Also I’ve added this to my /etc/default/grub

      GRUB_CMDLINE_LINUX="quiet rhgb threadirqs pcie_aspm=force i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 iwlagn.power_save=1 iwlagn.power_level=5

      And that gives me usually consumption around 10W with WiFi ON. Regarding the temperature I’ve never worried about it, but it seems that I have similar values – 45-50C, which I think is OK.

  4. mir says:

    Great documentation – great results!
    what’ s still unclear to me: Is the dvd-drive, provided through the ultrabase dock, working properly in fedora? i.e movie playback and burning? Where there any troubles? Which model do you use?

  5. Matthew Shuster says:

    Hi Tador,

    I also have an X220. I tried installing Fedora 17 from the Live CD image via UEFI, however Anaconda creates a FAT16 EFI System Partition (ESP), rather than the FAT32 ESP required by ThinkPads ‚ÄĒand as you have pictured above. I just installed Fedora 18 on my Asus H77 desktop board in UEFI mode, also from the Live CD, and the new Anaconda still creates a FAT16 ESP. How exactly did you install Fedora on your X220 in order to get the FAT32 partition? Was this from a DVD image, or a net install?

    Thanks for your help,
    Montréal, Canada

  6. […] I wanted to install Fedora with no special settings and based my setup partially on this article. […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: