Dramen
06-14-2002, 01:26 PM
This is how to dual boot W2k or XP & Linux and add Linux to W2k/XP Boot Menu:
1. Install W2k or XP. Partition part of it for W2k/XP (either NTFS or FAT32 will work).
2. Install Linux (any distribution).
You have to follow the following two steps exactly:
a. When asked where to install LILO, DO NOT install LILO in the MBR (Master Boot Record), since this will overwrite Windows OS Loader and you may have to reinstall W2k/XP. Instead, install LILO in other partition (superblock of the root partition of Linux drive).
b. Create a Linux boot disk. For now, this will be your only way of booting up to Linux.
3. After you have finished installing Linux, boot up to Linux (use the Linux boot disk).
4. Dump Linux boot sector to a file. Type the following:
dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1
If your linux boot partition is not in the hda2 partition, change if=/dev/hda2 accordingly (use df to get the correct partition).
For example, if your linux boot partition is in hda3, change the command to:
dd if=/dev/hda3 of=/bootsect.lnx bs=512 count=1
Once you run this command, you will have bootsect.lnx file in "/" (root) directory.
5. Mount a DOS formatted disk. Type:
mount -t msdos /dev/fd0 /mnt
6. Copy the bootsect.lnx file to the diskette:
cp /bootsect.lnx /mnt
7. Boot up to W2k/XP (by removing the Linux boot disk).
8. After booting up to W2k/XP, insert the DOS disk, and copy the file A:\bootsect.lnx to C:\ drive.
9. Edit C:\boot.ini. Usually this file is not visible. Start notepad, then open file C:\boot.ini. Add the following line to the bottom of the file:
C:\BOOTSECT.LNX="Linux"
10. Now reboot, and you will have the option to boot either to Windows or Linux.
Below is my Boot.ini, which is set up to boot XP, XP cmd console, Mandrake and RedHat.
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(3)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Microsoft XP Professional"
C:\CMDCONS\BOOTSECT.DAT="Microsoft Recovery Console" /cmdcons
C:\BOOTSECT.LNX="RedHat Linux"
C:\BOOTSECT.LUX="Mandrake Linux"
1. Install W2k or XP. Partition part of it for W2k/XP (either NTFS or FAT32 will work).
2. Install Linux (any distribution).
You have to follow the following two steps exactly:
a. When asked where to install LILO, DO NOT install LILO in the MBR (Master Boot Record), since this will overwrite Windows OS Loader and you may have to reinstall W2k/XP. Instead, install LILO in other partition (superblock of the root partition of Linux drive).
b. Create a Linux boot disk. For now, this will be your only way of booting up to Linux.
3. After you have finished installing Linux, boot up to Linux (use the Linux boot disk).
4. Dump Linux boot sector to a file. Type the following:
dd if=/dev/hda2 of=/bootsect.lnx bs=512 count=1
If your linux boot partition is not in the hda2 partition, change if=/dev/hda2 accordingly (use df to get the correct partition).
For example, if your linux boot partition is in hda3, change the command to:
dd if=/dev/hda3 of=/bootsect.lnx bs=512 count=1
Once you run this command, you will have bootsect.lnx file in "/" (root) directory.
5. Mount a DOS formatted disk. Type:
mount -t msdos /dev/fd0 /mnt
6. Copy the bootsect.lnx file to the diskette:
cp /bootsect.lnx /mnt
7. Boot up to W2k/XP (by removing the Linux boot disk).
8. After booting up to W2k/XP, insert the DOS disk, and copy the file A:\bootsect.lnx to C:\ drive.
9. Edit C:\boot.ini. Usually this file is not visible. Start notepad, then open file C:\boot.ini. Add the following line to the bottom of the file:
C:\BOOTSECT.LNX="Linux"
10. Now reboot, and you will have the option to boot either to Windows or Linux.
Below is my Boot.ini, which is set up to boot XP, XP cmd console, Mandrake and RedHat.
[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(3)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="Microsoft XP Professional"
C:\CMDCONS\BOOTSECT.DAT="Microsoft Recovery Console" /cmdcons
C:\BOOTSECT.LNX="RedHat Linux"
C:\BOOTSECT.LUX="Mandrake Linux"