Ubuntu Linux 5.04 on an IBM ThinkPad T42


Basic installation guidelines | How to install to the second hard disk adapter | Enable additional repositories for the update manager | Install a kernel for your Pentium 4 CPU | Enable sleep and hibernation | Install on-screen confirmation for the ThinkPad buttons | Enable TrackPoint middle-button scrolling | Don't slow down boot-up by synchronizing with network timeDon't slow down boot-up when no Ethernet cable is connected | Get more effective power management | A possible video speed boost? | Hard disk speed boosts? | Some wireless wisdom


Update: Use this page only for information on the now-obsolete 5.04 version of Ubuntu Linux. Do not use this page for information on installing Ubuntu Linux 5.10 Breezy Badger; instead see this new page on Installing Ubuntu Linux 5.10 Breezy Badger on a ThinkPad T42.

This page is based in large part on many other web pages, message postings, and wiki entries about installing Ubuntu Linux 5.04 ("Hoary Hedgehog") on an IBM ThinkPad T42. The model that I tested was the 2373 JTU, with the IBM/Atheros wireless chip and ATI Mobile Radeon 7500 video hardware. I have not discussed wireless configuration, but much useful information can be found about subject at http://www.ubuntuforums.org and on the Linux forum at Thinkpads.com.

Sources for this page include the Ubuntu wiki page on hardware support for IBM laptops, Oliver Aaltonen’s “Ubuntu Linux on the IBM ThinkPad T42”, many postings at http://www.ubuntuforums.org, and my own experience.

This page was compiled by Edward Mendelson. Please send any corrections to emendelson-at-compuserve-dot-com, or post them for everyone to see in the Linux forum at Thinkpads.com.


Basic installation guidelines

When installing Ubuntu Hoary from the CD, you may accept most of the default settings. Two manual settings are crucially important

First, when partitioning your hard disk, make certain to give Ubuntu a swap file partition larger than the amount of memory in your ThinkPad. If you have 1 GB of RAM in your ThinkPad, make the swap file at least 1.25 GB in size. Be careful to write down the name of the partition that contains the swap drive (typically /dev/hda5 or, if you install on a disk in the second HDD adapter, /dev/hdc5); you will need this name later.

Next, when the installer suggests that you install the Grub bootloader on the Master Boot Record (MBR) of your first hard disk, do not agree. Instead, install Grub in the first partition of the disk on which you install Ubuntu (typically /dev/hda1 or, if you install on a disk in the second HDD adapter, /dev/hdc1).


How to install to the second hard disk drive adapter

I wanted to install Linux to the second hard disk while keeping my original Windows XP system on first (internal) hard disk - and I wanted the Linux installation to leave my Windows installation and its disk entirely untouched. My goal was this: if only the internal hard disk was present, I wanted the computer to boot normally into Windows XP. If the internal hard disk and the second hard disk were both present, I wanted a boot menu that would let me choose whether to boot to Linux on the second hard disk or to Windows XP on the internal hard disk. Here is one way to achieve this (but see the Note at the end of this section for another way):

In addition to the second hard disk drive adapter (with a disk inside it), you will need a USB CD or DVD drive. The IBM Portable Drive Bay 2000 will not work. The Ubuntu installation CD can boot from the IBM Portable Drive Bay 2000, but then the installer cannot find the CD again to finish the installation. (At least I could never find a way to make it find itself again.) Any standard USB CD or DVD drive should work perfectly, however.

