Install only Grub, again

Hi there!
I have installed openSuse 12.1 (64 bits) alongside Windows 7 succesfully, and the system was using Grub as bootloader.
I needed to restore the MBR in order to install Service Pack 1 of Windows 7. So, now the system boots only Windows (without Grub).

How can I install Grub again? (Only Grub.)
I’ve tried to install it from openSuse installation DVD, but it seems to install all openSuse again. I want to install only Grub.

Thank you,

Re-Install Grub Quickly with Parted Magic - Blogs - openSUSE Forums

As suse live cd can be used instead of PMagic if you like

Thank you, caf4926!
The procedure work fine!

If you were able to install the service pack on WIndows, Grub wasn’t obviously installed in MBR before (otherwise the update would have failed). Installing Grub in MBR certainly solved your boot problem for now but also introduces a new one: you won’t be able to install the next service pack on Windows without restoring Windows MBR first (How to use the Bootrec.exe tool in the Windows Recovery Environment to troubleshoot and repair startup issues in Windows)… unless Windows becomes tolerant and grubfriendly in the meantime, but it’s unlikely. The solution here would have been to just reset the bootflag on the Grub partition and leave the MBR untouched.

What did you mean “reset the bootflag on the Grub partition”?
Please, can you explain me how do you that?

Thank you, in advance.

Windows uses a generic MBR by default, not a boot manager such as Grub. openSUSE actually also uses a generic MBR, like Windows - and unlike all other Linux distros - and installs Grub in a partition boot sector rather than in MBR - always by default. This is generally speaking a bad idea - because Grub works better when installed in MBR (explaining why would be beyond the scope here) but this is a good thing from the Windows point of view. If you run fdisk on Linux

sudo /sbin/fdisk -l

you will see one of the maximum 4 primary partitions (sda1-4) marked with a star. This is the active partition, the one which will be selected and booted by a generic MBR in the absence of a boot manager. Before you installed the service pack, the bootflag was set on a Linux primary or the extended partition, wherever the Grub bootloader was installed. Windows set it back on its partition. This is why you couldn’t boot Linux anymore. Since you installed Grub in MBR, the bootflag doesn’t matter now and so it solves the boot problem. However Windows might refuse to install further service packs.

There are several ways to change the active partition: from Windows with diskpart (provided it’s not the extended partition), from a Linux live CD with fdisk, sfdisk, gparted or from an openSUSE live CD if you install updategrub on the live system or download findgrub (http://forums.opensuse.org/english/other-forums/development/programming-scripting/447138-looking-grub-windows-bootloader-all-partitions-16.html#post2443550). Then you’ll just have to type

sudo findgrub -a

this command will find on which primary or extended partition on the first HDD the Grub boot loader is installed and activate this partition, which would reverse to the situation you had before installing Windows service pack.

You don’t need to worry now. Don’t fix it if it works! If you can not install the next Windows service pack, you will know why. But maybe there won’t be another service pack and Windows 7 is just perfect now. I wouldn’t count on it though. :wink:

excellent news:D

Got an email from the daughter of a Nigerian diplomat? Won a free cruise? lol!

@aecordoba

More seriously, you might find this post interesting too: http://forums.opensuse.org/english/get-technical-help-here/install-boot-login/474294-i-need-change-mbr-switch-boot-ini-maybe-change-active-partition.html#post2455466

Thank you, please_try_again, for the detailed explanation!

Thank you!!! Been trying to find a way to get my Linux partition up again for about a month now! lol

I, for one, am a little confused by the discussions. According to what I understood, SUSE does not use a separate Grub partition! The Grub (1.5) modifies the MBR pointer to the partition where the Grub menu file is kept (which may be a primary or logical partition). The Generic MBR points to one of the primary partitions (or is it the first?) on the drive. So the need was or is to set the pointer in the MBR. Grub is equipped to turn the pointer to its own menu while the Windows Disk resets it to its own “standard”. I would like to know if Parted Magic can set it to the users choice and how?

PrakashC

Generic MBR goes to the boot flagged partition. it then expect to find the boot loader there which does what ever that boot loader is meant to do. In the case of Grub it eventually shows the menu.

Grub MBR goes to programed partition and finds and loads stage 2 which displays the Grub menu.

Slight simplification but it may help to picture the process.

No one does … if we’re talking about Linux distros. People do what they want.

It looks for stage2 and menu.lst by reading the filesystem if a stage1.5 is available for this filesystem. It is written on the first track. Thus it can only exist if Grub is installed in MBR. There is no room for stage1.5 when you install the Grub boot loader in a partition boot sector (VBR).

It loads and runs the code in the boot sector of the active partition.

?

If you mean setting the bootflag back on the Linux root partition, any partitionning tool can do it, as well as the fdisk and sfdisk commands on Linux live systems (including Parted Magic). And yes, this is what you should do after Windows snapped the bootflag in order to restore the previous situation. Installing Grub into MBR solves the boot problem but creates a new situation, which has some advantages but also brings other problems.