Professional Documents
Culture Documents
Ubuntu/XP/Vista/7 bootloader
(Updated for Ubuntu 9.10)
This How-to 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.
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.
So, lets begin. To restore the grub, you must boot off the ubuntu live cd. Any ubuntu live cd will
do.
Code:
sudo grub
Next, you need to find which hard drive ubuntu and the grub is installed to. You do this by running
this command:
Code:
find /boot/grub/stage1
Now you need to tell Grub where it is installed. Using the output of the last command, change this
one and run it:
Code:
root (hd<a>,<b>)
Replacing <a> and <b> with what you got back before. For example, if "find /boot/grub/stage1"
gave me "(hd0,1)", you would run "root (hd0,1)"
Ok, so thats the configuration over and done with. Now we just need to run one command to install
the Grub to your hard drive:
Code:
setup (hd0)
Code:
quit
Code:
sudo reboot
Make sure you have taken the live cd out of your disc tray. All going well, you should start back up
and see the grub once again.
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:
Code:
fixboot
Code:
fixmbr
Then type
Code:
exit
then remove your XP cd. If everything has gone well, you should come to your XP bootloader.
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:
Code:
bootrec.exe /fixboot
Code:
bootrec.exe /fixmbr
Take out your Vista/7 DVD and hopefully, you will be left with your Windows Vista/7 Bootloader.
__________________
Quote:
First they ignore you, then they laugh at you, then they fight you, then you win ~ Mahatma
Gandhi