Hi I am a new user here. I had Windows 7 in a partition and OpenSuse 12.2 in another partition of my hard disk, but when I installed Windows 8 in win7 partition, the Grub does not appear anymore. I know the Windows overrode the MBR. I have been trying to recover the grub2 but all the documentation I have found is for Ubuntu… Can anybody help please?
there you go:
http://forums.opensuse.org/content/128-re-install-grub2-dvd-rescue.html
that’ll get it done,
Hugh
Although it will immediately solve the boot problem, it might not restore the boot situation you had before installing Windows. Assuming you had the Grub boot loader in the extented or the Linux root partition (if it’s a primary partition) - which is the most common case and also openSUSE’s default, all you need to do is to set the boot flag back on the Grub partition. This can be achieved with fdisk or sfdisk from any Linux live system or with gparted or many other tools.
If you had Grub in MBR before, then indeed reinstalling Grub by following the method in the article linked above is the way to go.
Thank you very much from my OpenSuse 12.2 …
…default, all you need to do is to set the boot flag back on the Grub partition
Ah, that’s interesting. I will note that.
The OP did say the Windows install overwrote the mbr.
@geramx
Glad you got sorted. You also know (as do I) what to do in different circumstances from the information in please_try_again’s post.
Hugh
Yes, but the Grub boot loader wasn’t there. Windows overwrote a generic boot code with another generic boot code and changed the boot flag.
I already explained several times that reinstalling Grub in MBR doesn’t apply here - unless Grub was indeed installed in MBR before, but it is not the case unless you explicitely choose this option in openSUSE setup, and most people don’t. Thus it’s a hack, but not the solution.
Don’t understand me wrong! Putting Grub in the MBR is better and more reliable - from a Linux point of view - , and I would normally always recommend this approach. And again, it would have solved the boot issue here as well. But it is not the appropriate solution to this problem. You’re changing the situation to a better boot situation (in some ways) but to a different situation which might bother Windows in some other ways (preventing for example the installation of service packs). If you allow me this comparison, reinstalling Grub when Windows steals the boot flag is like buying a new car when your car gets towed.
Actually the easiest way to reset the boot flag would be to type:
# findgrub -a
If it finds the Grub boot loader in any of the primary partitions (including the extended partition) it would set the boot flag to this partition. But findgrub is not on the live CD. You would have to install it from my repo on the live system. In this case using fdisk or sfdisk is faster - when you know what to do.