How to Restore the Ubuntu/XP/Vista/7 Bootloader
- This wiki is for windows dual booters who reinstall an operating system only to find that it has taken away access to their other operating system. Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it.
All three parts of this tutorial require that you boot from a cd. If you don't know how to do this, check here.
If you have made a mistake and want to revert the changes, simply follow the instructions for reinstalling the previous bootloader. For example, if you have installed vista over ubuntu, try to get the ubuntu bootloader back, but want to get the vista bootloader back, simply follow my instructions for installing the vista bootloader.
How to restore the Ubuntu grub bootloader (10.04 and above)
- First you need to find out what your drives are called. You can do this by going to a terminal and typing:
sudo fdisk -l
From that you need to find the device name of your Ubuntu drive, something like “/dev/sda5″.
- So, still in the terminal, type:
sudo mkdir /media/sda5 sudo mount /dev/sda5 /media/sda5
And then, to reinstall the grub:
sudo grub-install --root-directory=/media/sda5 /dev/sda
Push enter and you’re done! Of course you need to replace “/dev/sda5″ and “/dev/sda” with what you found in the fdisk output.
How to restore the Windows XP Bootloader
- For this you will need your Windows XP installation CD. Boot into it now. You will get to a part where it asks if you want to repair or recover. To do so, press "r". If prompted, enter your Windows XP administrator password. This will leave you at at a command line, so type in the following two commands:
fixboot
fixmbr
Then type
exit
- Then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
How to Restore the Windows Vista or 7 Bootloader
- To restore the Windows Vista/7 bootloader, you must first boot off your Windows Vista/7 installation DVD.
If you have one of the many OEM computers that didn't come with a Vista/7 installation disk, you can get the same effect with a Vista recovery disk, which you can download from Win7 or Vista When you get to the Regional settings, select your Location/Keyboard setting then click next. On the next page you must click on "Repair your computer." On the next page, if it finds your Windows Vista/7 installation, make sure it is UNSELECTED before clicking next. Then click on "Command prompt". From there, type in the folowing:
bootrec.exe /fixboot
bootrec.exe /fixmbr
Now close the two windows and click "Restart."
- Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
Originally posted The Ubuntu Forums (ubuntuforums.org)