CLI Home
Archive

Dual Booting the
Clemson IBM Thinkpad T42:
Windows XP and Fedora Core 2
Part 1: Partitioning and Installation

Bill Moss
Updated June 7, 2004

Contents

Introduction
Disk Geometry
Partitioning
Installing FC2
Trouble Shooting

Introduction

This article reports on a dual boot installation of Fedora Core 2 (FC2) on a Clemson Laptop Program IBM Thinkpad T42 with a 40 GB hard disk. Recent reports of difficulties dual booting Windows XP and FC2 were the motivation for this report. Users have reported not being able to boot Windows after installing FC2. This problem is the result of changes in the 2.6 kernel. FC1 used the 2.4 kernel and did not have this issue.

Disk Geometry

Beginning with the 2.6 kernel, which is used by FC2, the method used for obtaining hard disk geometry has changed. Prior to 2.6, hard disk geometry was read from the BIOS and agreed with the values used by Windows. The 2.6 kernel reads the geometry directly from the hard disk. The BIOS geometry is referred to as a translated geometry and is characterized by a head count of 240 or 255, while the geometry read directly from the hard disk is referred to as the untranslated geometry and it is characterized by a head count of 16. By using a kernel parameter to specify the translated geometry, FC2 can be installed successfully.

Disk geometry is a mathematical model of the distribution of sectors on a hard disk. Each section contains 512 bytes. The actual physical layout of the disk can be considerably different from the model. Consider the model for the case of the T42 with a 40 GB hard disk which has a translated geometry consisting of 5168 cylinders, 240 heads, and 63 sectors. Imagine 120 circular platters spinning around a vertical shaft, each containing 5168 concentric circular tracks. The tracks can be read on both sides using 240 heads, and each track contains 63 sectors. A set of vertically aligned tracks forms a cylinder. The disk has a capacity of 5168*240*63 = 78140160 sectors = 40007761920 bytes = 39070080 KB = 38154.375 MB. Each cylinder has a capacity of 7.3828125 MB.

Partitioning

The Clemson Laptop program T42 with a 40 GB hard disk has 38154.4 MB of usable space. The hard disk is divided into C and D partitions of equal size (2584 + 2584 cylinders = 19077.1875 + 19077.1875 MB). The SystemRescueCD (www.sysresccd.org) contains three tools which are useful for manipulating partition tables: fdisk, parted, and qtparted. The utility fdisk shows the start and end of each partition in cylinders or sectors, parted uses MB's, and qtparted uses MB's and GB's. The utility qtparted provides a GUI interface for parted. Recent versions of qtparted can resize an NTFS partition.

Here is a combination of the output of fdisk and qtparted for the case where the secure desktop has been disabled in the BIOS. The secure desktop uses about 3.3 GB of disk space.

Partition Table, IBM T42 40 GB HD, Clemson Laptop Program Image, Windows XP

Pri/Log Partition Type Cyl Start Cyl End Size Start End
primary /dev/hda1 ntfs 1 2584 18.63GB 0.03MB 18.63GB
primary /dev/hda2 extended 2585 5168 18.63GB 18.63GB 37.26GB
logical /dev/hda5 fat32 2585 5168 18.63GB 18.63GB 37.26GB

There are a number of ways to generate a dual boot partition of your hard disk including.

  1. Use fdisk or qtparted on the SystemRescueCD to create a new partition table. Restore the Clemson Laptop Program C image into the ntfs partition. Restore the D image into the fat32 partition. Restore images of the FC2 ext3 partitions or else install FC2 from the distribution CD's.
  2. Use qtparted on the SystemRescueCD to resize the C and D partitions leaving space for the FC2 ext3 partitions but preserving your existing Windows data. Note that qtparted does not allow you to change the start points of the C, D, or extended partitions.
  3. Purchase the commercial utility Partition Magic. With this tool you can preserved your Windows data and you can adjust both the start points and end points of partitions.

