Boot Manager is my Nemesis! Booting from a specific HDD/Partition?

#1
Question:

How can I tell the Windows 7 Boot Manager to boot from a specific HDD and partition, just like I could with Windows XP?

Background:

I have a complex boot system set up with multiple partitions, multiple hard drives, and multiple PC's.

Every time I touch my HDD partition information, Boot Manager breaks and I can no longer boot to that partition. (EasyBCD reports "Deleted Partition")

If I resize my partitions, Boot Manager breaks.
If I clone my HDD, Boot Manager breaks.

I figured out WHY this happens by doing some reverse engineering on how BCDEdit/EasyBCD changes what drive a boot loader application boots to.

It came down to this... Boot Manager's BCD hive stores a disk signature and a partition offset and uses that to figure out where to look for the winload.exe file.

See this Link: Editing the MountedDevices Registry Key

Since it stores the signature, copying a HDD to another will break the Boot Manager.

Since it stores partition offsets, shrinking/growing/moving partitions around will break the Boot Manager.

This is NOT what I want!

In WinXP, you could tell it to boot from "multi(0)disk(0)rdisk(0)partition(1)", and no amount of copying HDD's or resizing partitions would screw this up.

How can I get the same functionality in Windows 7?

I'm a little worried that this will not be possible, because EasyBCD only lets you choose drive letters.
 

mqudsi

Mostly Harmless
Staff member
#2
Hi IBNobody,

You are indeed correct - nice research. bcedit uses partition signatures (namely the disk volume number + the partition start offset) to determine what partition to boot into. This has resulted in more reliable booting for apparently everyone but yourself :smile:

We *may* be able to help, but there are a few questions:

1) How many operating systems?
2) How many disks?
3) Screenshot of disk management
4) What OSes?
 

Terry60

Knows where his towel is.
Staff member
#3
It's nothing to do with EasyBCD.
It's the MS bootmgr architecture.
From Vista onwards, as you discovered, Windows does not use the BIOS information to locate a partition, it uses the unique disk sig combined with the block offset.
The BCD does not use disk letters at all, it uses the UID. EasyBCD merely translates that user-unfriendly UID information into a disk letter as seen by the running OS for your convenience.
I'm afraid it's a design feature of Vista/7 that the start of a partition cannot be moved without breaking the boot. (The DVD "startup repair" will fix the BCD), that's why shrink/extend in Disk Management will only operate on the high-end of the partition, not the start position.
You might need to research an upgrade to your Partition Management software.
Some Vista/7-compatible cloners will fix the BCD automatically (but that's not a clone by my understanding of the word, but a modified copy), others need a retro-fix.
 
#4
I do appreciate your help... I would have been stuck on this problem forever, despite the amount of research I've done.

Would an alternate approach be....

1. Set a partition's Bootmgr device to "boot" using EasyBCD.
2. Use Grub4DOS to chainload to Bootmgr.
3. Bootmgr sees "Device=boot" in the BCD and then loads up normally.

I don't quite understand what "boot" is. This is an option in EasyBCD when choosing what drive letter to assign.
 

Terry60

Knows where his towel is.
Staff member
#5
No, it won't help.
"boot" (in EasyBCD) just means "the boot partition" as a synonym for whichever letter that happens to be in case you don't know it.
It's the partition MS flags as "system" (where the boot files are) (yes, I know it's confusing. Everybody else calls the location of the boot files "boot", but MS says "system". To them "boot" means the system you are currently running, not where the boot files that started it reside).
Even if you use grub as your top-level boot manager (as I do), it still chains bootmgr for Vista/7, which still references the BCD, which still needs to contain correct information concerning the partition location, which will still be garbage if you move the partition without repairing the BCD.
 
#6
Your help is much appreciated.

I understand the system & boot partitions. Essentially, I'm coming from a setup where my system partition (NTLDR) is on one drive and my boot partition (WinXP) is on another. I'm trying to apply something similar to Win7.

The way I interpreted the "boot" setting in EasyBCD (or bcdedit /set blah device boot) was that I was telling Bootmgr to look in the partition that it's loading from for the winload application.

Is this not the case?

If I am wrong, it leads to another question... If I'm loading EasyBCD on XP to do all the dirty work for a Win7 image, and I manually load a BCD store, how does it know what to assign when I choose "boot" instead of a drive letter?
 

mqudsi

Mostly Harmless
Staff member
#7
It *can* be done if you put Grub4Dos as the top-level. Each time you chainload BOOTMGR for a different entry, you can set makeactive on that partition.

But you'll have to install the bootloader to each and every partition. And then configure each bootloader with an entry for that same partition, setting the device to boot.

But the important thing is, you need to use Grub4Dos before BOOTMGR, and set it as makeactive each time.
 

Terry60

Knows where his towel is.
Staff member
#8
But you still can't move any Vista/7 partition without repairing its BCD, which I think is the complaint in the OP.
(unless you use an auto-fixing Partition Manager)
 

mqudsi

Mostly Harmless
Staff member
#9
Why's that, Terry?

If the BCD for the partition is configured to boot from "boot" always, it'll just boot from the partition that the BCD/BOOTMGR is on, regardless of partition signature, etc... Unless there's something I'm overlooking, which is very likely.
 

Terry60

Knows where his towel is.
Staff member
#10
The BCD entry which locates winload.exe still points to the partition location where it used to be, not where it is now until you repair the UID. (This is all supposing that partitions are being moved around, as in the OP complaint.)
"boot" is still going to use the "active" "system" partition, but the start block address portion of the UID will still have changed and need fixing.
 

mqudsi

Mostly Harmless
Staff member
#11
If you set the BCD entry's device and osdevice attributes to 'boot', it won't save the partition offset anywhere - it'll dynamically re-calculate those values at boot time.

But Windows itself may break, I don't know.
 
#12
If you set the BCD entry's device and osdevice attributes to 'boot', it won't save the partition offset anywhere - it'll dynamically re-calculate those values at boot time.

But Windows itself may break, I don't know.
This was what I was seeing. I reverse-engineered the "boot" setting and saw that it zero's out the partition offset and signature from the BCD hive.

I've attached two registry exports:
G1 = Bootmgr is set to a non-existant HDD.
G2 = Bootmgr is set to "boot".

(I generated these by mounting the BCD hive in regedit and exporting the tree.)

I've tried it by chainloading to the bootloader, but I'm not convinced that I didn't mess something up on the way. I'll try again and let you all know.

I will set my Bootmgrs to "boot", repartition my HDD using GParted, and then try to boot back into them.
 

Attachments