Thursday 8 December 2016

Modifying the Windows 7 boot loader with the Boot Configuration Data



Sometimes dual-booting a system is a handy way to test new software, a new operating system, or an application that needs to be run in a specific version of Windows. Other reasons to dual-boot might include replication of a client environment.

Windows handles dual-booting by using boot.ini to display a menu of bootable choices or partitions found on the current system. In Windows Vista and later versions of Windows, the bootloader was moved from boot.ini to a utility called BCDEdit.

Recently, I decided I could make better use of some disk space that I had set aside to create a bootable VHD for Windows Server 2008 R2. There was no data other than the OS installation contained within the file because I had used it only to prepare a blog post about booting from Virtual Hard Disks. To free up the space, I deleted the VHD.

Note: Always make sure to back up any data that you want to keep before deleting or modifying partitions on VHDs. Your changes could make the partition unbootable.
Once I had the VHD removed, I thought Windows would be smart enough to clean up the boot loader, but I was not so lucky. I had Windows 7 set as the primary OS, so I was not without a system.

Started looking around for boot.ini and was directed toward the Boot Configuration Data Editor (BCDEdit) as the utility to use when editing boot loader information in Windows 7 (and in Vista too).

To begin, open the Start menu, select All Programs, and then choose Accessories. Right-click on Command Prompt and select Run As Administrator. Once in the command window, type bcdedit. This will return the current running configuration of your boot loader, showing any and all items that can boot on this system.

In this example, I decided to remove the entry for my Windows 2008 R2 installation, as I wouldn't need it for the time being. To remove an entry, you will need to know the Boot Loader Identifier


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\test>bcdedit

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {a90f9a80-834e-11e5-a27e-88f88aa0953e}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
-------------------
identifier              {current}
device                  partition=C:
path                    \Windows\system32\winload.exe
description             Windows 7
locale                  en-US
inherit                 {bootloadersettings}
recoverysequence        {a90f9a82-834e-11e5-a27e-88f88aa0953e}
recoveryenabled         Yes
graphicsmodedisabled    Yes
osdevice                partition=C:
systemroot              \Windows
resumeobject            {a90f9a80-834e-11e5-a27e-88f88aa0953e}
nx                      OptIn

C:\Users\test>



Copied the whole list into Notepad and then selected and copied just the ID, braces included.


Removing an entry from the Boot Loader
One simple command got the Windows Server 2008 R2 entry out of the boot loader. At the command prompt, enter the following:


Bcdedit /delete {boot loader identifier}


Press Enter, and the Boot Configuration Data Editor (BCDEdit) will remove the entry for the ID you specified and display a message when finished. When Windows starts, the only choice available in the boot menu should be the current Windows installation.

Warning: Be careful when editing the boot configuration data. If you mistakenly remove the current instance of Windows, you may render your computer unbootable

2 comments:

  1. They say that the Devil works hard. Everyone’s wrong. You work harder. We’re so proud of you.
    desktop service

    ReplyDelete
  2. Sometimes, exploring the option of dual-booting a system can be particularly useful for testing new software, experimenting with different operating systems, or running applications that require a specific Windows version. Additionally, individuals might consider dual-booting for the purpose of replicating a client environment, ensuring compatibility and seamless functionality. In the realm of online class help , understanding dual-boot configurations can be advantageous when dealing with course-related software or environments that demand specific operating system specifications. It's worth noting that in Windows Vista and subsequent versions, the bootloader transitioned from boot.ini to a utility known as BCDEdit, marking a shift in the management of bootable choices and partitions.

    ReplyDelete