Earlier this week I received my new Lenovo t410s laptop. Since I plan to use it as my main development laptop, I ordered it with switchable graphics and other shenanigans. So far it strikes me as a magnificent machine. And since I plan to use it as my main development laptop, I’d like to install Linux on it. But, and this is one big but, this laptop is so bleeding edge that even its Windows support is lacking (to date). To add to the challenge, I don’t want it just to run Linux, I want it to run it perfectly: snappy, fast boot, frugal energy consumption and as stable as a giant sequoia.
These articles will be divided to two sections, a short version for the A.D.H.D, ah, I mean ‘let’s just get it done‘ crowd, and a longer explanation in case you run into problems or wish to understand the process further.
- Basic familiarity with Linux and its ways (see #4 if this doesn’t apply)
- Know which commands should be run as root and what it means
- This isn’t an out-of-the-box thing. Some assembly required, ok, not assembly, but definitely digging into configuration files, compiling things and a little code hacking.
- Know how and where to ask questions, feel free to ask any question here or in other support forums.
When things get really frustrating, I recommend a nice Chamomile tea and taking a day or two rest from this. That’s what I do when I hit a stone wall
Now to work. In this piece we’ll install the base system and the GUI (KDE).
- Get GParted live CD. Burn to a CD or install on a USB stick
- Boot from GParted live and resize your main partition to give some space to your new installation. I recommend creating 2-4 GB swap partition and 45 GB for the rest.
- Format the new 45 GB partition to ext4. Format the swap partition as linux-swap
- Apply and reboot
- Download the custom backported lenny image from here. Get the latest amd64 version (0116). Burn on a CD
- Boot from the CD and follow the installer, when the installer requests to set the partitions, choose the manual option and choose to mount the new ext4 partition as /
- Go through the rest of the installer, in the tasksel screen select only base system and laptop. Do not select desktop environment.
- Allow grub some time to install, since it will try to detect other OS’es.
- Eject the CD and boot to your new Linux
- Install sudo and give yourself administrative privileges:
apt-get install sudo
usermod -G sudo -a <your login username>
- Edit /etc/apt/sources.list to squeeze (something like):
# deb cdrom:[Debian GNU/Linux 5.0.3 _Lenny_ - Unofficial bpo amd64 NETINST Binary-1 20090906-11:59]/ squeeze main contrib non-free
#deb cdrom:[Debian GNU/Linux 5.0.3 _Lenny_ - Unofficial bpo amd64 NETINST Binary-1 20090906-11:59]/ squeeze main contrib non-freedeb http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb-src http://ftp.us.debian.org/debian/ squeeze main contrib non-free
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb-src http://security.debian.org/ squeeze/updates main contrib non-free
#deb http://volatile.debian.org/debian-volatile squeeze/volatile main contrib non-free
#deb-src http://volatile.debian.org/debian-volatile squeeze/volatile main contrib non-free
- Upgrade to the new distribution by running:
apt-get update && apt-get dist-upgrade
Accept any file replacements suggested by the upgrade process
- Install KDE and some other basic utilities:
apt-get install psmisc openssh-server vim kde-full
- Reboot, or restart kdm by running:
That’s how I organize my desktop:
Setting up space
Use GParted live CD, it’s the best tool for the job. Debian installer is very limited in this area, it doesn’t support ext4 or SSD’s (it can’t grasp that some hard drive simply don’t have cylinders). I chose ext4 for filesystem after over a year of extensive usage with all my desktops. When Btrfs becomes stable enough I’ll upgrade to it and report. Swap partitions should be sized in proportion to your system’s main memory, between 2/3 of your RAM size and up to 1:1 ratio.
1. Be sure to always resize an NTFS partition after a fresh reboot, not after hibernation
2. Measure thrice cut once! Triple heck yourself before doing any changes, this stuff can do some serious damage to your filesystem
Installing the Base System (Debian Testing)
Debian testing was chosen for a couple of main reasons. First, the Debian packaging is my favourite distribution method, with all its derivatives. Secondly, it’s very bare bones, but still allows productive work before all the pieces are in place. In future howtos I’ll discuss some of the choices Debian made, and what makes them smart choices.
Although Debian has the reputation of being snail slow, in testing branch you can get almost all software in their latest stable versions, and usually at top quality. Moreover, I like to always know what’s under the hood, without obscure patch-sets that some distributions add.
So why use the Lenny backport image? The latest official version of Debian testing (from here) contains an old kernel. The t410s, like all Core i5 machines, uses a brand new chipset, that is supported from 2.6.32 and forth. Also, the backported image includes firmware for wireless cards, WPA authentication tool wpa_supplicant (for usage see here) and other goodies. Burn the image onto a CD. I couldn’t get it to run smoothly from a USB stick.
Follow Debian-installer, a process that has been explained in many other places. If you are not familiar with it, get a quick explanation from the walk-through here. In the partition manager screen choose to manually set the partitions and make your new ext4 partition mount as /. The installer will automatically detect the swap. In tasksel screen do not choose desktop environment since we want to upgrade to testing as soon as possible, and prevent upgrade issues. Moreover, lenny uses KDE3 while testing uses KDE4. It’s not fun to upgrade between those.
Grub2 can be a little bit of a pain if you’re not used to it (I wasn’t). It will try to detect other OSes, which can take a considerable amount of time. On my laptop it takes a little over 3 minutes!. So give it some time to complete.
Boot to your new system, change the distribution to squeeze and add the contrib and non-free options to the sources.list file
KDE4 can be installed with the kde-full package. If you prefer smaller versions install kde-standard or even kde-minimal. I recommend the full though.
Although basic desktop is running, sound doesn’t work, which will be covered in the next installment. Special buttons also don’t work and screen brightness is stuck at maximum. Due to this, the computer guzzles battery like mad. Also to be fixed.