Jump to content











Photo
- - - - -

Learning about bootmgr


  • Please log in to reply
3 replies to this topic

#1 battlerock

battlerock
  • Members
  • 2 posts
  •  
    United States

Posted 22 November 2017 - 08:32 PM

I've not done any work with multi-boot systems in forever (since DOS). But since I repair PC's as part of my business creating systems with some multi-booting capabilities seems like it would be worth learning. I have a machine with Hyper-V so I just started trying to create multi-boot systems using the windows (10) bootmgr. I first created a single 10G VHDX and installed win10 enterprise trial which created a 500M primary paritition and a second 9.5G primary partition. This being vanilla booted just fine. I then expanded the VHDX file to 20G and using diskpart created a new partition, formatted it, created a new VHDX file on that formatted partition and installed win10 to that new VHD aka native boot. I believe it updated the BCD store with a new boot entry so now I have a 500M primary partition with the bootmgr and bcd store and a 9.5G primary partition with win 10 on a NTFS file system and a third partition with and NTFS partition and a 9.5G VHDX file with another trial copy of win 10 installed. i then extended the partition again and created an extended partition with the logical part inside it (also 10G). I then created a new VM and booted to a win 7 enterprise trial iso. Via the CMD prompt and diskpart I created a new partition, formatted that partition NTFS and created a new VHD (not X) file assigned it a drive letter and proceeded to install win 7 to this VHD file (native boot). Being a separate VM it worked fine. I then copied this Win7 VHD to the logical part on the 1st VM and created a new boot entry in the BCD store and verified it would boot. I then spun up a 3rd VM and installed win7 enterprise into a vhd but not native booting as I had done in the past. This resulted in a 100M system partition (primary) and another 9G NTFS partition. I then deleted the files from the 1st VM extended logical part and copied the VHD of the 3rd win7 VM to that extended logical partition. I corrected the BCD entries and tried to boot to this VM but it always comes up and says repairing installation and fails to boot. Now if I create a win7 install on another VM but give it a pre-existing NTFS partition of 9G win7 installs and does not create the 100M system partition. Copying this to the 1st VM's extended/logical partition and updating the bcd info creates a working booting machine. It appears that something breaks when trying to make a non-native boot win7 vhd boot as if it were a native boot install. I would have assumed a chain like MBR -> Bootmgr -> BCD store -> mount VHD on partition -> MBR (on vhd active primary part) -> Bootmgr -> BCD store -> \windows\system32\winload.exe, but it appears something along this convoluted path is broken. I know this is kind of a twisted example and its just for the purposes of educating myself on bootmgr/bcd functionality but it would be nice to know why this is failing.

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 November 2017 - 11:37 AM

I lost you after the second or third iteration :w00t: :ph34r:

 

Also you do not detail HOW EXACTLY you "copied" this to that, when a volume (contents) is copied, the Registry (besides the BCD) Mounteddevices needs usually to be updated (or blanked and let the next boot re-populate them).

 

The symptoms (it depends on a number of factor) of a messed up MountedDevices key in the Registry are usually that of not being able to get to Winlgon, but it is perfectly possible that instead the "repair" is triggered. 

 

Anyway this won't likely work:

 

I would have assumed a chain like MBR -> Bootmgr -> BCD store -> mount VHD on partition -> MBR (on vhd active primary part) -> Bootmgr -> BCD store -> \windows\system32\winload.exe

and I wonder how exactly you chainloaded the MBR inside the VHD :unsure: (i.e. which exact BCDedit commands you used, or however what does your BCD(s) contain), there is no such thing (AFAIK, but the Windows 10 BOOTMGR may well be capable of that) as "mount VHD on partition" (BTW it has been reported that the Windows 10 BOOTMGR in recent versions lost the capability to chainload "legacy" bootsectors, possibly not related, still ...) .

 

But then you should have another kind of error. :dubbio:

 

Besides the complication of your attempt, you are also having a lot of added complcation "layers" (VHDX as opposed to plainer VHD's) and Hyper-V (which is known to have some queer behaviours), maybe unrelated:

http://reboot.pro/to...-wim-in-hyperv/

 

The 100 Mb partition is the default if you install on a non-pre-partitioned hard disk (or virtual hard disk) as the standard install separates the "System" voume (what everyone else but MS would call "Boot") from the "Boot" volume (what everyone else but MS would call "System"), if you choose an already created primary partition "Boot" and "System" volumes are "merged" into one, this is "normal".

 

In the case of VHD booting, unless you use something like grub4dos that can mount in real mode the vhd (and not a vhdx) the "boot files" i.e. BOOTMGR and the \boot\BCD at least need to be outside the VHD, and the 100 Mb volume is probably the result of that, though I don't undestand what you mean by:

 

trying to make a non-native boot win7 vhd boot as if it were a native boot install

 

Try to simplify your question and better detail what you attempted to do, as is I cannot make head or tail of the problem :(

 

:duff:

Wonko



#3 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 23 November 2017 - 06:25 PM

I corrected the BCD entries and tried to boot to this VM but it always comes up and says repairing installation and fails to boot.

How do you correct the bcd entries?
Do you attach the vhd image at the host OS?
And run bcdedit next at host OS?

As for debug:
exract the bcd file to the host OS.
Attach the vhd image at the host OS
Run bcdedit to display the bcd settings.
Disconnect the vhd image next.
Run bcdedit to display the bcd settings again.

And:
Connect a windows installtion ISO to the VM. Boot the VM from DVD.
Run diskpart.exe to view, attach the boot/system partition.
Run cmd.exe and change diretory to the bcd file.
Run bcdedit.exe to display the bcd settings at the hard disk.

Edited by cdob, 23 November 2017 - 06:26 PM.


#4 battlerock

battlerock
  • Members
  • 2 posts
  •  
    United States

Posted 27 November 2017 - 09:04 PM

OK, let me recreate the monster with the steps in greater detail so the process is clearer and get back to you.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users