Fix Bootloaders After Dual Boot Installation - gHacks Tech News

Fix Bootloaders After Dual Boot Installation

Installing a second operating system on your computer can be a great way to drastically increase the number of things you can do on it. It’s no big secret that many of the programs you can run on Windows cannot be run on any other operating system. By the same token, with the recent explosion in consumer interest in user friendly Linux distributions like Ubuntu, developers are looking even closer at the platform, and the number of Linux-only programs is on the rise. There are other reasons to want a foot on both sides of the line – certain programs run faster on certain operating systems, programming and developing works differently in different OSs, and the list goes on.

So let’s assume that you read up on dual booting, chose a second operating system that extended your computing capabilities, and pulled the trigger. Congratulations! Your system now has the potential to carry you much further, and your software options are incredible. You spend some time enjoying the new operating system, customizing it, choosing new programs, and after some time, decide you want to hop back onto your old system. You close everything up, tell your system to reboot and… it jumps right back into the new operating system without asking where you wanted it to go.

This frustrating scenario is not at all unfamiliar to those who decide to dual boot. Fortunately, there is a solution for nearly every possible configuration and installation order between Windows and Linux versions and distributions. This how-to will help you get the bootmenu for each possible option back, giving you access to the original operating system if it is accidentally blocked out by the second OS.

bootloader

The process does require you to have a physical copy of an installation disk for whichever operating system you are trying to get access to. If you installed Ubuntu as your second operating system and it blocked you from Vista, you need a Vista disk. If, for some reason, you installed XP and lost Ubuntu, you will need an Ubuntu installation disk for the specific release you are trying to get to.

Also, this how-to looks specifically at how to restore access to Ubuntu and may not be universally applicable to Linux distributions. It should, however, serve as a solid starting point, and many other distros follow the same process.

The most common scenario, restoring Windows Vista or 7, is one of the easiest. Run the installation CD at startup, and after the location options select Repair Your Computer. Unselect your installation if the system locates it, and then open Command Prompt. Type in:

bootrec.exe /fixboot

Press enter, then type:

bootrec.exe /fixmbr

Close all windows, do a restart, and your Vista/7 bootloader should appear.

Those restoring XP have it even easier. Insert the install CD, allow it to proceed, then type r when it asks if you are repairing rather than installing. This brings up a command line, in which you should type, pressing enter between lines:

fixboot
fixmbr
exit

Finally, those restoring Ubuntu or a similar Linux system need to start by identifying the drive their system is installed on. From the terminal on an install disk, type:

  • sudo fdisk –l

From the information that this calls, identify the drive that holds the Linux system, such as /dev/sda2. Next, substituting in your own drive in place of sda2:

sudo mkdir /media/sda2
sudo mount /dev/sda2 /media/sda2
sudo grub-install –root-director=/media/sda2 /dev/sda

While not comprehensive enough to cover absolutely every possible configuration you may have, these simple steps can help most people get back their original bootloader. If you follow these steps and find you lose the loader from the second operating system, just follow the same steps for the second. Good luck!

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. JFP said on June 13, 2011 at 1:31 pm
    Reply

    Or you can use EasyBCD, like i did this week-end. Work very well and you dont have to use all those cmd line. http://neosmart.net/dl.php?id=1

    Thanks for your trick.

  2. SubgeniusD said on July 24, 2011 at 7:45 pm
    Reply

    “While not comprehensive enough to cover absolutely every possible configuration” Yeah – try installing Linux on a notebook secondary internal hard drive.

    Install on sdb, manually create a /boot partition, install Grub there, tell it to boot from there and the distro still writes to the MBR of sda (primary hdd with Windows) scrambling not only the MBR but the partition table borking your windows install. Bootrec etc doesn’t fix. Luckily I keep recent system images.

    Mandriva 2010 is the only distro of many I’ve tried that behaves like a mature, polished OS in this situation. The rest are buggy loads of —- oh well I’m still disgusted with them so let’s leave it there.

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.