AdamH.us

Dual-booting Linux within Windows XP

I had a hard time finding an article online that discussed this topic, so I wanted to put one up for anyone else that wanted to know how to do it. First the reasons I had for setting it up:

  1. I already had a dual-boot system with XP/98 and didn’t want 2 boot menus.
  2. Linux was installed on the third partition of the second disk – not where LILO wants it to be. ;)

So, step 1: Partition your drive. If you already have XP installed on the full drive, I recommend a program like System Commander (the version I have is 7, but it’s now called Partition Commander). I’m sure there are others out there, but whatever program you decide to use needs to be able to resize FAT32 and NTFS partitions, and support for ext3/ext2/Linux Swap wouldn’t hurt either. Once you have acquired some kind of software, resize your partition to create enough free space for Linux. I gave Linux about 22 GB including about 2 GB for Swap. If your software supports Linux filesystems/partitions you can go ahead and create them, or let Linux do it for you when you install it later.

If you don’t currently have XP installed or you want to redo it, you can do the partitioning in XP setup. Setup XP to use some of the drive, but leave the rest unpartitioned. Then go ahead and install Windows and get everything the way you want, install software, etc.

Step 2: Install Linux. I installed Slackware, myself. Install and partition as you normally would during installation until you get to the LILO configuration. The way I set it up was no menu – boot right into Linux, install to root – NOT Master Boot Record. LILO will probably throw an error message, though. So what I ended up doing is using the DVD to load the Linux installation on the HD and then using lilo –P ignore command to install LILO. Though I’m sure you could install it to the MBR, boot into Linux and reinstall LILO to the root install rather than to the MBR. You would have to run XP recovery console and run fixmbr and then run fixboot to get your XP boot menu back, though. I have used this method, myself.

Step 3: Once you’re back in Windows, download and extract BootPart. Then run it from a command line window (Start>Run>cmd.exe) like this:

bootpa1

In this example, I would type bootpart 7 bootlinx.bin “Slackware Linux” to add the entry “Slackware Linux” to my XP boot menu. You should get this:

bootpa2

Notice it relists the partitions and then provides information:

Writing a boot sector using LBA position 109049220 (0x67ff584)
C:\bootpa26\bootlinx.bin written
C:\BOOT.INI updated

Now all that’s left is to reboot and boot into Linux!

Enjoy!

© 2009, AdamH.us. All rights reserved. Please link back if you use it!


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!