Upgrading a ThinkPad T42 hard drive with dual-booted Fedora Core Linux (and Windows XP)

Summary

I've been dual-booting Fedora and Windows XP off the Thinkpad T42's factory-installed 40GB hard disk for about a year (see my main Thinkpad T42 Fedora Core page for details). In April 2006, I decided to upgrade to a Seagate Momentus 7200.1 100GB disk. I used an external USB hard drive enclosure to transfer data from my (multiple-partition) old drive to my new one. The new hard drive appears to work fine.

A note about sound: the Seagate Momentus makes a much quieter "grinding" noise (on disk accesses) than the previous Fujitsu drive. However, it seems to make a louder "spinning" noise (constant, high-register white noise when idling). Also, the drive runs hotter, so the ThinkPad cooling fan comes on more often. I suppose this is what you'd expect from a newer, higher-RPM drive. Oh well. I guess I'll live with the noise.

Table of contents

  1. Preparation
  2. Installing the hard disk
  3. Installing Windows XP
  4. Partitioning
  5. Installing Fedora
  6. Manual tweaks
  7. Restoring my data

History

26 April 2006
First writeup
5 June 2006
Added modprobe lines to sleep.sh in power section. Also rhgb appears to be working again.
26 August 2006
Added dbus-send lines (replacing modprobe lines) and vbetool lines in sleep.sh.

Preparation

I bought the Seagate Momentus 100GB 7200.1 2.5 inch hard drive and a USB hard drive enclosure. Because my laptop was out of warranty, I also ordered the IBM Rescue and Recovery disks from IBM. Lastly, I downloaded and burned Fedora Core 5 (to DVD+RW), and Windows XP Service Pack 2 (to a CD-R). Rationale for each follows.

The drive:

I knew I wanted at least 100GB. The Seagate Momentus had received a number of good online reviews, and I thought the boost from the factory-installed 5400 RPM disk to a 7200 RPM disk would be nice.

USB enclosure:

I wanted a way to transfer files from my old disk to my new disk. I think USB hard drive enclosures are commodity items, so I didn't pay attention to the brand when choosing. If you're curious, I bought a SimpleTech STIHD25USB2, because I liked the fact that the USB cord was integrated into the enclosure rather than a separate dongle.

IBM Rescue and Recovery:

IBM does not, by default, provide Windows installation disks with their Thinkpads. You have to call IBM support and ask them to send you disks, which will cost you about $50 (grrr) if your machine's past warranty. There are apparently ways to transfer a Windows system wholesale from one disk to another via USB, but I didn't trust that; I'd rather do a complete fresh install.

Fedora Core 5:

My current Linux distribution of choice.

Windows XP Service Pack 2:

Studies show that a fresh installation of (pre-Service Pack 2) Windows XP will be hacked within 20 minutes of connecting to the Internet. Therefore, before preparing any fresh Windows install, you should have an offline copy of the most recent Service Pack. As of April 2006, the best way to do this is to get "Service Pack 2 for IT Professionals and Developers", which gives you one big 266MB self-installer, and burn it to a CD.

Note that upgrading to SP online through Windows Update, which downloads the Service Pack directly to the computer you're upgrading, is folly. It takes more than 20 minutes to download SP2, and you'll be connected to the Internet for those 20 minutes: game over. Burn the CD instead.

Installing the hard disk

I pulled the old hard drive out, removed it from the mounting bracket, screwed the new hard drive into the bracket, and slotted it back in.

This was no problem, except that the mounting bracket screws were pretty tight and took some effort to unscrew.

Installing Windows XP

I prepared a burned CD-R with Windows XP Service Pack 2, ran the IBM Rescue and Recovery disk, installed the service pack, and ran Windows Update. Details follow.

The IBM Rescue and Recovery disks come with installation instructions, which are mostly complete. You just need to boot from CD-ROM with the disk labeled "Rescue and Recovery" (not "Product Recovery"). Then, select "Restore factory contents" and follow the instructions. This will take some time and seven disc-swaps.

One wrinkle that's not mentioned is that after your computer finishes copying data from the CD-ROMs, the system will reboot off the hard drive, and return to IBM Rescue and Recovery. You will need to select "Restore factory contents" a second time. This resumes the system recovery process. At this point, your computer will do a bunch of installation stuff, involving a lot of copying and multiple reboots, but this does not require user input.

Once the system recovery completed, I created some accounts, logged into an administrative account, and ran the Windows SP2 installer. This prompted another reboot.

Finally, I logged in as an administrator again, plugged into a fast network, and ran Windows Update to make my system current. Note that Windows Update needs to update itself and reboot before it does anything, and some updates depend on others, so this required three reboot/update cycles for me.

Partitioning

I booted from a GParted LiveCD to shrink the main Windows (NTFS) partition and create new partitions for Linux. Details follow.

My GParted operations were as follows:

  1. Shrink the primary NTFS partition (/dev/hda1).
  2. Create an extended partition with all remaining free space.
  3. Create logical partitions for /boot, /, /home, /mnt/transfer, and linux-swap inside the extended partition (see below for sizes and order of these partitions).
  4. Click "Apply".

My final partition layout (sizes are approximate; 1 GiB = 230 bytes, 1 MiB = 220 bytes):

