How to modify Windows 7 Boot Loader?

Yesterday, I had installed Windows 7 Beta Build 7000 on Lenovo Ideapad S10 Netbook. The S10 netbook was pre-installed with Microsoft Windows XP Home Edition. So, I set up Windows XP / Windows 7 dualboot. The Windows 7 installer set the default boot choice to Windows 7 and renamed the XP as "Legacy OS" in […]

Yesterday, I had installed Windows 7 Beta Build 7000 on Lenovo Ideapad S10 Netbook. The S10 netbook was pre-installed with Microsoft Windows XP Home Edition. So, I set up Windows XP / Windows 7 dualboot. The Windows 7 installer set the default boot choice to Windows 7 and renamed the XP as "Legacy OS" in the Boot Configuration Data (BCD) store.

It's because Windows 7 doesn't have write permissions on XP's NTFS system partition, even though it creates a "boot sector" inside it.

Steps to repair BCD from the command prompt:

  1. Go to Start>> All Programs > Accessories > (right-click & "Run as administrator") to open an elevated Command Prompt window.
  2. Now, to change the permission and also to change the text description of the "Legacy" OS line in the boot menu run the following command (the quotation marks must be included in the command): bcdedit /set {legacy} Description "Microsoft Windows XP Home Edition SP3".
  3. To set the legacy (Windows XP) OS as a {default} boot item, run the following command: bcdedit /default {legacy}
  4. Run bcdedit /?.

    Adding Microsoft Windows XP SP3 to Windows 7 boot loader using BCD command prompt

Note: if you want to restore Windows XP back to the menu, you can open up a command prompt in Windows 7 and run this command:

bcdedit /create {ntldr} -d "Windows XP"

If you get erros suchs couldn't detect "ntldr" or missing "ntldr" -- try to copy "ntldr" and "NTDETECT.COM" files from your Windows XP drive to partition marked as "system".

If you get Error loading Operating System after XP restarts i.e. if Windows cannot detect the correct partition for Windows Legacy OS (Windows XP):

  • Using your Windows 7 installation disc, boot to the command prompt at startup.
  • Type in these comands below, and press enter after each one.

    BOOTREC /FIXMBR
    BOOTREC /FIXBOOT
    BOOTREC /REBUILDBCD
    BOOTREC /SCANOS

  • Exit the command prompt and restart the computer.
  • At this point, Windows 7 should boot up the same way before trying to install XP.
  • See running EasyBCD from Windows 7.

If you installed Windows XP on a PC running Windows 7, use the following command to fix the Windows 7 bootloder:

CD X:\Windows

BOOTSECT /NT60 ALL

Note: Please replace "X:" in the command with the actual drive letter of the Windows 7 Installation drive.

Steps to collect BCD text from CMD:

  1. Click Start Menu, type "cmd" (without quotation marks) in the Start Search box.
  2. Right-click the exe file and choose "run as administrator".
  3. Input the following command in the DOS prompt window and press ENTER: BCDEDIT /ENUM ALL > C:\bcdedit.txt

If you feel the syntax of the Bcdedit command is daunting, you can also use a graphical editor for the BCD store. A utility called "VistaBootPRO" available from vistabootpro.org includes the ability to repair the Windows boot loader or uninstall it and return to booting from the Legacy OS Boot Loader (Ntldr.exe).

VistaBootPRO also works in Windows XP, so you can boot to either operating system and then adjust boot settings.

Another powerful alternative, is the "EasyBCD," from NeoSmart Technologies (w7io.com/0211). Both utilities offer the ability to customize multiboot installations and to repair a damaged boot loader or switch on the fly to the old-style Windows XP boot loader.

Running EasyBCD

If you are only booting into Windows 7 and do not have XP listed in the Windows Boot Manager, then you can install only EasyBCD to add XP:

EasyBCD

  1. Download and install .Net Framework 2.0 (32-bit) version or .Net Framework 2.0 (64-bit) version first on your XP installation, and EasyBCD for 32-bit (x86) or 64-bit (x86) XP.
  2. Run EasyBCD
  3. On the left side of EasyBCD, click on the "Add New Entry" button
    1. In the top section under Operating Systems, click on the Windows tab
    2. To the right of Type, select Windows NT/2k/XP/2k3 from the drop down menu

      Warning: Be sure to leave the Automatically detect correct drive box checked.

    3. To the right of Name, you can leave the default Microsoft Windows XP as the name to be displayed in the Windows Boot Manager, or you can type whatever name you would like to have instead
    4. Click on the Add Entry button.
  4. On the left side of EasyBCD, click on the BCD Deployment button, select (dot) the Install the Windows Vista/7 bootloader to the MBR option, and click on the Write MBR button
  5. Close EasyBCD
  6. Restart the computer to have the option to boot from Microsoft Windows XP or Windows 7.