Here are the steps for method 2 using qtparted.

  1. Resize the ntfs C partition /dev/hda1 to 9996.3 MB (1354 cylinders) by increasing the unallocated space at the end of the partition.
  2. Resize the fat32 D partition /dev/hda5 to 8460.7 MB (1146 cylinders) by increasing the unallocated space at the end of the partition.
  3. Commit these changes.
  4. Create a primary ext3 partition /dev/hd3 of size 96 MB (13 cylinders) starting at the beginning of the unallocated space following /dev/hda1.
  5. Create a primary ext3 partition /dev/hd4 of size 8984.9 MB (1217 cylinders) using all of the unallocated space following /dev/hda3.
  6. Create a logical ext3 partition /dev/hd6 of size 10099.7 MB (1368 cylinders) starting at the beginning of the unallocated space following /dev/hda5.
  7. Create a primary linux-swap partition /dev/hd7 of size 516.8 MB (70 cylinders) using all of the unallocated space following /dev/hda6.
  8. Make /dev/hd3 the active partition.
  9. Commit these changes.

Here is the final partition table, again combining output from fdisk and qtparted.

qtparted Partition Table

Pri/Log Partition Type Cyl Start Cyl End Size Start End
primary /dev/hda1 ntfs 1 1354 9.76GB 0.03MB 9.76GB
primary /dev/hda3 ext3 1355 1367 95.98MB 9.76GB 9.86GB
primary /dev/hda4 ext3 1368 2584 8.78GB 9.86GB 18.63GB
primary /dev/hda2 extended 2585 5168 18.63GB 18.63GB 37.26GB
logical /dev/hda5 fat32 2585 3730 8.26GB 18.63GB 26.89GB
logical /dev/hda6 ext3 3731 5098 9.86GB 26.89GB 36.76GB
logical /dev/hda7 linux-swap 5099 5168 516.77MB 36.76GB 37.26GB

Installing FC2

Here is summary of the installation steps that are not default choices.

  1. Boot FC2 disc 1 using a kernel parameter to specify disk geometry
    boot: linux hda=5168,240,63
    (cylinders,heads,sectors)
  2. On the Monitor Configuration screen, choose IBM 9514-B TFT Panel.
  3. Choose a custom install and choose to manually partition with Disk Druid.
  4. Set the mount point for /dev/hda3 to /boot and format using ext3.
  5. Set the mount point for /dev/hda4 to / and format using ext3.
  6. Set the mount point for /dev/hda6 to /home and format using ext3.
  7. Format /dev/hda7 as swap.
  8. At the boot loader configuration screen, edit Other to Windows XP, select the Configure advanced boot loader checkbox, and then
    • install the boot loader in /dev/hda3, and
    • type the kernel parameter hda=5168,240,63

Trouble Shooting

The master boot record (MBR) is stored in the first sector of the hard drive. The boot sequence for our setup depends on which partition is made active. If C (/dev/hda1) is the active partition, we have

  BIOS -> MBR -> C -> Windows boot loader -> 
      Windows XP booted

If /boot (/dev/hda3) is the active partition, we have

  BIOS -> MBR -> /boot -> grub boot loader -> 
      Select FC2 or Windows XP -> FC2 or Windows XP booted

The method of installation used here does not touch the MBR. Both OS's function independently, each has its own boot loader. If you make C (/dev/hda1) the active partition, you can delete the Linux partitions, and still boot Windows. If you make /boot (/dev/hda3) the active partition, the Linux boot loader grub gives you the choice of booting FC2 or Windows XP. If you install grub in the MBR, and then later decide to remove Linux, you will have to restore the MBR. This can be done using a Windows 2000 or XP installation CD. Boot to the recovery console and at the prompt type fixmbr.

The change in the way the 2.6 kernel handles hard disk geometry caught many dual booters by surprise. There have been reports of failure to boot and loss of data. Most of these problems are most likely due to the disk geometry problem. It is possible to recover from these problems without loosing any data by doing one or all of the following: fix the partition table, fix the MBR, reinstall grub. These fixes are outlined in a short article.