Jump to content











Photo
- - - - -

BCD System Drive Boot


  • Please log in to reply
25 replies to this topic

#1 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 6 days ago

I have a UEFI drive that I use to boot two of my PEs for loading images and such. Lots of times the computer will reboot when the image is done installing and will boot back to my USB drive instead of the C drive. I want to add a 3rd default timed entry to the BCD menu that says "1. Boot To System HD" but I can't seem to get the entries right in the BCD to do so. How should the entries in the BCD look to accomplish booting to the system HD from my UEFI BCD menu instead of one of my PE choices?



#2 cdob

cdob

    Gold Member

  • Expert
  • 1397 posts

Posted 5 days ago

bcdboot adds boot entries.

E: refers to the USB EFI boot partition

bcdboot C:\Windows /s E: /f UEFI /p /d
.
https://docs.microso...ions-techref-di
  • LostNspace likes this

#3 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 5 days ago

bcdboot adds boot entries.

E: refers to the USB EFI boot partition


bcdboot C:\Windows /s E: /f UEFI /p /d
.
https://docs.microso...ions-techref-di

 

 

cdob, thanks so much! You've always been super helpful over the years. The /p /d command is what I was missing. I have been out of the boot game for 5 years or so, so I 'm a little rusty coming back into things. 

 

Thanks again! 



#4 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 5 days ago

cdob,

 

Is there something more global to boot the system drive from the BCD? Let me explain

 

I use WinNTSetup from my Mini10PE to load my images and I have reboot turned on in my ini. These new laptops no matter how I set the boot stuff in bios will always boot to the USB again and I have stepped away to come back to Windows 10 not being setup yet and has booted into my PE again. The code I used above worked great on the computer I ran the command from. What I mean is I can boot the HD from the BCD menu on the computer I ran the command from, but I assume those BCD entries as specific to that machine. I need entries in the BCD that would boot any Win 10 drive from the BCD.



#5 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 5 days ago

IMHO you should think the other way round. 

I.e. have the "default" boot on the USB stick to always (if no user intervention happens) go back to boot the hard disk, and you should be able to do that easily if you add (say) GRUB2 as your "main" USB stick boot manager.

Another entry (if manually selected) will chainload the BOOTMGR.EFI on the same USB stick.

 

:duff:

Wonko



#6 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 5 days ago

IMHO you should think the other way round. 

I.e. have the "default" boot on the USB stick to always (if no user intervention happens) go back to boot the hard disk, and you should be able to do that easily if you add (say) GRUB2 as your "main" USB stick boot manager.

Another entry (if manually selected) will chainload the BOOTMGR.EFI on the same USB stick.

 

:duff:

Wonko

 

 I think we are talking about the same thing. In my BCD I would have "Boot To System HD" as the default entry so when the secure boot UEFI laptop boots to the USB drive the default choice would boot the system drive so when I return from whatever I am doing, the load process would be complete. Less user interaction. I will need to read up on Grub2 and secure boot. Like I said been out of the boot game for a long time. I was hoping it would be just a simple entry I could make in the BCD to accomplish this. 

 

If I use the command cdob, posted above this allows me to boot the system drive from my BCD menu but only on that computer I ran the command from. 



#7 misty

misty

    Silver Member

  • Developer
  • 885 posts
  •  
    United Kingdom

Posted 5 days ago

@LostNspace

I'm not sure if what you are proposing is possible with the Windows boot manager (bootmgr and UEFI variants).

See here for my attempts at documenting BCDEdit and the BCD store.

Maybe look into the Locate device type (here) and in particular the Using the Locate Device in Multiboot Setups section of this page and do some experiments. Instead of using a tag file, simply use a file that is likely to be present on the HDD and not present on the USB device you are booting from.

:cheers:

Misty
  • wimb and LostNspace like this

#8 911CD.net

911CD.net

    Member

  • Advanced user
  • 54 posts
  •  
    United States

Posted 5 days ago

LostNspace you can boot your USB grub2 menu on a Secure Boot EFI system if you follow the steps I posted here:

http://reboot.pro/to...e-4#entry207893 about a month ago.


  • LostNspace likes this

#9 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 5 days ago

Here is what my BCD looks like. This works if I boot the system drive from my USB if its the computer I ran the 

 

