Everyday Thaumaturgy
(It's a Miracle If I Get Anything Done Around Here)
a blog by William S. Statler

Laptop computer renovation, Part 3

Sat, 31 Jan 2009 19:00:00 PST

Today's project: partitioning the new hard drive and installing Windows XP. Partitioning also gave me a chance to play around with Ubuntu in the "live" mode (running from its intallation DVD and a RAM-disk).

Planning for partitioning

I'm not going to write a complete manual on drive partitioning. But here is a nice plain-English explanation I found in an on-line tutorial:

When the IBM PC was first launched ... IBM made a decision that a PC might ultimately have up to four operating systems installed at the same time. Each operating system would have its own portion of the disk, called a partition. For this reason, the first sector of each disk on a PC, called the MBR (Master Boot Record), contains a table with four entries, each giving the starting and ending locations of the four partitions. ...

It is also possible for a single operating system to use multiple partitions. For example, a user might decide to partition the disk with two partitions, one for the operating system and one for user data. ...

It was not too long before IBM and Microsoft decided that four partitions was not enough. Rather than simply make the partition table in the MBR bigger (which would not have been backward compatible with previous versions of MS-DOS), it was decided that up to three of the partitions could be marked as EXTENDED, meaning that they contained one or more subpartitions, called logical drives. A partition that is not an extended partition is called a primary partition. Together, the primary and extended partitions comprise the four top-level partitions.

For more information, start with Wikipedia's article on disk partitioning, and follow the numerous links.

Here's the partition scheme I've chosen for my Windows/Linux dual-boot system:

With only four partitions, I don't need to worry about extended partitions or logical drives; each will be a primary partition.

As a general rule, Windows needs to be installed first on a dual-boot system. So I'd been planning to take care of the disk partitioning during Windows XP installation. But I was installing Windows from the "Recovery and Applications/Drivers DVD" that came with my Toshiba laptop, and I noticed this ominous language on the disk box:

Using the full system recovery portion of this DVD will reformat your hard disk, and all the information currently on your hard disk drive will be removed.

That didn't sound like it's going to give me any options for partitioning — it was going to eat the whole drive. Bad.

So I started nosing around the Recovery DVD to see what it was actually going to do. I found the answer in the file \bin\hddpart.bat — yes, a blank drive would be partitioned into one big partition. However, the batch file checks first to see if there's already a partitioning scheme on the drive. If there is, Windows would be installed on Partition 1 (as long as it was at least 10 GB), and the other partitions would remain untouched.

That's just what I wanted; I only needed to find another way to partition the drive before installing Windows. No problem! The Ubuntu Live/Install DVD could do that for me.

An Ubuntu interlude

I booted from the Ubuntu 8.10 Live/Install DVD and selected the "live" option ("Try Ubuntu without any change to your computer"). It took a few minutes to boot (DVDs are slow). During this process, I noticed the fan speeds changing; this bodes very well for Ubuntu being able to automatically control the system's temperature without my having to resort to the lm-sensors package and its fancontrol script.

I found a "Hardware Testing" application under the Administration menu. This ran some basic tests for my audio, video, mouse (actually a touchpad), network controller, etc. I wasn't connected to the Internet so I couldn't test that, but otherwise everything seemed to be functioning.

Partitioning the hard drive

This was so simple it's hardly worth describing. I found the Partition Editor (a.k.a. "gparted") under the Administration menu. It has a simple and fairly obvious user interface that I won't bore you with. I set up the four partitions as described above, all unformatted for the moment.

And... I forgot to set the Boot Flag on the first partition. More explanation below, when this came back to bite me.

(So simple. Phbhthtthtthtt!)

Installing Windows XP Professional

I booted from the Toshiba Recobery DVD. After a couple of warnings and opportunities to back out, I was told that more than one partition had been found, and was given the option to restore only to the first partition and leave the others alone. (YAY!) Installation continued with the "Toshiba Restore Tool", which was clearly a customized version of Norton Ghost. It took about 13 minutes to copy the disk image.

And after a system restart, I got... a flashing underscore.

Another restart, another flashing underscore. No Windows XP.

Grr... Okay, I booted up Ubuntu again and checked if the partition was readable. Yup, it was fine. Grr...

Wait. (An ancient neuron twitched to life deep in my skull.) Didn't I vaguely remember that there was something special you have to do to make a partition bootable?

Yes, the Boot Flag. Windows won't boot unless the partition has a flag (a data bit) set to indicate that it's bootable. In the Partition Manager, I clicked on Partition 1, selected Partition –> Manage Flags from the menu, and marked the Boot Flag.

That's all it took. Windows XP started up on the next reboot. I accepted the huge EULA and went through the initial setup process, and after another restart I had a functioning Windows XP Professional SP1 system. I also installed Service Pack 3 (which I'd already downloaded from Microsoft and burned to a CD).

So at this point I have a working, nearly-up-to-date Windows XP installed on one partition, along with a useless antique Norton Antivirus 2003 that I need to replace ASAP, and a whole lot of unwanted old software that I will be uninstalling.

I should note that the computer was unplugged from the Internet through this entire process. There's a good reason for that: I didn't want Windows XP phoning home to Microsoft to activate itself yet. I may yet destroy something in the process of installing Ubuntu Linux and all the other things I need to set up, so I want to delay Microsoft's activation process until I'm sure I've got everything working.

So far, so good. Next step: Ubuntu.

Back to Part 2

Onward to Part 4

Copyright © 2009 William S. Statler (except for quotes and
contributions from other authors). This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
which grants limited rights of non-commercial distribution and reuse. Please read
for details. All other rights reserved.