0

Before i am told just do it in bios

the issue is this, the computer is connected to a PXE server and when all the machines were legacy bios, i could just disable the disk and reimage the machine. Disable reboot. Machine will boot and install a fresh OS. So i don't want to be walking to these 1000s of machines pressing bios buttons and such. Needs to be automated. Hard disk is first, when disabled it boots to USB.

Question

When using a legacy bios,

You can run a command as an admin user to disable to disk from booting. hardware boot options as such:

  • Disk
  • Usb
  • Network

Then when you can disable the disk with diskpart and mark it as inactive.

On UEFI bios this doesn't work

_________my understanding of the issue__________

This is because on a uefi machine windows is using a Bootmgr

This is because it is using a Windows Boot Manager

bcdedit /enum

Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=\Device\HarddiskVolume1
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {f665eab4-5d61-11e7-b384-e1075a4080e3}
displayorder            {current}
toolsdisplayorder       {memdiag}
timeout                 30

I have had numerous attempts at disabling this. This is what I have tried.

bcdedit /deletevalue

This was to delete device partition=c I have tried it on osdevice

I have tried

bcdedit /delete {...}

this was to delete my current boot entry.

Any of these doesn't lead to the required results and just leads to either the OS not booting, or attempting to recover itself.

How do I disable the boot store, and have the computer boot from a USB

3
  • You should be able to select the boot device in the BIOS. If you give USB a higher boot priority than the hard disc in the BIOS set-up, or press the key for boot options and choose the USB device, you won't need to do anything on the hard disc itself.
    – AFH
    Nov 20, 2017 at 22:26
  • the issue is this, the computer is connected to a PXE server and when all the machines were legacy bios, i could just disable the disk and reimage the machine. Disable reboot. Machine will boot and install a fresh OS. So i don't want to be walking to these 1000s of machines pressing bios buttons and such. Needs to be automated.
    – Lpc_dark
    Nov 20, 2017 at 22:29
  • 1
    Now I understand, but surely you would want a network boot, not from USB, which would need someone to visit each machine?
    – AFH
    Nov 20, 2017 at 22:34

1 Answer 1

1

First of all lets get one thing out of the way. UEFI is NOT BIOS. That sounds like semantic squabbling but here it really matters. What you were doing before is setting the boot priority to harddisk and then from the OS to set the boot partition(s) disabled in the partition table so the bios skips past the harddisk onto usb and network options.

In a UEFI system (without using CSM) then the disk is partitioned with GPT. One does not set or disable a boot flag on GPT. You could although it'd be hacky, is set the partition type of the ESP to something else. But as it turns out UEFI provides you with a way to do what you want elegantly.

Editing the BCD store is going to tend to not do what you expect because it doesn't normally affect NVRAM which means the windows boot loader is still started even if the boot options are deleted.

What you want to do is ask the UEFI to change its boot order. The efibootmgr command does this on Linux but on windows its somewhat obscured.

First type

bcdedit /enum firmware

One of those entries should be "network boot" if you have it enabled from UEFI. Then copy the indentifier into the next command:

bcdedit /bootsequence <identifier>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .