how to avoid Windows MBR from overwriting and corrupting Grub

Hia.

I recently had some issues with my duel boot situation. I had opensuse/winxp running.

First windows xp wouldn’t boot - then opensuse **** out and I had nothing but a black screen. I spent about two days trying to figure out what in god’s name happened. I finally got a copy of winxp recovery disk and it couldn’t find the partition that windows was on. That gave me some idea of what was going on. So I tried to fix the matter from partitionmagic. I reinstalled grub making sure that everything was associated properly. I still couldn’t get either opensuse or windows to boot after many many different trial and error attempts.

After deciding there was no help for it. I decided to slave my hard drive and wipe to start over. So I booted partition magic from USB and deleted my opensuse partition and -what do you know - windows booted right up. Aside from feeling windows xp’s smug grin as the logo appeared - i am perplexed as to how this happened. My guess is that MBR tried to overwrite grub. But I think that the loader was confused and trying to boot from the wrong partition.

I want to reinstall opensuse again. However I want to make sure that this doesn’t happen. I need my xp partition for examsoft because wine doesn’t seem to work for it and I can’t vbox it. So is there some way to make sure that when I do install from DVD on my USB that:

  1. repositories are correct
  2. MBR doesn’t overwrite grub (should I install Grub2 or LILO?)

If someone could point me to a TUT or some general advice would be helpful. Thanks.

I would start here. He has some very useful info about the problems of multi-booting. GRUB Boot Multiboot openSUSE Windows (2000, XP, Vista) using the Grub bootloader.

Thank you! I understand what happened now. I was trying to set up the non-mbr boot and I think it wasn’t properly set to boot from the windows primary boot partition.

XD

This is very simple … well…

  • Either you have a boot manager in MBR (for example Grub), which let you choose the OS you want to boot. This is not openSUSE’s default. However it works pretty well, as long as you don’t repair Windows - which will for sure rewrite the MBR and so destroy the Grub bootloader.
  • Or you have a “generic boot code” in MBR which does nothing but pass the control to the active partition, which in turn will boot. Is this the Windows partition, Windows will boot. In this the Linux partition which contains the Grub boot loader in its bootsector (= first sector of the partition), the Grub bootmanager will show up. So the Grub bootloader, called stage1, which have a size of 1 sector (512 byte) can be installed either in the first sector of the disk (MBR) or in the bootsector of any partition (except the Windows partition).
  • Or you have both - which is possible too (you can install Grub stage1 in several locations).

I said this is simple … well, it can be tricky too. But be aware that reinstalling, reformating, removing or wiping out partitions in most cases (basically in all cases except when you have a partition alignement issue) won’t solve the problem. Most of the time, it’s enough to change the bootflag (switch the active partition) and/or reinstall Grub. Better ask here before spending your time reinstalling!

XP is very picky about how it is booted, and when setting up a multi-boot you can easily go wrong. For several years my main desktop machine was set-up with Suse on one hard drive and XP on a second, and every time I updated GRUB I had to fix it by hand. After a couple of times I got the hang of it using one of Swerdna’s tricks.

Glad you got it sorted.