View Full Version : [ubuntu] Help: Going to format and re install windows.

November 22nd, 2009, 05:36 PM
Hi..I am going to format windows partition and reinstall it. I need to take precautions since It will overwrite my boot loader. what is the procedure to backup and restore grub?

November 22nd, 2009, 05:43 PM
Not sure of any procedure but the procedure to restore grub or grub2 from ubuntu liveCD are rather simple. You boot with the ubuntu CD, type few lines of code and that's it.

November 22nd, 2009, 06:39 PM
You can backup your current mbr to a file. All you have to know is where you installed your grub. e.g. if you installed it into the mbr of your first harddrive (/dev/sda), the command would be this:

sudo dd if=/dev/sda of=/home/your_username/mbr.backup bs=512 count=1
This command stores the mbr /dev/sda in your home directory under the name mbr.backup

To restore it back to the mbr of /dev/sda, the command is:

sudo dd if=/home/your_username/mbr.backup of=/dev/sda bs=512 count=1

November 22nd, 2009, 09:11 PM
It is probably saver to reinstall. While it may be good to have a backup of the MBR, if you change partitions in anyway or the partition number/UUID's change because of the changes, your copy of the MBR will not be correct.

restore boot loaders Ubuntu Win xp Vista


November 23rd, 2009, 12:38 PM
I selected the default option to save boot-loader during install. I think it was in hd0.