Size: 6623
Comment: Added - How to restore the Windows Bootloader using an Ubuntu CD
|
Size: 6671
Comment: Tidy formatting
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it. | Whether you want to restore the XP, Vista, 7 or Ubuntu (Grub) bootloader, this guide will walk you through it. <<BR>> |
Line 13: | Line 13: |
All four parts of this tutorial require that you boot from a CD or DVD. If you don't know how to do this, check [[http://www.hiren.info/pages/bios-boot-cdrom| here.]] |
All four parts of this tutorial require that you boot from a CD or DVD. If you don't know how to do this, check [[http://www.hiren.info/pages/bios-boot-cdrom| here.]] <<BR>> <<BR>> |
Line 16: | Line 15: |
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. | 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. |
Line 21: | Line 20: |
See [[Grub2/Installing#Fixing_a_Broken_System|this paragraph]]. | See [[Grub2/Installing#Fixing_a_Broken_System|this paragraph]]. |
Line 41: | Line 40: |
Then type | Then type |
Line 75: | Line 74: |
The methods described above for restoring the Windows bootloader using a Windows installation or repair disc are the preferred ones. However, there are occasions where a user does not have access to such discs, for instance where they have only the OEM manufacturer's restore set of discs which rarely if ever include the Windows recovery console. In such cases it is possible to install code to the mbr from the Ubuntu live session, which is functionally the same as the Windows bootloader. Two methods are described: the first where you are able to connect to the internet from the live session and the second as an alternative or where internet connectivity is not possible. . For both methods, boot from the live CD (or live USB) of any recent version of Ubuntu and choose “Try Ubuntu” to get to the live desktop. Before running the command to install the bootloader, it is a good idea to check that the partition from which Windows boots is still set as active. This will usually be so, but in some unusual cases the boot flag may have been unset. You need to know which partition Windows boots from. 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. . |
The methods described above for restoring the Windows bootloader using a Windows installation or repair disc are the preferred ones. However, there are occasions where a user does not have access to such discs, for instance where they have only the OEM manufacturer's restore set of discs which rarely if ever include the Windows recovery console. In such cases it is possible to install code to the mbr from the Ubuntu live session, which is functionally the same as the Windows bootloader. Two methods are described: the first where you are able to connect to the internet from the live session and the second as an alternative or where internet connectivity is not possible. <<BR>> For both methods, boot from the live CD (or live USB) of any recent version of Ubuntu and choose “Try Ubuntu” to get to the live desktop. Before running the command to install the bootloader, it is a good idea to check that the partition from which Windows boots is still set as active. This will usually be so, but in some unusual cases the boot flag may have been unset. You need to know which partition Windows boots from. 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. <<BR>> <<BR>> |
Line 105: | Line 104: |
Now reboot, remove the Ubuntu CD and you should reboot straight into Windows. | Now reboot, remove the Ubuntu CD and you should reboot straight into Windows.<<BR>> |
Line 107: | Line 106: |
'''Note:''' both these methods will work if the boot sector of the Windows boot partition is healthy. If it is not, you will need a Microsoft installation or repair disc in order to run fixboot or bootrec.exe /fixboot as described above. | ''' Note:''' both these methods will work if the boot sector of the Windows boot partition is healthy. If it is not, you will need a Microsoft installation or repair disc in order to run fixboot or bootrec.exe /fixboot as described above. |
Discussion of this wiki can be found here
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 four parts of this tutorial require that you boot from a CD or DVD. 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)
See this paragraph.
How to restore the Windows XP Bootloader
For this you will need your Windows XP installation CD or XP Recovery console. 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/7 repair disk, which you can download (eg Win7-32bit, Win7 64bit) or create from another Vista/7 computer (see this page and this tutorial). 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.
How to restore the Windows Bootloader using an Ubuntu CD
The methods described above for restoring the Windows bootloader using a Windows installation or repair disc are the preferred ones. However, there are occasions where a user does not have access to such discs, for instance where they have only the OEM manufacturer's restore set of discs which rarely if ever include the Windows recovery console. In such cases it is possible to install code to the mbr from the Ubuntu live session, which is functionally the same as the Windows bootloader. Two methods are described: the first where you are able to connect to the internet from the live session and the second as an alternative or where internet connectivity is not possible.
For both methods, boot from the live CD (or live USB) of any recent version of Ubuntu and choose “Try Ubuntu” to get to the live desktop. Before running the command to install the bootloader, it is a good idea to check that the partition from which Windows boots is still set as active. This will usually be so, but in some unusual cases the boot flag may have been unset. You need to know which partition Windows boots from. 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.
Both methods 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.
Method 1 – Internet Connectivity available
- Open a terminal and run these commands:
sudo apt-get install lilo
sudo lilo -M /dev/sda mbr
- Now reboot, remove the Ubuntu CD and you should reboot straight into Windows.
Method 2 – 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
Now reboot, remove the Ubuntu CD and you should reboot straight into Windows.
Note: both these methods will work if the boot sector of the Windows boot partition is healthy. If it is not, you will need a Microsoft installation or repair disc in order to run fixboot or bootrec.exe /fixboot as described above.