Size Type Mount point Notes
30 GiB NTFS /mnt/winc
(Windows C: drive)
NTFS is supported in Linux kernel 2.6, but it's read-only. The RPMs are available from linux-ntfs.org. The repository is not yum-ified, so you'll need to install the RPM manually every time you upgrade your kernel.
100 MiB ext3 /boot For some reason, Fedora installers recommend a huge /boot partition. You can probably get away with one half this size.
20 GiB ext3 /
16 GiB ext3 /home
20 GiB FAT32 /mnt/transfer
(Windows E: drive)
Since Linux kernel 2.6 doesn't have NTFS write support, I created this FAT32 partition for transferring data between Linux and Windows. I plan to keep mostly static data, like music files and digital photos, on this partition.
2 GB Linux swap
4.7 GB n/a IBM rescue partition This is created by IBM Rescue and Recovery; I don't want to mess with it

Installing Fedora

I booted from the Core 5 DVD, selected my filesystem layout, and installed Fedora. Installation proceeded without incident, except for sound.

Note that the Intel 2200BG wireless card will not be recognized during installation. Also, if you do not hear the sound card, go ahead and tell the installer that you did.

Updating Fedora

I logged in as root, set up my network, imported the Fedora GPG keys, and ran yum. Update was completely painless, though it took a while.

The first thing I did when I logged in as root was to set up a network (Red Hat's GUI network configuration/control tools worked fine for this) and update to the latest RPMs using yum:

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
yum update

For me, this was 529MB of packages (as of 26 April 2006), so it's not something you want to do on a slow connection.

Manual tweaks

Only four tweaks were required. (1) Suspend requires some scripts in /etc/acpi, plus an edited /etc/grub.conf. (2) Wireless Ethernet requires installing firmware in /lib/firmware. (3) Turning off sub-pixel hinting in X11 requires an edited /etc/fonts/local.conf. (4) Installing the NTFS kernel module from the linux-ntfs.org RPM. Everything else just works.

Power management

First, I edited /etc/grub.conf, changing the line that reads:

kernel /vmlinuz-xxxxxxx ro root=LABEL=/ rhgb quiet

(where xxxxxxx is the kernel version) to:

kernel /vmlinuz-xxxxxxx ro root=LABEL=/ rhgb quiet acpi_sleep=s3_bios

Next, I created the following files:

Wireless Ethernet

Note: the following assumes you got the Intel 2200 wireless card; in January 2005 IBM was shipping this in the standard configuration, with other cards being optional, but this may have changed.

To make the ipw2200 driver work properly, you need ipw2200 firmware in /lib/firmware/. The version you need depends on which kernel you're running:

Kernel version ipw2000 version Firmware file names
2.6.16 v1.0.8 ipw-2.4-*.fw

I downloaded the tarball, su'd to root, and unpacked all files directly into /lib/firmware:

mv ipw2200-fw-2.4.tgz /lib/firmware
cd /lib/firmware
tar -xzvf ipw2200-fw-2.4.tgz

On next boot, the device was visible, and configurable via the GUI Network Configuration tool.

X11 fonts

Sub-pixel hinting is enabled for many fonts by default. On the ThinkPad's monitor, this makes fonts look terrible, with red and blue halos around the edges. (Actually, I've never in my life used a monitor for which sub-pixel hinting — whether in freetype or Microsoft ClearType — actually improves font quality, so I don't know why this technology exists.) So, I put the following lines in /etc/fonts/local.conf:

<match target="font">
  <edit name="rgba" mode="assign"><const>none</const></edit>
</match>

NTFS kernel module

I installed the RPM from linux-ntfs.org. No reboot needed.

The Fedora Core 5 page at linux-ntfs.org has a listing of RPMs. Be sure you get the right one for your kernel.

Restoring my data

I mounted my old hard disk inside the enclosure, logged in as root, and plugged the enclosure into the USB port. The drives were auto-mounted, and I copied all the files I wanted to transfer, mostly using cp, without much incident. Details follow.

This was actually a lot easier than I expected it would be.

Assembling the enclosure was easy --- I just needed a small cross or Phillips-head screwdriver.

After logging into root (under KDE), I plugged in the USB hard drive. This resulted in a flurry of dialog boxes, each asking if I wanted to mount one of the seven or eight partitions on my old hard drive. I chose to open each in a new window. The only ones I cared about (much) were my old /home and /mnt/transfer partitions.

My recipe for copying over the files from my old home directory (klee):

su klee
cd /home
rm -Rf klee
cp -RPf --preserve /media/disk-2/klee/ .

The rm -Rf operation will fail to delete the directory (because /home is owned by root), but that's OK; cp will do fine mirroring the directory structure.

My recipe for copying over files from my previous FAT32 transfer partition (must be done as root):

cd /mnt/transfer/
cp -RPf --preserve=mode,timestamps /media/TRANSFER/* .

Note that I had to use a glob, because the automounter decided to mount the FAT32 filesystem as /media/TRANSFER/ (all caps) instead of /media/transfer/.

For the NTFS partition, I decided I'd rather use Windows to transfer my files, so I rebooted into Windows, logged in as an administrator, and plugged in my device. Again, the USB drive was recognized (although only the NTFS and FAT32 partitions), and I was able to go through and copy all the files without much trouble.

When all of the above was done, I booted into Linux and logged into KDE as my user account (klee). My desktop and all my settings were exactly as they were before the upgrade. Mission accomplished.