bcdboot C:\Windows /s E: /f UEFI /p /d command from but fails with a light blue screen saying

 

windows\system32\winload.efi couldn't be found

 

The first pic is the System Drive Boot option

 

gbZvdL.jpg

 

 

 

Second pic is Windows Boot Manager option

 

vEllu7.jpg


Edited by LostNspace, 5 days ago.


#10 cdob

cdob

    Gold Member

  • Expert
  • 1397 posts

Posted 5 days ago

look into the Locate device type

Yes, locate works at USB UEFI too.
 
cd /d E:\EFI\Microsoft\Boot
bcdedit.exe /store bcd
copy the Boot to Sytstem HD GUID
.
bcdedit.exe /store bcd /set {GUID}   device locate=custom:12000002
bcdedit.exe /store bcd /set {GUID} osdevice locate=custom:12000002
Paste the appropiate GUID number.

The tag file "\Windows\system32\winload.exe" is used in both.

#11 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 5 days ago

Yes, locate works at USB UEFI too.

cd /d E:\EFI\Microsoft\Bootbcdedit.exe /store bcd
copy the Boot to Sytstem HD GUID
.
bcdedit.exe /store bcd /set {GUID}   device locate=custom:12000002bcdedit.exe /store bcd /set {GUID} osdevice locate=custom:12000002
Paste the appropiate GUID number.

The tag file "\Windows\system32\winload.exe" is used in both.


I must be missing a step. This is my BCD store after I run the command lines below

 

 
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  unknown
path                    \EFI\Microsoft\Boot\bootmgfw.efi
description             Windows Boot Manager
locale                  en-us
inherit                 {globalsettings}
default                 {default}
resumeobject            {84abc965-e405-11e8-afa7-7c8bca0118e9}
displayorder            {default}
                        {7619dcc9-fafe-11d9-b411-000476eba25f}
                        {8a3b5fab-daeb-11e8-a321-0026832ea037}
toolsdisplayorder       {memdiag}
timeout                 10
displaybootmenu         Yes


Windows Boot Loader
-------------------
identifier              {7619dcc9-fafe-11d9-b411-000476eba25f}
device                  ramdisk=[boot]\sources\LaddsMini10.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path                    \windows\system32\boot\winload.efi
description             2. Ladd's Mini10PE (Use First)
locale                  en-US
inherit                 {bootloadersettings}
isolatedcontext         Yes
osdevice                ramdisk=[boot]\sources\LaddsMini10.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot              \windows
bootmenupolicy          Legacy
detecthal               Yes
winpe                   Yes
ems                     No


Windows Boot Loader
-------------------
identifier              {default}
device                  locate=\windows\system32\winload.efi
path                    \windows\system32\winload.efi
description             1. Boot To System Drive
locale                  en-us
inherit                 {bootloadersettings}
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
osdevice                locate=\windows\system32\winload.efi
systemroot              \windows
resumeobject            {84abc965-e405-11e8-afa7-7c8bca0118e9}
nx                      OptIn
bootmenupolicy          Standard


Windows Boot Loader
-------------------
identifier              {8a3b5fab-daeb-11e8-a321-0026832ea037}
device                  ramdisk=[boot]\sources\Hirens10PE.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path                    \windows\system32\boot\winload.efi
description             3. Hiren's BootPE 1.0.1
locale                  en-US
osdevice                ramdisk=[boot]\sources\Hirens10PE.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot              \Windows
detecthal               Yes
winpe                   Yes
ems                     No


Resume from Hibernate
---------------------
identifier              {84abc965-e405-11e8-afa7-7c8bca0118e9}
device                  unknown
path                    \windows\system32\winresume.efi
description             Windows Resume Application
locale                  en-us
inherit                 {resumeloadersettings}
isolatedcontext         Yes
allowedinmemorysettings 0x15000075
filepath                \hiberfil.sys
bootmenupolicy          Standard


Windows Memory Tester
---------------------
identifier              {memdiag}
device                  unknown
path                    \EFI\Microsoft\Boot\memtest.efi
description             Windows Memory Diagnostic
locale                  en-us
inherit                 {globalsettings}
badmemoryaccess         Yes


EMS Settings
------------
identifier              {emssettings}
bootems                 No


Debugger Settings
-----------------
identifier              {dbgsettings}
debugtype               Serial
debugport               1
baudrate                115200


