Creating a Dual-Boot Windows XP and Ubuntu Laptop

by Kevin Farnham

Transforming an XP Laptop into a Dual-Boot XP/Ubuntu Linux System

Notebook computers are generally preloaded with Windows XP, but for those of us who do considerable work in the Linux environment, a Windows-only notebook is far from ideal. I worked with Unix on Windows packages such as Uwin and Cygwin for several years, but I finally decided I wanted a full Linux installation on my notebook.

I started with my aging Toshiba laptop (which had about 90 percent of its 30GB disk filled) and, without losing any data, turned it into a dual-boot XP/Ubuntu Linux system with a shared partition where many of my user files were accessible whether I was using XP or Ubuntu. This made the laptop much more versatile, which is ideal for a developer who works in Linux but must also work in Windows for certain applications or for Windows-based development. A few months later, the monitor on that machine gave out. I bought a new HP notebook and transformed it into a dual-boot XP/Ubuntu Linux system right away.

This article describes the steps I took to complete the dual-boot conversions.

Prerequisites: Disk Space and CDs

As you might expect, a dual-boot computer requires more disk space than a computer running just one operating system. I don't recommend performing an XP/Linux dual-boot conversion with a drive smaller than the 30 GB that my older notebook had. A system with 60+ GB of disk space is a more ideal starting point.

When reconfiguring operating systems on a hard drive, you must be able to boot the system using a CD that has appropriate tools for disk partitioning, file editing, etc. I used the System Rescue CD, a Gentoo Linux 2.4 Live CD with system utilities including QtParted, Grub, Lilo, archiving tools, editors, CD tools, Perl 5.8, CaptiveNtfs, and others. I downloaded the ISO image file using Windows and made my CD using Alex Feinman's excellent ISO Recorder.

I downloaded the installation ISO file for Ubuntu 5.10, "The Breezy Badger," at Ubuntu's download page. Again, I made the CD using ISO Recorder.

Windows Disk Preparations

If you're converting a Windows system you've used for some time, the disk may be nearly full, and the files will likely be scattered across it. To install Linux, you need to divide the disk into multiple partitions. One way to do this is to destructively repartition the entire disk, but then you have to reinstall Windows and all of your Windows software--not a pleasing prospect. A better solution is to resize the Windows NTFS partition, then add new partitions for Linux, Linux swap space, and a FAT32 shared partition.

Because my Toshiba notebook's disk was 90 percent full, the first thing I had to do was remove files. If you're in this situation, see how much space you can free up by:

  • Backing up all critical files (or performing a full system backup if you have capability to do that)
  • Removing Windows software you never use and never plan to use, using "Add or Remove Programs" in the Windows Control Panel or uninstalling programs that came with the software
  • Removing unneeded data files
  • Moving documents, data files, and project workspaces (for example, software development directories) that you can later store temporarily in the new shared partition to another computer
  • Emptying the Windows Recycle Bin

Doing all of these things decreased my Windows disk usage to 10 GB, leaving 18 GB free. However, the files were still scattered across the disk.

Before you can resize the NTFS partition, you must move all files to the "front" of the disk. You can see the locations of files on your disk by running the Windows Defragmenter utility. Go to Start->All Programs->Accessories->System Tools->Disk Defragmenter to launch the defragmenter. Figure 1 illustrates my disk usage after the defragmentation cycle completed.

disk usage after defragmenting
Figure 1. Notebook disk usage after running the Windows disk defragmenter

The files were not as completely packed into the "front" of the disk (the left side of the Defragmenter diagram) as I would have expected. A little research revealed that the Windows Defragmenter applies a less comprehensive defragmenting approach than is available in some commercial programs. I decided to rerun the Windows Defragmenter. After three more runs, my disk usage looked more like Figure 2.

disk usage after four defragmentations
Figure 2. Notebook disk usage after four Windows disk defragmenter runs

This looked adequate. More than half of the disk was available for my Linux installation, Linux swap, and the shared FAT32 partition.

One problem you may encounter in defragmenting a Windows disk using the Windows Defragmenter is "unmovable files" (the green bars) located in inconvenient locations (on the right side of the display, near the end of your disk). The two most common unmovable laptop files are the Windows operating system paging file (pagefile.sys) and the hibernation file (hiberfil.sys), which stores the system state when the XP operating system goes into "hibernate" mode. An easy solution is to temporarily remove these files, then reinstall them after you've resized the NTFS partition. If you need help with this, see my blog entry "Moving the Unmovable: Windows Disk Defragmentation Strategies."

Pages: 1, 2, 3

Next Pagearrow