If for some reason you want to remove Windows 7 from a dual-boot installation and restore the Windows XP boot loader? Insert the Windows 7 DVD and type the following command at a command prompt (substituting the letter of your DVD drive for d):

d:\boot\bootsect.exe /nt52 all

Note: You can now delete all system files from the volume containing the Windows installation you no longer plan to use. For even more effective removal, use the Disk Management console in Windows XP to reformat the drive and start fresh.

How to install Windows XP over Windows 7 in a dual boot?

This case is applicable for users who have Windows 7 pre-installed on 'C' and want to install XP on their 'D' partition.

  1. Make a clean Install of Windows XP on 'D' partition of your hard drive. Assuming, Windows 7 is installed on 'C' partition.
  2. After restarting system, you will directly boot into Windows XP. That's because XP writes its bootloader over Windows 7. So, we need to restore the Window 7 bootloader.
  3. To restore 7, you need to Boot from the Windows 7 DVD and "Repair your computer".
    • Watch for a Press any key to boot from CD or DVD... message similar to the one shown in the screenshot above.
    • Press a key to force the computer to boot from the Windows 7 DVD. If you do not press a key, your PC will try to boot to the operating system that's currently installed on your hard drive. If this happens, just restart your computer and try to boot to the Windows 7 DVD again.
  4. After repairing, your system will restart and boot into Windows 7.
  5. Download and Install EasyBCD on your Windows 7 to add boot entry for XP.

    (Creating a new Windows XP entry with EasyBCD is very easy. By default, EasyBCD will create a Windows XP entry via the NTLDR method described above in order to minimize confusion and because most users will not have multiple legacy entries alongside their Vista/7 installs.

    NTLDR-based entries require you to only point and click. Just enter a name for the new entry that will appear in the boot menu, and click "Add Entry" and EasyBCD will automatically create the needed boot files. NTLDR will be placed in the NST subfolder as shown above, and NTDETECT will be placed in the root of the boot partition. EasyBCD's "BootGrabber.exe" helper module will scan all mounted partitions for legacy NT-based installs (Windows NT through 2003), and automatically generate a boot.ini that contains all detected legacy installations)

  6. Launch the program and select 'Add New Entry'. Under "Operating Systems" open the Windows tab, select the Type as "Windows NT/2k/XP/2k3" and click on 'Add Entry'.

    The entry for Windows XP would be added instantly. You can choose the default OS to boot and modify the boot menu time-out from "Edit Boot Menu" option.

    Installing Windows XP to Windows 7 bootloader using EasyBCD

  7. Now restart you PC and you'll be presented with two options, Windows 7 and Windows XP. Select the OS you want to work on.
  8. That's it.

As, an alternate, you can also user "EasyLDR" -- All you need to do is uncheck the checkbox labeled "automatically detect the correct drive." Subsequently, a drop-down box containing a list of all mounted partitions will appear, and you can choose the Windows XP installation you wish to boot into.

Clicking "Add Entry" will cause EasyBCD to automatically create the easyldr#, ntdetect.com, and ebcd.00x files needed to boot into the selected partition. You can then repeat these steps for as many separate legacy NT installs as you have available:

EasyLDR

When dual booting Windows 7 with another OS (XP), you may not always have that OS partition show up in Computer with a driver letter in Windows 7. If this happens to you:

  1. Open the Control Panel (All Items view), click on the Administrative Tools icon, then close the Control Panel window
  2. Click Computer Management in Administrative Tools
  3. If prompted by UAC, click on Yes. Close the Administrative Tools window
  4. In the left pane under Storage, click on Disk Management
  5. In the right pane, right click on the XP partition that is missing it's drive letter, then click on Change Drive Letter and Paths
  6. Click on the Add button
  7. Select "Assign the following drive letter," then select a drive letter you want to have assigned to the XP disk partition and click on OK
  8. The XP Hard Disk Partition will now show up in Windows 7
  9. That's it.

Note: You can install the Windows Vista / 2008 / 7 bootloader onto a Windows XP machine and dual-boot Windows XP and Windows 2008 / 7 from the VHD. The easiest way to do it, is simply to install Windows 2008 / 7 into a VHD, and you get the bootloader "for free" during the install.

  1. Boot the Windows 7 DVD
  2. Choose Repair and Command Prompt
  3. From the command prompt, execute the following:
        DISKPART
        CREATE VDISK FILE="filename for virtual disk here" TYPE=vdisk MAXIMUM=size-in-megabytes
        ATTACH VDISK
        EXIT
  4. Close up the command prompt. start the Windows 7 install.
  5. Choose the virtual disk (you'll be able to tell by size which one it is). You receive a warning that you cannot install onto that disk. Continue anyway and the install completes fine.
  6. After that completes you will have Windows 7 install that can boot off of VHD and the Vista / 2008 / 7 bootloader.