[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Configure grub for Windows XP on second HDD



Am 19.04.2008 um 17:54 schrieb Michael Wilson:

I have Linux on hd0 and Windows XP Home on hd1 (I installed XP with the Linux disk disconnected so Windows couldn't mess with it). If I configure the BIOS to make the Windows drive the first, Windows boots fine, but I can't figure out how to configure GRUB to boot windows when the Linux disk is first. At
the moment, at the end of my menu.lst, I have:

title           Windows XP
map             (hd0) (hd1)
map             (hd1) (hd0)
rootnoverify    (hd0,0)
chainloader     +1
makeactive

Which is close as I can get, but still no cigar. Can anyone help?

Try rootnoverify (hd1,0) instead of rootnoverify (hd0,0), that should work.

As others have noted, searching the web gives you fuzzy results as a lot of people have typos or don't quite understand how GRUB works (it's pretty hard and at times unpredictable!), and the example configuration given in GRUB's
official documentation regarding this toping at
<http://www.gnu.org/software/grub/manual/grub.html#DOS_002fWindows>
is more confusing than helpful, in my mind.

Anyway, in the rootnoverify command, you always use the hard disk number (i.e. hd0 or hd1 or hd2 etc.) according to the order given by the BIOS, no matter if
you use the map command or not.

GRUB always uses the order of disks it gets from the BIOS. If you have two ATA drives in your computer labelled "A" and "B" and tell the BIOS to try to boot from "A" before "B", the "A" disk will correspond to hd0 and the "B" one to hd1. If you tell the BIOS to boot from "B" disk before "A" disk, it will be
the other way round (hd0 for "B", hd1 for "A").

You then tell GRUB from which device to boot. If it is a system GRUB natively supports (such as Debian), you use the root command. If it is a 'foreign'
system (such as Windows, but also others), you use rootnoverify.

Windows is, again, special in that it wants to be on the first drive only, so you have to use the map commands as in your example. However, this doesn't affect the syntax in rootnoverify, so you still need to use "rootnoverify (hd1,0)" if Windows is on the second drive (according to BIOS order). As far as I know, you could even reverse the order of the rootnoverify and the map commands, i.e.:

title           Windows XP
rootnoverify    (hd1,0)
map             (hd0) (hd1)
map             (hd1) (hd0)
makeactive
chainloader     +1

I think that is what I did (don't have access to the file at the moment) because
this appears more logical when reading the file later.

-Moritz



Reply to: