Dapper Drake on T42

I just finished Dapper installation on my notebook (IBM, ops, Lenovo T42), or rather I finished a first part of it. So far I was busy mostly with getting the bootloader right - which is not a trivial task on recent Thinkpads due to Rapid Restore & Recovery partition.

More to come then. For now I just post this quick info regarding Linux installation with R&R functionality intact.

1. Getting right installation disk & making backup
Ubuntu Dapper Drake has a new super flashy LiveCD installer, which is convenient, nice, cool etc. - but not very user friendly. Hmmm, or rather power-user friendly. In short, it assumes that the GRUB installer should be installed on HDD MBR (master boot record). It just deletes contents of MBR and writes its own bootloader there, without asking (or even informing) the user.

Too bad the MBR on recent Thinkpads is rather special - it contains IBM’s own bootloader, which is capable of trapping “Access IBM” keypress event. So if you delete original MBR the Rapid Restore functionality is lost - while the “hidden” partition, containing Windows XP recovery image, might be still there on the disk, the computer cannot boot it (note - it can be booted manually, with special GRUB configuration, but it is not very pretty…). Therefore you should not install anything on the MBR.

Fortunately it is possible to install Dapper Drake in an old fashioned way, via text installer, which does ask if you want to have bootloader on MBR or not. For this you should use “Alternate” install CD, also available from Ubuntu homepage.

Aha… back up your data. Just in case.

2. Setting R&R partition mode
First important thing - before making any changes to HDD layout you should protect the recovery partition. Enter BIOS setup and in “Security” set the recovery partition mode to “Secure“.

3. Installation
In theory (and this is usually suggested by people in the forums) it should be possible to make a small /boot partition and install GRUB there instead of installing it in MBR. This way the original MBR can load recovery (when Access IBM button is pressed), and it can also load our GRUB which in turn loads Linux or Windows. In practice :-) it turns out, that the IBM’s bootloader is rather dumb and can boot the first partition on the disk only . And unless you do some heavy partition/disk layout modifications the first partition on your HDD would be an original Windows XP partition (of course shrunk) and not other, Linux partition, where GRUB could be installed :(
Fortunately GRUB is not the only boot loader that you have - the other one is Windows XP boot loader (NTLDR) and it can be persuaded to boot Linux. Here’s how:

a) Start “Alternate” CD installation.
b) Shrink Windows partition with installer tool (probably it is even better to shrink it, abort installation, check that Windows is still working, and restart installation, this time “using free space” on the disk).
c) Install Ubuntu, when asked about boot loader refuse to install it to MBR, install it to your Linux partition (it probably will be /dev/hda3 as /dev/hda1 is original IBM_PRELOAD that you just shrunk and /dev/hda2 is recovery partition).
d) Reboot - Windows XP should start again.

e) Now you need to transfer the contents of /dev/hda3 boot sector to Windows partition, for NTLDR usage. Probably the simplest way is to use some Linux LiveCD distro (for example normal Ubuntu CD should be OK, or something smaller like Linux Rescue CD). Boot it, open console, become root if necessary:
sudo -i
and use dd to write contents of first sector of /dev/hda3 to a file.
dd if=/dev/hda3 of=ubuntu.img bs=512 count=1

Now you should transfer this small ubuntu.img file (should be 512 bytes long) to your Windows partition. I just used a flash USB drive.

f) Reboot again into Windows. Put ubuntu.img in c:\ and modify contents of c:\boot.ini (this file controls NTLDR behaviour, its hidden, read only etc. so change attributes apropriately) appending to it a line:
c:\ubuntu.img="Ubuntu Linux Dapper Drake"

g) Reboot - now you should have boot menu with Windows XP and “Ubuntu Linux Dapper Drake” options. The later should boot GRUB, with standard Ubuntu boot options. Uffff‚??

Note - there are also Windows clones of dd, but I have not tested them.

10 Responses to “Dapper Drake on T42”

  1. Pawel Krolak Says:

    I think that using Microsoft Windows is a little more easy. :) But it’s my private opinion… :) Best regards Peter.

  2. Closet Ubuntu Lover Says:

    i used T42p with XP at work for a year. We had a refresh and i get to keep mine for $50. i would not have paid a $50 if i had to run XP on it at home.
    XP is for people like my wife who pays full price and leaves a tip at a restaurant where the food is bad and service is terrible!
    Thank you for the great article. Maybe a global army of people like you and users like me will finally force MS to improve the quality of OS and reduce their prices.
    Enough ranting, back to installing!!!

  3. Xavier Says:

    Hi. Good article, great help but there is something which is still unclear to me. In step 3, you talk about an small partition for /boot. Must it be a primary partition? or it would be alright to create an extended partition with /boot, swap, /root and /home for instance?.

  4. Silvan Says:

    Thanks for the detailed explanation, I will try it out next weekend. But one question: are you sure the line I will have to add to boot.ini is c:\ubuntu.bin=”Ubuntu Linux Dapper Drake” and not c:\ubuntu.img=”Ubuntu Linux Dapper Drake”?

  5. Administrator Says:

    Of course it should be c:\ubuntu.img=‚?ĚUbuntu Linux Dapper Drake‚?Ě - thanks Silvan for noticing!

    Xavier - I have not been experimenting very much, I could not force original IBM MBR to boot anything other than first primary partition. If you manage to do it, I would certainly would like to now about it - it would simplify entire proces considerably…

  6. Simon Says:

    Thanks a lot for this great information. It saved me a lot of time. I was trying to install Ubuntu 6.06 on my T60 ThinkPad, with GRUB as Bootloader and ThinkVantage button working. But didn’t find a solution.

    Yours is just working fine.

    Even if relying on NTLDR makes me a bit nervous :)

  7. Gisli Says:

    Thank you for the article.

    Would you mind saying a few words about the value of keeping R&R functionality intact. Unless this is of significant importance, the effort you outline seems rather excessive.

  8. Luke Says:

    Massive help - worked perfectly

  9. Administrator Says:

    Gisli - R&R is important, mainly because it allows to rapidly restore entire machine into “factory preloaded” state. Of course if you are using Linux exclusively it is of not high value, but if you are working mostly in Windows it might be priceless, when - eg. - you screw your Windows partition (hmm, while playing with this new Linux distribution etc. :-)

  10. Rumi Mohideen Says:

    Help I want to install ubuntu on my T42 think pad leaving XP in place only because Im nervous about open office and the excell files I and my wife use for work contain complex macros and I use alot of software to programme inverters and other electronic controllers which are either written for windows or linux (both more often than not). Will it still work my WIFI, Bluetooth and touch pad.