Discussion of this wiki can be found here

How to fix the Ubuntu GRUB bootloader

How to fully fix the Windows bootloader using a Windows disk

XP

fixboot

fixmbr

exit

Windows Vista or 7 or 8

bootrec.exe /fixboot

bootrec.exe /fixmbr

How to partially fix the Windows bootloader using an Ubuntu CD

Via the Boot-Repair graphical tool

Run Boot-Repair from a liveCD, click "Advanced options", tick "Restore MBR", click "Apply".

http://pix.toile-libre.org/upload/original/1353333605.png

This will automatically restore a generic syslinux MBR, and set the boot flag on the Windows boot partition. This will also tell you if the Windows bootsector needs repair (see this tutorial).

Via command lines

1. Boot from the live CD (or live USB) of any recent version of Ubuntu and choose “Try Ubuntu” to get to the live desktop

2. Check that the partition from which Windows boots has the 'boot' flag. For XP and Vista, this is normally the main C: partition. Windows 7 usually (but not always) has a separate boot partition of 100-200 MB in size with the partition label “SYSTEM”. There are also more exotic configurations where two versions of Windows have been installed to the same hard drive, or where the main Windows partition is a logical one. In these cases there will be a single primary partition with the Windows boot files which needs to be marked as active, and you will need to identify which this is. Once you have done so, open Gparted and see if “boot” is listed under the flags column for that partition. If not, highlight the partition and go to Partition menu → Manage Flags, tick the tick-box for “boot” and then close that window and close Gparted.

3. Both methods below assume that the boot drive is designated /dev/sda in Ubuntu. This is almost always so, but with some unusual BIOS configurations where there is more than one hard drive, the boot drive may be other than /dev/sda. In such cases you will need to adjust the command appropriately.

If internet connectivity available, open a terminal and run these commands:

sudo apt-get install lilo

sudo lilo -M /dev/sda mbr

If no Internet connection: recent versions of Ubuntu include the file /usr/lib/syslinux/mbr.bin which is 440 bytes in length and simply needs to be written to the beginning of the mbr with this terminal command. WARNING! Be very careful with this command and check for typos before running it.

sudo dd if=/usr/lib/syslinux/mbr.bin of=/dev/sda

4. Now reboot, remove the Ubuntu CD and you should reboot straight into Windows.

See also

Thread for discussion about this wiki page

RestoreUbuntu/XP/Vista/7Bootloader (last edited 2013-07-31 19:14:01 by yannubuntu)