Skip to content Skip to main navigation Skip to footer

Grub Article #3 – How to recover from Grub being installed to the MBR

Important: This article is relevant for both Grub legacy and Grub2

This article is intended to help BootIt  BM users recover from the situation where the Grub boot loader gets installed (usually unintentionally) to the MBR during a Linux installation. This results in BootIt BM getting overwritten so that, on the next reboot, Grub appears instead of  BootIt BM.

The consequences of installing Grub to the MBR will usually fall into one of two categories:
1. Only the MBR gets overwritten. See Section 1 below.
2. The EMBR is also overwritten, which is more involved. See Section 2 below.
 
If in doubt about which of the 2 situations above applies to you, follow the procedure in Section 1 first. That explains how you can tell. Note that the procedures in sections 1 and 2 below assume that Grub has, in fact, been installed to the MBR of HD0. This means that Grub is now appearing when you boot the system, instead of BootIt BM.

Section 1 - Only the MBR has been overwritten:

Boot the system from your BootIt BM Setup media (CD/DVD, USB flash drive, or floppy disk). If you are offered the option to Reactivate BootIt BM, this means that GRUB, in fact, has only overwritten the MBR. If you are not offered the Reactivate option, this indicates that the EMBR on HD0 has also been overwritten, and that you should proceed to Section 2 below.

If offered, accept the Reactivate option and follow the prompts given. Doing this will automatically move Grub from the MBR to the Linux partition's boot sector, and then put the BootIt BM code back in the MBR. On the next reboot, BootIt BM will be back as before, and you will be able to boot Linux by setting up (if not already set up) a Linux boot item in Boot Edit. This completes the recovery.


Section 2 - The EMBR has also been overwritten:

If you are not offered the option to Reactivate BootIt BM when booting from the Setup media, this means that Grub has also overwritten the EMBR area on HD0, and that you will need to install BootIt BM again. In this case, you will be presented with the BootIt BM Setup prompt, as if it had never been installed. From there, it is suggested that you follow the procedure below to recover.

1. Before installing BootIt BM again, it is recommended that you first install Grub to the Linux root partition (or to the /boot partition if you have a separate one), so that you can later boot Linux from BootIt BM. To do that, reboot your system from the hard drive and let Grub boot into Linux. Then, as root, run the following command:

For Grub legacy: grub-install  /dev/sdxy

For Grub2: The command is distribution dependent - see below

Debian-based (Ubuntu, Linux Mint, Kubuntu.), Arch Linux, most others

grub-install  --force  /dev/sdxy  2> /dev/null

Redhat-based (Fedora, CentOS), OpenSuse

grub2-install  --force  /dev/sdxy  2> /dev/null

Where /dev/sdxy is your root partition, such as /dev/sda1, /dev/sda2, etc. (or your /boot partition if you have a separate /boot partition). While this step could also be done after the fact, it is much easier to do while Grub is still installed in the MBR.


2. Boot your system again from the BootIt BM Setup media, which will get you back to the Setup prompt to install BootIt BM. Click OK to proceed with the installation.

3. If your BootIt BM installation was limiting primaries (to 4 or less per drive),  click No when asked if you would like to support more than 4 primary partitions. Otherwise, click Yes.

4. Click No when asked if you want Setup to choose the partition. Read the next screen about the EMBR, then click OK to continue. This will take you to the Partition Work screen.

5. Drive 0 (HD0) should already be selected in the Drives drop-down box (select it if it isn't). Click the Change Disk Type button and then click the EMBR button to create a new EMBR on HD0.

6. At this point you need to locate the partition that you had previously installed BootIt BM to. If it was on a drive other than HD0, select that drive using the Drives drop-down box. Note that the BootIt BM partition could be a dedicated primary partition (of type BootIt EMBRM) or a shared FAT16 or FAT32 primary partition.

7. If you were not limiting primaries and the BootIt BM partition was on HD0, it may or may not be visible now. If it is not visible now, see the section below on Undeleting partitions, and then resume this procedure at step 8.

8. Highlight the BootIt BM partition, and then click on the Setup button on the lower right to proceed with installing BootIt BM. This will install BootIt BM to the same partition as before, and will retain all of your previous settings, boot items, image sets, and so forth. When Setup completes, remove the Setup media and reboot when prompted. The system should now boot up into BootIt BM as before. You will most likely need to re-enter your registration code, and you may also need to re-enter the names of some partitions in Partition Work due to the EMBR being overwritten by Grub.

9. If you were not limiting primaries, check to see if you are missing any partitions on HD0. If so, see the section below on Undeleting partitions. Otherwise, this completes the recovery.


Section 3 - Undeleting missing partitions:

If you were not limiting primaries and had your EMBR on HD0 overwritten by Grub, you could now be missing some partitions on HD0. This can include the partition that BootIt BM was installed to, if that partition was on HD0. In the majority of cases, the missing partition(s) can be recovered by using the Undelete feature in Partition Work.

To use this feature, highlight a free space area on HD0 where you expect the missing partition(s) to be, and then select the Undelete button on the right. BootIt BM will proceed to search for partitions, and undelete those it can find and identify. Allow the process to complete, and then take a look at the results. If it finds all missing partitions, you are finished.

If not, there are some cases where the Undelete process will undelete remnants of old (previously deleted) partitions that are no longer valid. Finding and undeleting these partitions can prevent it from finding valid partitions that are still missing. If this is the case, you need to first delete all invalid partitions that it found,  making sure to use the Clear Boot Sector option when deleting them (of course, do not delete any valid partitions that it found). Then, highlight the free space area again, and repeat the Undelete process. It may take a few iterations of this process to find and undelete all missing partitions.


Additional Information:

Some other KB articles that may help you better understand this article are:
Grub Article #1 - Installation Notes and Background Information

Grub Article #2 - How To Reinstall GRUB

Grub Article #4 - How To Reinstall Grub2

Was This Article Helpful?

0