Reinstalling Windows XP on an Acer Aspire One with Linux on it

About a year ago I got myself an Acer Aspire One, because it had a keyboard I could touch-type on
normally. I got a Windows XP version although I was only planning to run Linux on it, because I
could only get a Linux powered one with an 8 GB SSD. I thought that was a little small for my
needs.

When I installed Linux I'd made sure to leave the restore partition alone, I might need it if I
wanted Windows XP again. No install disk was provided. Fair enough, the device doesn't even have a
drive for it, but what if I wanted to run Windows and install a bigger hard drive?

It was time to restore Windows. I also wanted to keep running Linux on it, so I backed up my home
dir and ran the restore program. This was easy, it was an option in my Linux bootloader, which
thought the restore partition was a Windows 2000/NT install. However it didn't work because it expected
the partions right how they were before I installed Linux.

So I fired up a live Linux USB drive (Ubuntu 9.10) and changed the partitions. You can use
something like Gparted for this, it's on most live distributions. Then the bootloader
didn't work any more, so I couldn't start the restore option. What you usually do is grab your
Windows install disk and use the recovery console's Here's what I did to fix everything:

Make sure the partitions are set up correctly. In my case this meant having the restore
partition first, and all the remaining space was one fat32 partition. I formatted it fat32 just
in case, but I'm not sure this step is required. Also make sure the first partition is set
to bootable.

Then I needed to set up the MBR so it would boot into the restore partition. For this
you use the program install-mbr. I had to do sudo aptitude install mbr
before I could do this.

-p D (start the system by loading the partition that has the bootable flag set)

-t 0 (timeout before booting is 0)

/dev/sda (The drive to install the MBR on, in this
case /dev/sda, the only hard drive on the system.

You will now be able to boot into the restore program, and restore Windows. Once the system
reboots, you'll get the restore program again and again. You can use install-mbr
with different options to make the Windows partition the bootable partition, but since I'm going
to install Linux on this, which has it's own boot menu facilities, there's no need.

The final task is to install Linux. I used Kubuntu 9.10 which allowed me to resize the Windows partition without
destroying it, as part of its installation process. Once the install was finished, I got a nice
boot menu offering Linux, Windows XP, and the restore program, called something like "Windows
NT/2000". Note that the restore program won't work until you reset the partitions to their
factory state like I explained above.