RAM Defects
-----------
identifier              {badmemory}


Global Settings
---------------
identifier              {globalsettings}
inherit                 {dbgsettings}
                        {emssettings}
                        {badmemory}


Boot Loader Settings
--------------------
identifier              {bootloadersettings}
inherit                 {globalsettings}
                        {hypervisorsettings}


Hypervisor Settings
-------------------
identifier              {hypervisorsettings}
description             Hypervisor Settings
hypervisordebugtype     Serial
hypervisordebugport     1
hypervisorbaudrate      115200


Resume Loader Settings
----------------------
identifier              {resumeloadersettings}
inherit                 {globalsettings}


Device options
--------------
identifier              {7619dcc8-fafe-11d9-b411-000476eba25f}
ramdisksdidevice        boot
ramdisksdipath          \boot\boot.sdi

bcdedit.exe /store bcd /set {84abc966-e405-11e8-afa7-7c8bca0118e9} device locate=custom:12000002
bcdedit.exe /store bcd /set {84abc966-e405-11e8-afa7-7c8bca0118e9} osdevice locate=custom:12000002

But I am still getting the light blue recovery screen if I use the "Boot System Drive" option

 

 

The winload.exe isn't there. Is that 12000002 correct?


Edited by LostNspace, 5 days ago.


#12 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 4 days ago

LostNspace you can boot your USB grub2 menu on a Secure Boot EFI system if you follow the steps I posted here:

http://reboot.pro/to...e-4#entry207893 about a month ago.

 

 

Thanks for the reply. I will look into this method as well. Just curious tho will grub2 boot in any secure boot situation? What I mean is the way I have my three boot options set up  now I know this will always be secure boot compatible because it's legit Microsoft files. It's a shame I would have to use something like grub2 just to boot the system drive when my other two PE boots work so well from the BCD.



#13 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago

I actually installed grub2 files from the secure boot Ubuntu as mentioned above by 911CD.net and added this to the grub.cfg and was able to successfully boot Win 10 on my secure boot laptop. 