Follow the basic installation guidelines above. When the installer offers to install the Grub bootloader in the MBR of the first hard disk,  say No, and instead install it to /dev/hdc1 - which is the first partition of your second hard disk. (If you intend to keep the second hard disk drive adapter permanently in your system, it may make sense to install Grub on the MBR of your first hard disk, but it's safer not to.) Let the installation continue until the end; reboot your system.

When the system starts up again, either press F12 to bring up a menu of boot devices, or change your  BIOS startup options so that you boot by default from the second HDD. Grub will start up and offer to boot Linux. Don't press Enter to boot, because you will not be able to boot into Linux. Instead, press "e" to edit the command sequence, highlight the line that reads "root (hd1,0)", and change it to read

root (hd0,0)

Then press "b" to boot and Ubuntu should boot normally. To avoid having to perform this manual step repeatedly, when Ubuntu starts up, go to the top-line menu, use Applications | System Tools | Terminal, and enter these two commands (you may be prompted for your password):

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst-backup
sudo gedit /boot/grub/menu.lst

Edit the menu.lst file to replace all instances of "root (hd1,0)" to

root (hd0,0)

Two lines beneath "## default grub root device" make sure to change the entry "# groot=(hd0,0)" to read:

# groot=(hd1,0)

Toward the bottom of the file, you will find one or two entries in the list that are designed to boot Microsoft Windows. The one that launches Windows XP may look something like this:

title Microsoft Windows XP Professional
root (hd0,0)
savedefault
chainloader +1

Edit the file so that it looks like this instead - and be sure to notice the change from "root (hd0,0)" to "root (hd1,0)", the two added lines, and the commenting-out of the "savedefault" line by adding the # character at the front::

title Microsoft Windows XP Professional
root (hd1,0)
map             (hd0) (hd1)
map             (hd1) (hd0)
#savedefault 
chainloader +1

This may be preceded by an entry that looks like this:

title Windows NT/2000/XP
root (hd0,1)
savedefault
chainloader +1

This entry is the entry for the IBM Rescue and Recovery Partition. I have not figured out a way to make it boot from Grub installed in the second hard disk, so comment out the entire entry by placing the # character at the front of each line, like this:

#title Windows NT/2000/XP
#root (hd0,1)
#savedefault
#chainloader +1

Save the file. I recommend against using the sudo grub-update command that most guidelines recommend at this point, but if you have edited the file correctly, it should do no harm to use that command. Reboot, again pressing F12 to select the second hard disk as your boot disk if necessary, and test your changes.

Note: I have not tried an alternate method which involves temporarily replacing the internal hard disk with the disk on which you want to install Linux, but that method reportedly works also. To use it, you must install Ubuntu to /dev/hda1 and when the installation is complete, and when you have removed the drive and placed it in the second HDD adapter, and restored the original internal drive, you should proceed as described above, starting with the paragraph that begins "When the system starts up again".


Enable additional repositories for the update manager

Ubuntu uses the Synaptic Package Manager to update itself; to make Synaptic easier to use, turn off the option that asks for the installation CD when adding packages and turn on the option that downloads "universe" packages that are not fully supported by Ubuntu, but which are more or less essential for a finely-tuned computer. You can perform this task in the Synaptic program itself (under Settings | Repositories | Edit), but you get more control by using a text editor to edit the list of sources. Open a terminal, and enter these commands:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list

The top line of the file will begin something like this: deb cdrom:[Ubuntu etc. If you don't want to insert the CD each time you update your system, comment this out by inserting the # character at the front of the line.

Next, remove the # character from the front of each line (except the top line described in the previous paragraph) that begins deb http: or that begins deb-src http: Save the file and close the editor. In the terminal, enter this line:

sudo apt-get update


Install a kernel for your Pentium 4 CPU

Use the Gnome menu System | Administration | Synaptic Package Manager, and search and install the two packages linux-686 and (while you are here) build-essential. The first of these installs the version of the kernel that specifically supports Pentium 4; the second provides essential files for “building” other programs if necessary. Reboot. The 686 kernel should be at the top of the list of boot options. Boot into it.


Enable sleep and hibernation

Open a terminal and enter these commands:

sudo cp /etc/default/acpi-support /etc/default/acpi-support-backup
sudo gedit /etc/default/acpi-support

Edit the file by removing the # character at the beginning of the line that will look like this when the character is removed:

ACPI_SLEEP=true

Save the file. Next, in the terminal, enter:

sudo cp /boot/grub/menu.lst /boot/grub/menu.lst-backup2
sudo gedit /boot/grub/menu.lst

and go to the line starting #kopt. Add the following at the end of the existing line (replace /dev/hda5 with your swap partition, which you can identify by entering the command fdisk -l in the terminal

resume=/dev/hda5 vga=0x318

The vga=0x318 string forces the text-mode display during boot-up and shutdown to display in 50-line mode instead of the ugly 25-line mode. This string is perfect for a 1024x768 screen, but you might want something different. You might want to consult this full list of VGA modes for Linux. The #kopt line should look something like this (if you do not find the strings pci=noacpi and acpi_sleep=s3_bios then add them also)

# kopt=root=/dev/hda1 ro pci=noacpi acpi_sleep=s3_bios resume=/dev/hda5 vga=0x318

If you intend to run the command sudo update-grub after you save the file, then save the file now. If you do not intend to run that command, then add these strings by hand to the kernel line that launches Ubuntu and reboot.

To suspend to RAM (sleep), press the ThinkPad’s sleep button (Fn+F4); to wake up the system, press the Fn key, wait a few seconds, and press Ctrl-Alt-Backspace to restart the Xwindow graphic system.

To suspend to disk (hibernate), press the ThinkPad's hibernate button (Fn+F12), or use the option to hibernate the computer on the logout menu. Press the power button to wake the system; the desktop should reappear automatically.


Install on-screen confirmation of the ThinkPad buttons

The program tpb (ThinkPad Buttons) makes all the ThinkPad-specific buttons and Fn-key combinations work as expected (some buttons, such as the ones that control screen brightness, are hardware-controlled and work under any operating system). As explained by Michael R Head in his post in this thread, the Ubuntu Hoary version of tpb does not support on-screen display (OSD) of the results of your actions. To correct this, download the latest Debian version of the program from the Debian.org site (scroll down to the box under the heading "Download tpb").

Open a terminal, use the cd command to navigate to the directory in which you downloaded the package and enter:

sudo dpkg -i tpb*

On the Gnome menu, use System | Preferences | Sessions | Startup Programs and use the Add button to add the following command:

tpb -d

If you want the Access IBM button to start your screensaver, open a terminal and enter these commands:

sudo cp /etc/tpbrc /etc/tpbrc-backup
sudo gedit /etc/tpbrc

Edit the file by adding this line below the line that begins #THINKPAD /usr/bin, etc.:

THINKPAD /usr/bin/xscreensaver-command -activate

Save the file. In the terminal, run man tpb to learn about other ways to use the Access IBM button.

I believe some of the following steps may have performed automagically during installation (I simply don't remember whether they were or not), but you should perform all the steps anyway to make certain that everything is set up correctly.

First, in a terminal, enter the commands (replacing [username] with your username):

echo nvram | sudo tee -a /etc/modules
sudo addgroup nvram
sudo adduser [username] nvram

I don't pretend to understand exactly what this does, but the first line adds the string "nvram" at the end of the file /etc/modules; the next two lines create a group called nvram and add yourself to the group. Next, enter these commands in the terminal:

cd /etc/udev/permissions.d
sudo cp udev.permissions udev.permissions-backup
sudo gedit udev.permissions

Edit the file to make sure these lines are present (add them if necessary, perhaps to the top of the second set of lines under the heading # character devices:

misc/nvram:root:nvram:660
nvram:root:nvram:660

Save the file and reboot.

Note: the tpb program does not provide visual confirmation for the Fn+F5 button that toggles the wireless radio, but the button does toggle the radio on and off, exactly as it does in Windows. On my system, the wireless light on the panel below the screen never lights up under Ubuntu, but the light seems to work correctly on other people's systems. (I think the difference may be that the light goes on if the ThinkPad has Bluetooth installed; mine does not.)


Enable TrackPoint middle-button scrolling

To use the blue middle TrackPoint button as a scroll wheel, do the following. In a terminal, enter these commands:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf-backup
sudo gedit /etc/X11/xorg.conf

In the editor, find the section headed Section “InputDevice” / Identifier “Configured Mouse” and the following lines above the “EndSection” line:

Option    "EmulateWheel"        "true"
Option    "EmulateWheelButton"  "2"

Save the file. Logout, restart X with Ctrl-Alt-Backspace, and log in again.


Don't slow down boot-up by synchronizing with network time

Ubuntu pauses during boot-up while attempting to synchronize the system clock with a remote time server, but you probably aren't connected to the internet when you boot with a ThinkPad, so this attempt accomplishes nothing. . Eliminate this delay by opening a terminal and entering:

sudo chmod -x /etc/init.d/ntpdate


Don't slow down boot-up when no Ethernet cable is attached

In Synaptic find and install the ifplugd package. After installing it, open a terminal and run this command

sudo gedit /etc/default/ifplugd

Edit the file by modify the lines INTERFACES="" and HOTPLUG_INTERFACES="" if no interfaces are listed or if the wrong interfaces are listed. You probably only want to test the hotplug status of the wired Ethernet connection, so the lines should read:

INTERFACES="eth0"
HOTPLUG_INTERFACES="eth0"

I don't pretend to understand these options fully, so please post corrections if I'm wrong. I've also modified the ARGS= line to add the string -b which silences the otherwise excessive beeping when you plug or unplug the cable. Save the file and reboot.


Get more effective power management  

This is based on a slightly obscure hint posted on UbuntuForums.org. The key parts are in the first post in the thread, but you may get tripped up by a typo.

The posted hint includes links to two files. What you need to do is this: First, back up your copy of /etc/init.d/powernowd (notice the "d' on the end, which is missing in the post) and replace it with the contents of the powernowd.txt file available from the post. (Probably the best way is to open the original file with sudo gedit, and open a copy of the replacement text with gedit and then copy the replacement over the original. I will leave you to figure out the details.)

Next, using the same methods, back up your copy of /etc/acpi/power.sh and replace it with the contents of the power.sh.txt file available from the posted hint. Reboot.

I found that the power controls did not work properly when I first set this up; the CPU was not throttled down as it was supposed to be when I unplugged from AC power. I fixed this by replacing the built-in Ubuntu Hoary version 0.90 with version 0.91 available from the author's web site (scroll down to "Getting and Installing PowerNowd"). Download powernowd-0.96.tar.gz (or a newer version if available) to a convenient directory. Open a terminal, go to that directory, and enter the following commands:

tar xvzf pow* cd
powernowd-0.96
sudo make
sudo make install

Reboot. To check on how well this works, I have installed the CPU Frequency Scaling Monitor by right-clicking on the top panel on the desktop and choosing Add Panel.


A possible video speed boost?

I can't tell if this really helps, but apparently it can't hurt. Open a terminal and enter these commands:

sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf-backup
sudo gedit /etc/X11/xorg.conf

Find the section that begins: Section "Device" | Identifier "ATI Technologies, Inc. Radeon Mobility, etc., and add (after the "BusID" line) these three lines:

Option    "AGPMode"        "4"
Option    "AGPFastWrite"   "true"
Option    "EnablePageFlip" "true"

Save the file, logout, restart X by pressing Ctrl-Alt-Backspace. Login again.


Hard disk speed boosts?

I can't give you any specific advice on this tweak, because you probably use a different hard disk from mine. You risk doing serious damage to your system if you try this, so beware.

Start by exploring this hint posted on UbuntuForums.org. Then, following the hints you find there, back up and then edit your /etc/hdparm.conf file. I have been experimenting with adding lines like these at the end of the file, but you should almost certainly use different settings for your system..

/dev/hdc {
    io32_support = 3
    dma = on
    mult_sect_io = 16
    interrupt_unmask = on
}

Remember, these settings could destroy your system! You should experiment very carefully with this, and test whether any benefits occur. Be careful to look for error messages about your settings that may appear early in the boot process. If your system does not work properly after rebooting, restart the machine and use the Grub editing commands to add the string nohdparm to the line that boots the kernel. As soon as the system restarts, restore the backup copy of your /etc/hdparm.conf file.


Some wireless wisdom

Wireless support in Hoary is, surprisingly, worse than in Warty (Ubuntu 4.10), and with the IBM/Atheros chip, it is frankly a disaster. My advice is this:

iface ath0 inet static
address 192.168.0.101
netmask 255.255.255.0
gateway 192.168.0.1
wireless-essid MYNETWORK
wireless-key s:MySecretString