Home > Tweaks/Guides > Elite Bastards guides > Dual-Booting Windows XP/2000/NT with Linux
Dual-Booting Windows XP/2000/NT with Linux Print E-mail
Written by Baz8080   
Saturday, 09 March 2002 00:00

How to dual-boot Windows 2000 and Linux by Baz8080
Revision 1: Wednesday, April the 17th, 2002

This article should have you dual-booting Windows 2000/NT/XP with Linux easily and safely. The problem that is presented by such a configuration is that both Operating Systems require the use of a boot-loader, and you may only have one in the MBR. I have to stress before I start that this guide, if not followed or understood correctly could lead to data loss, proceed with caution

Before I start it is worthwhile to know that many modern Linux-Based Operating Systems will automatically detect a Windows installation and set up a boot-loader accordingly. This guide is intended for those, that need or want to do this manually.


There are a number of ways that you can get around this issue, and I will describe one such method that uses Window's boot-manager, NTLDR, to start Linux. I will address the use of a Linux Boot-Manager such as LILO in a future revision of this document.

I make the assumption that you are prepared to do some re-partitioning in order to get the boot working. I also assume that you have at least a basic concept of what a disk-partition is and you are comfortable in working with this. If you do not, please stop reading this now, and ask for help in our Forums and post your query under the 'Linux' section.

If you get stuck further on, please also stop and ask us for help.

Right?, you're still with me so lets start:

1: You will need a working install of 2000/NT/XP

2: Install Linux. Linux will require a root (/) or boot (/boot) partition within the 1024 cylinder boundary of the hard-disk you intend to install it on. This is critically important, but luckily there are easy to use partitioning programs available such as Powerquest's "Partition Magic", or similar. The discussion of the installation of Linux is beyond the scope of this article, and you should consult the Manual that came with your Linux Distribution or the Vendor's web-pages.

During the installation process when you are asked to configure a boot-loader for Linux, choose to install LILO to a floppy disk. You will need this diskette for the following step:

3: When the installation program of Linux finishes, the system will probably be rebooted. It may not be, but my method covers both eventualities. You will need to boot your system from the from the floppy disk that you just created. It's a good idea to label and keep this one safe, because it can, and will get you out of trouble if something should ever go wrong in the future.

When your system boots, login as 'root' (Graphical or Textual mode does not matter). You should probably have a file called /etc/lilo.conf, which we are going to edit. If you do not have the file, simply create it as follows. (Though you _should_ have it in reality)

bash-2.04$ touch /etc/lilo.conf
bash-2.04$ chmod 611 /etc/lilo.conf

You'll also need to know the name of the partition where you have your root (/) filesystem. This is easy to get, just type 'df' at the command prompt and you will get something like this:

Filesystem   1k Blocks    Used     Available    Use%   Mounted On
/dev/hda1    123456       1234     98765        52%     /
/dev/hda5    15851        54748    4566         90%     /usr


Don't be daunted, all you have to look for is the '/' under 'Mounted on' here, and then trace back and take the value under 'Filesystem' that corresponds to it. In this case that value is '/dev/hda1'. This may and probably will be different on your system!. If you have s SCSI disk it will be something like '/dev/sda1/' etc. Please remember '/dev/hda1' and'/dev/sda1/' Are just examples, and your system will probably be different.

Knowing the partition of your root filesystem (/), now open the file '/etc/lilo.conf' in the text-editor of choice. The file should look like this:


# LILO configuration file
# Start LILO global Section
# ===================
# The following *must* be the partition number of your root filesystem (/),
# eg (/dev/hda1) that *you* determined above! so replace boot=/dev/yyy
# with whatever is appropriate to your system

boot=/dev/yyy
prompt
timeout=200 # Wait 20 secs.
vga = normal # Lilo will operate in text mode, safer.
# End LILO global section
# Linux bootable partition config begins

image = /vmlinuz # Where your kernel is located!!, this must be correct!
root = /dev/yyy # root-partition is here, same as the partition you entered for "boot=...." above.
label = Linux # What to label the kernel as!
# Linux bootable partition config ends
# Name other Linux kernel images here:
# ...

Now run LILO by typing this on the command prompt
bash-2.04$ /sbin/lilo

4: You'll now need to mount your floppy drive, /mnt is a good place to do so though you may mount it to any empty directory. Mounting the floppy drive will provide a method of accesing it. Assuming you are to mount to /mnt, issue the following command, where /dev/fd0 is your floppy:


bash-2.04$ mount -t fat /dev/fd0 /mnt

Copy the Linux Bootsector to your floppy drive by issuing this command, where /dev/yyy is the partition of your Linux Root (/) partition.

bash-2.04$ dd if=/dev/yyy bs=512 count=1 of=/mnt/bootsek.lin

5: Boot NT/2000/XP. . Copy the file "bootsek.lin" from your floppy drive and put it (bootsek.lin) in drive C: (C:\bootsek.lin)

Add the following entry at the bottom of the file boot.ini (This file is hidden, and read-only, change the attributes to edit)

c:\bootsek.lin="Linux"

The next time that you reboot you will have a shiny new entry in NT/2000/XP's boot-manager, highlight it, press enter and enjoy Linux! Smile Feel free to e-mail me at the following address, taking care to remove the ".nospam"


Baz8080. (baz8080@elitebastards.nospam.com)
 
eXTReMe Tracker