# Dual boot XP and Linux

## eyevee99

I wish to install linux on my workstation, and have it dual boot with XP.

I can't install GRUB or Lilo on the MBR or it will kill the NT boot sector rendering XP useless (bad for me).

So I installed GRUB on the /boot partition of the linux install.  This allows me to boot from floppy.

How do I update XPs boot manager to look for Linux and therefore give me an option for which OS to boot?

Thanks

----------

## vilanox

I also had XP on my machine prior to installing Gentoo. I took a gamble and installed Grub into the MBR. It worked and I can dual boot.

----------

## zend

 *vilanox wrote:*   

> I also had XP on my machine prior to installing Gentoo. I took a gamble and installed Grub into the MBR. It worked and I can dual boot.

 

can you give out your /etc/fstab and your step?Thank you very much

----------

## dr-nix

when i add my xp hd (its on my other hd) (root (hd1,0) it sez uknown filesystem 0x7 r summn like that and it sez booting "Windows XP" (i labled it that way...  anyways i added my xp partion in grub like this ->

root (hd1,0)

makeactive

chainloader +1

in /boot/grub/menu.lst that is...

----------

## dr-nix

to clarify...i add that conf in menu.lst ...reboot and when i get the menu i choose the xp option and the lable comes up and the 3-4 configuration lines...but it doesnt boot it just stays there... its soooo annnoying ...btw it also sez "uknown filesystem" (due to the hd beeing ntfs)

----------

## Guest

As far as I'm aware, you can't copy over the boot sector of an NT drive (ie, NT, 2K or XP) because NT can't boot without that info.  It says "unknown file system".

----------

## Guest

Hey dr-nix ,

I had the same problem with win2k on my other hd.  I solved it by doing this: 

Try adding this in your menu.lst 

map (hd0) (hd1)

map (hd1) hd0)

-> not sure anymore if it was before the root line or the makeactive ... try the root line  :Smile: 

You can also try these lines at boot time by pressing 'e' .  That way you can see if it works before adding it to your menu.lst

Good luck

----------

## dr-nix

that fixed it thanks alot !  :Smile: )

----------

## vilanox

woops...I forgot my last windows install was fat32 not ntfs. I'm not knowledgable enough yet to  know how each file system affects the MBR. I do remember I installed Mandrake8.1 after an XP ntfs install. Mandrake auto-installed LILO into the MBR and I had no problems dual booting. I'm not sure how grub behaves differently.

If it doesn't make a difference, my menu.lst entry for windows for grub is:

title=WIndows

rootnoverify (hd0,0)

makeactive

chainloader +1

As for /etc/fstab, I followed the installation instructions and added my windows partition after the linux ones.

Hope that cleared it up and could be helpful.

vilanox

----------

## eyevee99

Perhaps it's possible to overwrite XPs MBR then?

Not really keen to test the theory  :)

Is it possible to set up XPs boot manager to boot linux?

XP has a boot manager built in (ie, if you have 98 and XP for example, a boot manager can be started by hitting F8 during boot, which then gives the option of which OS to boot)

My Computer - Properties in XP, then Advanced, Startup Settings, is where the boot manager info is.

It is set up as follows

[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /fastdetect

This indicates I should be able to add a new OS to boot, but I'm not sure of the exact format.

I suspect it's as follows (linux is installed on the primary drive attached to the secondary IDE controller, and the grub bootloader is intalled on the /boot partition, which is the first partition on the drive)

multi(0)disk(0)rdisk(2)partition(1)="Gentoo Linux"

But I don't really have any idea.

:)

----------

## Ozymandias

 *eyevee99 wrote:*   

> 
> 
> multi(0)disk(0)rdisk(2)partition(1)="Gentoo Linux"
> 
> 

 

whell, that will be the day! no, if you want the ntldr to load linux jou must copy the first 512 bytes of your kernel (or lilo or grub) onto the partition and then tell the bootloader to boot that! But just forget about that, do the following:

just install grub on your /boot partition (not MBR!) and flag that one beiing bootable. That means that grub gets loaded without breaking XP. Then use a rootnoverify (hdX,X) and chainloader +1 to boot XP from Grub. Mind you guys that this doesn't work from grubs command prompt! There is a little bug in Grub. If nothing works, just make the XP partition bootable again and you will be fine (though back at square one). And don't use the makeactive command! If you have more than one harddisk, perhaps you need map(hdX,hdX) but I don't thing so.

greetz Ozy

----------

## klieber

 *eyevee99 wrote:*   

> Is it possible to set up XPs boot manager to boot linux?
> 
> 

 

Check out this document.  It tells you how to dual-boot linux and NT while maintaining the NT MBR. (process is the same for NT, 2000 and XP)

http://www.tldp.org/HOWTO/mini/Linux+NT-Loader.html

----------

## Buzzz

I see all those difficult solutions, which need many different actions. 

I use lilo for booting (I'm very familiar with it), and I did the following:

After installing the system and before installing grub I did an emerge lilo. Then I exited the chroot and created /etc/lilo.conf like this:

```

boot=/dev/hda

prompt

timeout=50

lba32

default=winxp

image=/boot/bzImage

    label=linux

    read-only

    root=/dev/hda9

other=/dev/hda1

    label=winxp

```

I copied this file to /mnt/gentoo/etc/lilo.conf

I ran /mnt/gentoo/sbin/lilo and my bootmanager was up and running, booting Windows XP and Gentoo linux!!

----------

## eyevee99

XP is on my primary IDE master (hda0)

Linux is on my secondary IDE master (hda3)

Cheers,

Ryan

----------

## TeraTorn

Im fairly certain that after a winxp install, you have just a generic boot loader in the MBR that locates and transfers control to the boot sector of your win partion, from where the actual NT boot loader screens appears.

Therefore, it's safe to install another boot loader in the MBR, just follow the instruction in install.txt on the boot cd.

I have Gentoo and GRUB and Win XP all working fine and I did exactly like the example in the install text.

Good Luck.

----------

