[ltp] Installed Grub to MBR, now can't boot XP (dual boot config)

Simon Williams linux-thinkpad@linux-thinkpad.org
Wed, 17 Jan 2007 10:14:16 +0000


Greg Kimberly wrote:
> I have a T41 upon which I've installed Ubuntu 6.10 (Edgy). I'm now in
> the seemly unusual situation of being able to boot linux and the
> recovery tools, but not XP. My drive layout is:
> 
> hda1 XP
> hda2 swap
> hda3 ext3 (root of ubuntu)
> hda4 (extended partition)
> 	hda5 rescue and recovery
> 
> I started with 
> 
> title           Windows
>  root            (hd0,0)
>  chainloader     +1
> 
> This boots the rescue and recovery section.

you need to add the line:
rootnoverify (hd0,0)

>>From http://thinkwiki.org/wiki/Rescue_and_Recovery
> 
> I got the following for a grub boot profile 
> 
> title           Windows
>  root            (hd0,0)
>  hide            (hd0,4)
>  chainloader     +1

Ditch the hidden stuff- you don't need it.

> And I then played with trying various hide cmds and now it  won't boot
> at all. I now get an error 17 from grub. Never mind that parted (reached
> via the Ubuntu bootable CD) doesn't show any hidden bits set at all -
> apparently grub sets them in a way that parted can't see? Ack!

The partitions are hidden while grub is "running", so they are only 
hidden to systems that grub has booted. It does not change anything on 
your disk.

Reboot to the ubuntu CD, you haven't booted grub on your hdd so the 
partitions are visible- mount your ubuntu partition so you can see 
/boot. Remove the hidden lines from /boot/grub/menu.lst. Reboot and it's 
all fixed.

> As for the original error (can't boot XP only rescue) I take it that
> when I installed Ubuntu, it squashed the windows boot loader and thus
> there isn't a normal XP bootloader? 

Well, yes and no. Windows is semi-helpful in the sense that while their 
bootloaders are completely rubbish, they are required for loading 
windows and store them in the partition (/dev/hda1) rather than the MBR 
(/dev/hda). There is a very simple bootloader installed in the MBR which 
essentially does that same as grub- it chainloads the bootloader on 
/dev/hda1. That is the one you will have wiped and so it doesn't matter.

Hope this helps
Simon