Click to See Complete Forum and Search --> : Confused about GRUB and XP


Yippee38
07-02-2004, 01:06 AM
I've got WinXp Home loaded on my system and I loaded SuSE 9.0 on another partition today. I cannot get XP to boot. Linux boots fine.

On top of that, I can't mount my C: drive in linux. I can mount all of the other ntfs drives, but not that one. I get the standard, "wrong fs type, bad option, bad superblock on /dev/hde1" error.

I've read a lot of the grub related posts here, but I haven't found any that help.

So here's the setup.....
Primary Master = hd0 - /hde
Primary Slave = hd2 - /hdf
(I don't know why SuSE insists that those drives are set up that way)

On the Raid controller:
Primary Master = hd2 - /hda
Primary Slave = hd3 - /hdb

WinXP (C: drive) is on /hde1. All /hdb, /hde, and /hdf partitions are windows partitions. /hda partitions are linux partitions. Root is /hda7.

My fstab entry is:
/dev/hde1 /windows/Programs ntfs ro,users,umask=0007,gid=100 0 0 (this is pretty much the same as my other ntfs drives which mount correctly).

Since Windows is on hd0, I don't think I should need the "map" command, or the "chainloader" command. The only think I've got in the Windows section of my /boot/grub/menu.lst is:
root (hd0,0)

What am I missing? I've read so many things on Grub now, that I'm totally confused (or maybe it's just because I'm tired).

Uranus
07-02-2004, 06:14 AM
Originally posted by Yippee38
Since Windows is on hd0, I don't think I should need the "map" command, or the "chainloader" command. The only think I've got in the Windows section of my /boot/grub/menu.lst is:
root (hd0,0)
I'm quite sure you do need the chainloader command - what it does, is, actually, passing on the "bootloader" task to a bootloader on the Windows partition (same thing for FBSD). Try changing the GRUB Windows section to the following:
title Windows XP
rootnoverify (hd0,0)
chainloader +1
And try booting into Windows then - having only root (hd0,0) in the section is absolutely useless, since all it tells grub is to use (hd0,0) kinda like the / partition when looking for files, unless noted otherwise.
HTH
Sam

Yippee38
07-02-2004, 08:30 AM
Originally posted by Uranus
[B]I'm quite sure you do need the chainloader command - what it does, is, actually, passing on the "bootloader" task to a bootloader on the Windows partition (same thing for FBSD).

Ok. So it is kinda like saying, "Grub, let that the bootloader in that partition (which happens to be for WinXP) take over the booting." Right? If so, that makes sense.

Try changing the GRUB Windows section to the following:
title Windows XP
rootnoverify (hd0,0)
chainloader +1

I get and echo of those two commands and the GRUB message and the machine hangs. This isn't the first time I've seen that, and I've read that I should boot to the rescue system, chroot, the do grub-install. However, I don't know what parameter to pass to grub-install. Do I use "grub-install /dev/hda" or "grub-install /dev/hde"? When I set up GRUB using YAST, the "Boot Loader Location" is set to /dev/hde. Since that's the first drive the BIOS loads, it makes sense that the boot loader should be there. Right?

Related question: If the MBR in WinXP is hosed, do I have to run FIXMBR (from the WinXP disk) AND FIXBOOT, or is just FIXMBR sufficient (if necessary at all)?

Uranus
07-02-2004, 08:55 AM
Originally posted by Yippee38
Ok. So it is kinda like saying, "Grub, let that the bootloader in that partition (which happens to be for WinXP) take over the booting." Right? If so, that makes sense.

I get and echo of those two commands and the GRUB message and the machine hangs.

This isn't the first time I've seen that, and I've read that I should boot to the rescue system, chroot, the do grub-install. However, I don't know what parameter to pass to grub-install. Do I use "grub-install /dev/hda" or "grub-install /dev/hde"? When I set up GRUB using YAST, the "Boot Loader Location" is set to /dev/hde. Since that's the first drive the BIOS loads, it makes sense that the boot loader should be there. Right?

Related question: If the MBR in WinXP is hosed, do I have to run FIXMBR (from the WinXP disk) AND FIXBOOT, or is just FIXMBR sufficient (if necessary at all)?
Part 1: Yes
Part 2: You don't make sense, sorry...
Part 3: If something's wrong with the grub installation, indeed reinstall - grub-install /dev/hde sounds ok. Dunno if that's the problem though.
Part 4: The MBR in WinXP? You said you installed SuSe on an extra partition, thus, I'd guess the general MBR? If all's well, the MBR contains GRUB (unless you reinstalled WinXP after installing GRUB) - WinXP has its own bootloader on its own partition, not in the MBR.
Sam

Yippee38
07-02-2004, 09:19 AM
Originally posted by Uranus
Part 2: You don't make sense, sorry...

What I meant was, when I try to boot to Windows, the screen displays the stuff between the lines here:
=====================
rootnoverify (hd0,0)
chainloader +1

GRUB
=====================
and hangs. That is not a grub prompt (grub>).

Part 3: If something's wrong with the grub installation, indeed reinstall - grub-install /dev/hde sounds ok. Dunno if that's the problem though.

I don't either. Any suggestions on how I can troubleshoot what the real problem is likely to be? I suspect that the problem is not GRUB, because I can still boot to Linux just fine using GRUB. That tells me (if I'm understanding things correctly) that GRUB is in place in /hde, and that it works. It seems to me that my problem is just getting GRUB to get the WinXP bootloader working.