menuentry 'Windows 10' {

search --set=root --file /EFI/Microsoft/Boot/bootmgfw.efi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Now I just need to figure out how to boot my two Winpe from the grub.cfg menu



#14 wimb

wimb

    Gold Member

  • Developer
  • 2302 posts
  •  
    Netherlands

Posted 3 days ago

On USB drive I have made with BOOTICE Professional mode a New entry for booting Local Harddisk with Windows 10 

 

I have added New Element BootMenuPolicy with value Legacy

Windows Boot Loader
-------------------
identifier              {83891d32-cdd3-4301-b665-bdbd22baf78c}
device                  boot
path                    \Windows\system32\winload.efi
description             Windows 10 HDD
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
                        {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
osdevice                boot
systemroot              \Windows
resumeobject            {db2c7793-30a2-4711-aadf-61b056ab9d7d}
bootmenupolicy          Legacy

This entry was then modified with bcdedit in admin cmd window according to the description given by cdob

bcdedit.exe /store N:\efi\microsoft\boot\bcd /set {83891d32-cdd3-4301-b665-bdbd22baf78c} device locate=custom:12000002
bcdedit.exe /store N:\efi\microsoft\boot\bcd /set {83891d32-cdd3-4301-b665-bdbd22baf78c} osdevice locate=custom:12000002


Then the entry for boooting local harddisk with windows 10 is looking like

Windows Boot Loader
-------------------
identifier              {83891d32-cdd3-4301-b665-bdbd22baf78c}
device                  locate=custom:12000002
path                    \Windows\system32\winload.efi
description             Windows 10 HDD
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
                        {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
osdevice                locate=custom:12000002
systemroot              \Windows
resumeobject            {db2c7793-30a2-4711-aadf-61b056ab9d7d}
bootmenupolicy          Legacy

This entry selected from USB EFI Boot menu is working OK for UEFI Secure booting of Windows 10 from local harddisk.



#15 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago

On USB drive I have made with BOOTICE Professional mode a New entry for booting Local Harddisk with Windows 10 

 

I have added New Element BootMenuPolicy with value Legacy

Windows Boot Loader
-------------------
identifier              {83891d32-cdd3-4301-b665-bdbd22baf78c}
device                  boot
path                    \Windows\system32\winload.efi
description             Windows 10 HDD
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
                        {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
osdevice                boot
systemroot              \Windows
resumeobject            {db2c7793-30a2-4711-aadf-61b056ab9d7d}
bootmenupolicy          Legacy

This entry was then modified with bcdedit in admin cmd window according to the description given by cdob

bcdedit.exe /store N:\efi\microsoft\boot\bcd /set {83891d32-cdd3-4301-b665-bdbd22baf78c} device locate=custom:12000002
bcdedit.exe /store N:\efi\microsoft\boot\bcd /set {83891d32-cdd3-4301-b665-bdbd22baf78c} osdevice locate=custom:12000002


Then the entry for boooting local harddisk with windows 10 is looking like

Windows Boot Loader
-------------------
identifier              {83891d32-cdd3-4301-b665-bdbd22baf78c}
device                  locate=custom:12000002
path                    \Windows\system32\winload.efi
description             Windows 10 HDD
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
                        {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
osdevice                locate=custom:12000002
systemroot              \Windows
resumeobject            {db2c7793-30a2-4711-aadf-61b056ab9d7d}
bootmenupolicy          Legacy

This entry selected from USB EFI Boot menu is working OK for UEFI Secure booting of Windows 10 from local harddisk.

 

 

Thank you! I will give this a try. What Windows version are you using bcdedit from?



#16 wimb

wimb

    Gold Member

  • Developer
  • 2302 posts
  •  
    Netherlands

Posted 3 days ago

Thank you! I will give this a try. What Windows version are you using bcdedit from?

 

Windows 10 Home version 1803



#17 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago

I'm not exactly sure what I am doing wrong but I did as you suggested, wimb. This is how my entry looks after.

Windows Boot Loader
-------------------
identifier              {3eb7af9b-a369-4cc6-ab3a-59e2c5e55e2b}
device                  locate=\Windows\system32\winload.efi
path                    \Windows\system32\winload.efi
description             Win10
locale                  en-US
inherit                 {bootloadersettings}
osdevice                locate=\Windows\system32\winload.efi
systemroot              \Windows
resumeobject            {b21f46df-401b-44b5-9ee6-28897fdd3319}
bootmenupolicy          Legacy


#18 wimb

wimb

    Gold Member

  • Developer
  • 2302 posts
  •  
    Netherlands

Posted 3 days ago

Your entry seems OK and corresponds well to mine.

 

I have used enum /v so that the real values are visible instead of friendly names

bcdedit.exe /store N:\efi\microsoft\boot\bcd /enum /v

Is your entry still not working ?

 

When I don't use /v then the entry is looking like

Windows Boot Loader
-------------------
identifier              {83891d32-cdd3-4301-b665-bdbd22baf78c}
device                  locate=\Windows\system32\winload.efi
path                    \Windows\system32\winload.efi
description             Windows 10 HDD
locale                  en-US
inherit                 {bootloadersettings}
                        {globalsettings}
osdevice                locate=\Windows\system32\winload.efi
systemroot              \Windows
resumeobject            {db2c7793-30a2-4711-aadf-61b056ab9d7d}
bootmenupolicy          Legacy

The difference with yours is that in my entry {globalsettings} are inherited as well, but I don't know if that is important ....



#19 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago

Your entry seems OK and corresponds well to mine.

 

I have used enum /v so that the real values are visible instead of friendly names

bcdedit.exe /store N:\efi\microsoft\boot\bcd /enum /v

Is your entry still not working ?

 

Using the /v switch Here is mine and still not working :(

Windows Boot Loader
-------------------
identifier              {3eb7af9b-a369-4cc6-ab3a-59e2c5e55e2b}
device                  locate=custom:12000002
path                    \Windows\system32\winload.efi
description             Win10
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
osdevice                locate=custom:12000002
systemroot              \Windows
resumeobject            {b21f46df-401b-44b5-9ee6-28897fdd3319}
bootmenupolicy          Legacy



#20 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago

I tried it again from scratch.

 

Here is the BCD entry:

Windows Boot Loader
-------------------
identifier              {c22526af-340f-4d79-aa11-83e89ee79e16}
device                  locate=custom:12000002
path                    \Windows\system32\winload.efi
description             Boot System HD
locale                  en-US
inherit                 {6efb52bf-1766-41db-a6b3-0ee5eff72bd7}
                        {7ea2e1ac-2e61-4728-aaa3-896d9d0a9f0e}
osdevice                locate=custom:12000002
systemroot              \Windows
resumeobject            {175f0d78-e811-4127-a28b-4d16dae5b68f}
bootmenupolicy          Legacy

And this is the error I am getting. This is on a Dell Laptop (new) with secure boot on.

 

gAcbDA.jpg


Edited by LostNspace, 3 days ago.


#21 wimb

wimb

    Gold Member

  • Developer
  • 2302 posts
  •  
    Netherlands

Posted 3 days ago

Everything seems OK and I have no idea why it does not work for you ....

 

What is the partitioning of your USB drive ?  MBR or GPT with/without EFI partition ?

 

I have portable SSD 250 GB and MBR partitioning with 1st partition 20 GB FAT32 Set Active and 2nd partition NTFS

 

to be most compatible for booting on any hardware in BIOS or UEFI mode as described here



#22 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago

Everything seems OK and I have no idea why it does not work for you ....

 

What is the partitioning of your USB drive ?  MBR or GPT with/without EFI partition ?

 

I have portable SSD 250 GB and MBR partitioning with 1st partition 20 GB FAT32 Set Active and 2nd partition NTFS

 

to be most compatible for booting on any hardware in BIOS or UEFI mode as described here

 

 

I have no explanation for this but I booted into my WinPE because I had to re-image that laptop any way. I left the newly created entry as you suggested in my BCD with that "Boot To System Drive" as the default with a time out. WinNTSetup finished applying the image, the computer rebooted, booted to the USB drive as usually, my custom BCD menu came up and I let the timer go and it actually booted to the Win 10 machine. Everything seems to be working now. :blink:



#23 wimb

wimb

    Gold Member

  • Developer
  • 2302 posts
  •  
    Netherlands

Posted 3 days ago

Nice to hear that the problem seems to be solved for you now ....

 

:cheers:


  • LostNspace likes this

#24 LostNspace

LostNspace

    Newbie

  • Members
  • 19 posts
  •  
    United States

Posted 3 days ago



Nice to hear that the problem seems to be solved for you now ....

 

:cheers:

 

 

Well I thought I was issue free. If I let the WinNTSetup finish and reboot, then boot the hard drive from the BCD on my USB setup starts as normal then about half way into the setup I get this:

 

0lMPpu.jpg

 

If I pull the USB out while this message is up and the little circle is spinning, the circle will freeze like it's connected to the USB as far as the boot loader. If I unplug the USB before setup starts and let the system drive boot and finish the install and then boot the system drive from my bcd on the USB all is well. It's something that doesn't like the fact I booted the system drive from the bcd before the install could complete.

 

 

I guess what I am saying is that as long as the OS is fully installed I can boot the system drive from my USB with no problems but on a reinstall the system doesn't like me booting the drive from my USB BCD.


Edited by LostNspace, 3 days ago.


#25 wimb

wimb

    Gold Member

  • Developer
  • 2302 posts
  •  
    Netherlands

Posted 3 days ago

 

 

Well I thought I was issue free. If I let the WinNTSetup finish and reboot, then boot the hard drive from the BCD on my USB setup starts as normal then about half way into the setup I get this:

 

0lMPpu.jpg

 

If I pull the USB out while this message is up and the little circle is spinning, the circle will freeze like it's connected to the USB as far as the boot loader. If I unplug the USB before setup starts and let the system drive boot and finish the install and then boot the system drive from my bcd on the USB all is well. It's something that doesn't like the fact I booted the system drive from the bcd before the install could complete.

 

 

I guess what I am saying is that as long as the OS is fully installed I can boot the system drive from my USB with no problems but on a reinstall the system doesn't like me booting the drive from my USB BCD.

 

I recognize this behaviour ....

During Install of Windows 10 then an EFI GPT partition for the efi boot files is required.

 

I get the same when installing Windows 10 in VHDX and using USB FAT32 drive as boot drive.

I solved the problem by using the GPT EFI partition of my local GPT harddisk as boot drive during install in VHDX.

After Install in VHDX I copy the VHDX to NTFS drive of portable SSD and can boot the VHDX using boot files located on MBR FAT32 partition of portable SSD.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users