Part 4: The MBR in WinXP? You said you installed SuSe on an extra partition, thus, I'd guess the general MBR? If all's well, the MBR contains GRUB (unless you reinstalled WinXP after installing GRUB) - WinXP has its own bootloader on its own partition, not in the MBR.
Sam

Ok. I think I'm beginning to become less confused. I was thinking that WinXP booted directly off a the MBR. Instead, I think the MBR has the main bootloader (whether that is GRUB or the one installed by WinXP) which then tells the system to boot to XP on /hd0, or Linux on /hd2, or whatever.

Uranus
07-02-2004, 09:53 AM
Originally posted by Yippee38
What I meant was, when I try to boot to Windows, the screen displays the stuff between the lines here:
=====================
rootnoverify (hd0,0)
chainloader +1

GRUB
=====================
and hangs. That is not a grub prompt (grub>).

Ok. I think I'm beginning to become less confused. I was thinking that WinXP booted directly off a the MBR. Instead, I think the MBR has the main bootloader (whether that is GRUB or the one installed by WinXP) which then tells the system to boot to XP on /hd0, or Linux on /hd2, or whatever.
Could you try with the following (seems to be needed sometimes):
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1

Have a look at the following How-To if you're interested in all the MBR/BIOS/Bootloader stuff:
http://www.tldp.org/HOWTO/From-PowerUp-To-Bash-Prompt-HOWTO.html
It explains exactly what happens from when you push the power-button until the computer is booted.
Sam

Yippee38
07-02-2004, 10:54 AM
Originally posted by Uranus
Could you try with the following (seems to be needed sometimes):
title Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1

I'm at work now, so I can't play with it, but I'll try it as soon as I get home.

I'm gonna try to read through that How-To if I have some free time. Thanks for the link and they help!

Yippee38
07-02-2004, 04:35 PM
That didn't help. I got....

rootnoverify (hd0,0)
makeactive
chainloader +1

GRUB
<hang>

Yippee38
07-03-2004, 02:47 PM
FWIW, I figured out what was the problem.

Apparently, at some point in reconfiguring GRUB through YAST, I set it to load to /hde1 instead of /hde. The obvious result was that I overwrote WinXPs boot sector. I had run FIXMBR, but that kept leaving me with the GRUB prompt. That stumped me, but then I realized that the MBR was fine, but it was then pointing to the WinXP boot sector which had GRUB on it. So I used Windows Recovery Console from the WinXP CD again, and ran FIXBOOT. I then did FIXMBR again. When I rebooted, Windows booted fine.

So, reboot with SUSE disk in, select Install, cancel out and boot to my root partition. I reran the YAST boot loader tool, and let it "Propose New Configuration." It set up GRUB into /hde and set up sections for Linux, Floppy, and Failsafe. Fine. Reboot. That works fine. YAST bootloader, "Proposed New Configuration" again, and it added a Windows section, but move the bootloader to /hda. I changed it to /hde. Reboot and select Windows at the GRUB menu. GRUB hang. Crap. Reboot with the linux disk and go back to the bootloader and "Propose New Config." It reset it to just linux stuff (like above). Good. Reboot. Linux boots fine. Go into YAST bootloader and manually add a section for Windows that looks like this:

Section Name Windows XP
Section Type other
-----------------------
root (hd0,0)
chainloader +1

Reboot. Works great. I then rebooted to Linux, went into the YAST bootloader and moved the WinXP section to the top and made it default.

GRUB now works just like it is supposed to for me.

I hope this helps anybody else who ends up with a similar problem.

Thanks VERY much for your help Uranus!!!