Boot manager on drive A suddenly points to drive B?

Discussion in 'SSD and HDD storage' started by AsiJu, Jul 24, 2020.

  1. AsiJu

    AsiJu Ancient Guru

    Messages:
    6,458
    Likes Received:
    1,607
    GPU:
    MSI RTX 2070 Armor
    I think everything with GUID {357f633b-4d45-11e8-8ca0-ebe1514788ea} are related to second drive and can be removed.
    At least that ID points to E:\ drive in Boot Loader entry.

    Can you link a guide on how to remove entries with bcdedit? Or bcdedit usage in general.
    However if anything I'm more confused.


    Boot Manager readily has:
    Code:
    device                  partition=\Device\HarddiskVolume5
    path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
    
    I thought this should refer to your EFI partition? Or is the boot manager located in EFI partition but this actually points to the bootable volume?
    Because in

    https://docs.microsoft.com/en-us/wi...re/desktop/bcd-system-store-settings-for-uefi

    they instruct you to refer to EFI partition with this information unless I understood it all wrong. EFI partition would be HarddiskVolume4 in my case.
    The device element specifies the volume that contains Windows Boot Manager. For UEFI systems, the device element for Windows Boot Manager is set to the system partition volume letter. To determine the correct volume letter, use the Diskpart tool to view the disk partitions. The following example assumes that the system has a single hard drive that has multiple partitions, including a system partition that has been assigned a drive letter of S.
    Code:
    DISKPART> select disk 0
    DISKPART> list volume
    
      Volume ###  Ltr  Label   Fs     Type        Size     Status     Info
      ----------  ---  ------  -----  ----------  -------  ---------  ------
      Volume 0     D           NTFS   Partition    103 GB  Healthy
      Volume 1     C           NTFS   Partition     49 GB  Healthy    Boot
      Volume 2     S           FAT32  Partition    200 MB  Healthy    System
    


    Also what do you make of this:
    Code:
    Firmware Boot Manager
    ---------------------
    identifier              {fwbootmgr}
    displayorder            {bootmgr}
                           {f04f5518-c466-11ea-8cea-806e6f6e6963}
                           {f04f5517-c466-11ea-8cea-806e6f6e6963}
    
    
    why are there 2 entries with the same identifier below {bootmgr} in displayorder? Should these actually refer to the two Windows installations and have 2 different IDs?
    Is this the reason I have only one bootable installation now?

    If so, can I edit this information as well?
     
    Last edited: Jul 30, 2020 at 8:25 AM
  2. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,367
    Likes Received:
    6,278
    GPU:
    GF RTX 2070 Super
    2 entries are not the same identifiers: {f04f5518-c466-11ea-8cea-806e6f6e6963} and {f04f5517-c466-11ea-8cea-806e6f6e6963} - these point to hard disk and optical disk UEFI "applications"
    Code:
    Firmware Application (101fffff)
    -------------------------------
    identifier              {f04f5517-c466-11ea-8cea-806e6f6e6963}
    description             Hard Drive
    
    Firmware Application (101fffff)
    -------------------------------
    identifier              {f04f5518-c466-11ea-8cea-806e6f6e6963}
    description             CD/DVD Drive
    
    PS As for a guide I have several articles, I will compile them for your case (a bit later).
     
  3. AsiJu

    AsiJu Ancient Guru

    Messages:
    6,458
    Likes Received:
    1,607
    GPU:
    MSI RTX 2070 Armor
    Ah, slight difference.

    But how about the Windows Boot Manager entry then, I still think it's not according to MS' instructions?

    Thanks for providing a guide, no rush.
     
  4. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,367
    Likes Received:
    6,278
    GPU:
    GF RTX 2070 Super
    @AsiJu

    Start elevated command prompt.

    Export BCD into file (I assumed the presence of folder "c:\temp")
    Bcdedit /export c:\temp\originalbcd.bin​

    Make a working copy of file
    copy c:\temp\originalbcd.bin c:\temp\newbcd.bin​

    Delete orphan entries from the working copy
    Bcdedit /store c:\temp\newbcd.bin /delete {357f633b-4d45-11e8-8ca0-ebe1514788ea}
    Bcdedit /store c:\temp\newbcd.bin /delete {357f633c-4d45-11e8-8ca0-ebe1514788ea}
    Bcdedit /store c:\temp\newbcd.bin /delete {357f633e-4d45-11e8-8ca0-ebe1514788ea}
    Bcdedit /store c:\temp\newbcd.bin /delete {357f633f-4d45-11e8-8ca0-ebe1514788ea}
    Bcdedit /store c:\temp\newbcd.bin /delete {dbcfa084-c4fa-11ea-a858-ebcf5c48de53}​

    Check the final state of the working copy
    Bcdedit /store c:\temp\newbcd.bin /enum all​
    Code:
    Firmware Boot Manager
    ---------------------
    identifier              {fwbootmgr}
    displayorder            {bootmgr}
                            {f04f5518-c466-11ea-8cea-806e6f6e6963}
                            {f04f5517-c466-11ea-8cea-806e6f6e6963}
    timeout                 2
    
    Windows Boot Manager
    --------------------
    identifier              {bootmgr}
    device                  partition=\Device\HarddiskVolume5
    path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
    description             Windows Boot Manager
    locale                  fi-FI
    inherit                 {globalsettings}
    default                 {current}
    resumeobject            {a9b0c0db-269b-11ea-b9f0-fd95bc072250}
    displayorder            {current}
    toolsdisplayorder       {memdiag}
    timeout                 3
    
    Firmware Application (101fffff)
    -------------------------------
    identifier              {f04f5517-c466-11ea-8cea-806e6f6e6963}
    description             Hard Drive
    
    Firmware Application (101fffff)
    -------------------------------
    identifier              {f04f5518-c466-11ea-8cea-806e6f6e6963}
    description             CD/DVD Drive
    
    Windows Boot Loader
    -------------------
    identifier              {current}
    device                  partition=C:
    path                    \Windows\system32\winload.efi
    description             Windows 10
    locale                  fi-FI
    inherit                 {bootloadersettings}
    recoverysequence        {a9b0c0dd-269b-11ea-b9f0-fd95bc072250}
    displaymessageoverride  Recovery
    recoveryenabled         Yes
    isolatedcontext         Yes
    allowedinmemorysettings 0x15000075
    osdevice                partition=C:
    systemroot              \Windows
    resumeobject            {a9b0c0db-269b-11ea-b9f0-fd95bc072250}
    nx                      OptIn
    bootmenupolicy          Standard
    
    Windows Boot Loader
    -------------------
    identifier              {a9b0c0dd-269b-11ea-b9f0-fd95bc072250}
    device                  ramdisk=[C:]\Recovery\WindowsRE\Winre.wim,{a9b0c0de-269b-11ea-b9f0-fd95bc072250}
    path                    \windows\system32\winload.efi
    description             Windows Recovery Environment
    locale                  fi-fi
    inherit                 {bootloadersettings}
    displaymessage          Recovery
    osdevice                ramdisk=[C:]\Recovery\WindowsRE\Winre.wim,{a9b0c0de-269b-11ea-b9f0-fd95bc072250}
    systemroot              \windows
    nx                      OptIn
    bootmenupolicy          Standard
    winpe                   Yes
    
    Resume from Hibernate
    ---------------------
    identifier              {a9b0c0db-269b-11ea-b9f0-fd95bc072250}
    device                  partition=C:
    path                    \Windows\system32\winresume.efi
    description             Windows Resume Application
    locale                  fi-FI
    inherit                 {resumeloadersettings}
    recoverysequence        {a9b0c0dd-269b-11ea-b9f0-fd95bc072250}
    recoveryenabled         Yes
    isolatedcontext         Yes
    allowedinmemorysettings 0x15000075
    filedevice              partition=C:
    filepath                \hiberfil.sys
    bootmenupolicy          Standard
    debugoptionenabled      No
    
    Windows Memory Tester
    ---------------------
    identifier              {memdiag}
    device                  partition=\Device\HarddiskVolume5
    path                    \EFI\Microsoft\Boot\memtest.efi
    description             Windowsin muistidiagnostiikka
    locale                  fi-FI
    inherit                 {globalsettings}
    badmemoryaccess         Yes
    
    EMS Settings
    ------------
    identifier              {emssettings}
    bootems                 No
    
    Debugger Settings
    -----------------
    identifier              {dbgsettings}
    debugtype               Local
    
    RAM Defects
    -----------
    identifier              {badmemory}
    
    Global Settings
    ---------------
    identifier              {globalsettings}
    inherit                 {dbgsettings}
                            {emssettings}
                            {badmemory}
    
    Boot Loader Settings
    --------------------
    identifier              {bootloadersettings}
    inherit                 {globalsettings}
                            {hypervisorsettings}
    
    Hypervisor Settings
    -------------------
    identifier              {hypervisorsettings}
    hypervisordebugtype     Serial
    hypervisordebugport     1
    hypervisorbaudrate      115200
    
    Resume Loader Settings
    ----------------------
    identifier              {resumeloadersettings}
    inherit                 {globalsettings}
    
    Device options
    --------------
    identifier              {a9b0c0de-269b-11ea-b9f0-fd95bc072250}
    description             Windows Recovery
    ramdisksdidevice        partition=C:
    ramdisksdipath          \Recovery\WindowsRE\boot.sdi
    

    Import working copy back, with clean option
    Bcdedit /import c:\temp\newbcd.bin /clean​

    And if something went wrong you can restore the original BCD by
    Bcdedit /import c:\temp\originalbcd.bin /clean​
     
    Last edited: Aug 1, 2020 at 2:14 PM
    AsiJu likes this.

  5. AsiJu

    AsiJu Ancient Guru

    Messages:
    6,458
    Likes Received:
    1,607
    GPU:
    MSI RTX 2070 Armor
    Thanks a lot!

    If and when I migrate the EFI partition to Intel drive afterwards, I suppose all I should need to do then is update "device" entry in Boot Manager to point to correct volume?

    Which then is the OS partition instead of EFI partition I guess.

    (I'll run cmd via setup / bootable USB to be able to do that).
     
  6. mbk1969

    mbk1969 Ancient Guru

    Messages:
    9,367
    Likes Received:
    6,278
    GPU:
    GF RTX 2070 Super
    With file
    bcdedit /store c:\temp\newbcd.bin /set {bootmgr} device partition=C:​
    with live BCD
    bcdedit /set {bootmgr} device partition=C:​
    (or partition=\Device\HarddiskVolumeN)

    Code:
    This command sets an entry option value in the boot configuration data store.
    bcdedit [/store <filename>] /set [{<id>}] <datatype> <value> [ /addfirst | /addlast | /remove ]
        <filename>  Specifies the store to be used. If this option is not
                    specified, the system store is used. For more information,
                    run "bcdedit /? store".
        <id>        Specifies the identifier of the entry to be modified.  If not
                    specified, {current} is used. For more information about
                    identifiers, run "bcdedit /? ID".
        <datatype>  Specifies the option data type that will be created or
                    modified. Run "bcdedit /? TYPES" for more information about
                    data types.
        <value>     Specifies the value that should be assigned to the option. The
                    format of <value> depends on the data type specified. Run
                    "bcdedit /? FORMATS" for more information about data formats.
        /addfirst   This switch can only be used if datatype is an object list.
                    Adds the specified entry identifier to the top of the list.
                    If this switch is specified, only a single entry identifier
                    may be specified.  If the specified identifier is already
                    in the list, it will be moved to the top of the list.
        /addlast    This switch can only be used if datatype is an object list.
                    Adds the specified entry identifier to the end of the list.
                    If this switch is specified, only a single entry identifier
                    may be specified.  If the specified identifier is already
                    in the list, it is moved to the end of the list.
        /remove     This switch can only be used if datatype is an object list.
                    Removes the specified entry identifier from the list.
                    If this switch is specified, only a single entry identifier
                    may be specified.  If the identifier is not in the list
                    then the operation has no effect. If the last entry is being
                    removed, then the datatype value is deleted.
    Examples:
    The following command sets the application device to the partition C: for the
    specified operating system entry:
        bcdedit /set {cbd971bf-b7b8-4885-951a-fa03044f5d71} device partition=C:
        NOTE: Use 'hd_partition=' syntax to explicitly disable automatic VHD
              detection, and create entries that are compatible for booting a
              virtual machine, i.e.,
        bcdedit /store F:\boot\bcd /set {default} device hd_partition=F:
    The following command sets the OS device to a VHD file (C:\vdisks\vdisk01.vhd)
    for the specified operating system entry:
        bcdedit /set {cbd971bf-b7b8-4885-951a-fa03044f5d71} osdevice
            vhd=[C:]\vdisks\disk01.vhd
    The following command sets the application path to
    \windows\system32\winload.exe for the specified operating system entry:
        bcdedit /set {cbd971bf-b7b8-4885-951a-fa03044f5d71} path
            \windows\system32\winload.exe
    The following command sets the NX policy to OptIn for the current operating
    system boot entry.
        bcdedit /set nx optin
    
    ***
    
    IDENTIFIERS
    Many of the Bcdedit commands require identifiers. An identifier
    uniquely identifies entries contained in the store. An identifier takes the
    form of a globally unique identifier, or GUID. A GUID has the following format,
    where each "x" represents a hexadecimal digit.
        {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
    For example:
        {d2b69192-8f14-11da-a31f-ea816ab185e9}
    The position of the dashes (-) and the braces at the beginning and end of the
    GUID are required.
    Several entries can be identified by well-known identifiers. If an entry has a
    well-known identifier, BCDedit displays it in output unless the /v command-line
    switch is used. For more information, run "bcdedit /? /v".
    The well-known identifiers are as follows:
        {bootmgr}               Specifies the Windows boot manager entry.
        {fwbootmgr}             Specifies the firmware boot manager entry,
                                specifically on systems that implement the
                                Extensible Firmware Interface (EFI) specification.
        {memdiag}               Specifies the memory diagnostic application entry.
        {ntldr}                 Specifies a OS loader (Ntldr) that can be used
                                to start operating systems earlier than Windows
                                Vista.
        {current}               Specifies a virtual identifier that corresponds to
                                the operating system boot entry for the operating
                                system that is currently running.
        {default}               Specifies a virtual identifier that corresponds to
                                the boot manager default application entry.
        {ramdiskoptions}        Contains the additional options required by the
                                boot manager for RAM disk devices.
        {dbgsettings}           Contains the global debugger settings that can be
                                inherited by any boot application entry.
        {emssettings}           Contains the global Emergency Management Services
                                settings that can be inherited by any boot
                                application entry.
        {badmemory}             Contains the global RAM defect list that can be
                                inherited by any boot application entry.
        {globalsettings}        Contains the collection of global settings that
                                should be inherited by all boot application
                                entries.
        {bootloadersettings}    Contains the collection of global settings that
                                should be inherited by all Windows boot loader
                                application entries.
        {resumeloadersettings}  Contains the collection of global settings that
                                should be inherited by all Windows resume from
                                hibernation application entries.
        {hypervisorsettings}    Contains the hypervisor settings that can
                                be inherited by any OS loader entry.
    ***
    The following describes the formats of the data that are required for
    <datatypes> used with the /set command. The format that is required depends on
    the <datatypes> that you specify with the /set command. For more information
    about the formats associated with each <datatype>, run "bcdedit /? TYPES".
    bool    A boolean value. The following values correspond to TRUE:
                1, ON, YES, TRUE
            The following values correspond to FALSE:
                0, OFF, NO, FALSE
    device  A device can be one of the following types:
                BOOT
                PARTITION=<drive>
                HD_PARTITION=<drive>
                FILE=[<parent>]<path>
                RAMDISK=[<parent>]<path>,<optionsid>
                VHD=[<parent>]<path>,<locatecustom>
                LOCATE[=<locatecustom>]
            The options for these types are:
                <drive>        A drive letter with a colon and no trailing
                               backslashes.
                <parent>       (Required) Can be either BOOT, LOCATE, or a drive
                               letter with colon.  The square brackets do not
                               indicate that this is optional, but are a literal
                               part of the syntax.
                <path>         A path to the file (or .wim file) from the root of
                               the parent device.
                <optionsid>    The identifier to the device options entry that
                               contains the system deployment image (SDI) options
                               for the RAM disk. This is usually
                               {ramdisksdioptions}.
                <locatecustom> Supplies an optional element used to locate a
                               device by looking for a specified path. The
                               default locate element for a device is its
                               application path (systemroot for an osdevice).
                               Custom values must be specified using custom
                               element syntax (see -help types customtypes),
                               for example: locate=custom:22000002.
    id      An entry identifier, which refers to an entry in the boot configuration
            data store. Run "bcdedit /? ID" for more information about identifiers.
    integer A 64-bit integer type.  Some integer types can be set using enumerated
            values.
    integerlist     A list of one or more 64-bit integers, separated by spaces.
                    This list should not be enclosed in quotation marks.
    list    An entry identifier list. It contains one or more entry identifiers
            separated by spaces. The list should not be enclosed in quotation
            marks.
    string  A literal string. If it contains spaces, it should be surrounded by
            quotation marks ("").
    
    ***
    
    TYPES
    The /set and /deletevalue commands require a <datatype> as a parameter.
    <datatype> uniquely identifies both the data format and meaning of the value.
    Data types are identified using either a name or a custom type. The names are
    listed below, along  with their data formats (in parentheses) and a short
    description of the custom type. If a format is not specified, then the
    description lists the literal values that you can use for that type. For
    information about data formats, run "bcdedit /? formats".
    The following types are valid for any entry. For information about types that
    are specific to a particular entry, such as boot manager entries or the Windows
    OS Loader entries, see the end of this help topic.
    Entries
    =======
        DESCRIPTION (string)    Defines the description of the entry.
        PATH (string)           Defines the path to the application.
        DEVICE (device)         Defines the device that the application resides on.
        INHERIT (list)          Defines the list of entries to be inherited.
    For information about additional types for device objects, run
    "bcdedit /? TYPES DEVOBJECT".
    For information about additional types for particular applications,
    run "bcdedit /? TYPES <apptype>", where <apptype> is one of the following:
    BOOTAPP     Boot applications. These types also apply to the boot manager,
                memory diagnostic application, Windows OS loader, and the resume
                application.
    BOOTMGR     Boot manager.
    BOOTSECTOR  Boot sector application.
    CUSTOMTYPES Custom types.
    DEVOBJECT   Device object additional options.
    FWBOOTMGR   Firmware boot manager
    MEMDIAG     Memory diagnostic application
    NTLDR       OS loader that shipped with earlier Windows OS
    OSLOADER    Windows Vista OS loader
    RESUME      Resume application
    

    Also you can use switch "/v" to see GUIDs instead of "{bootmgr}", "{current}" - so called well known identifiers:
    bcdedit /enum all /v​
     
    AsiJu likes this.

Share This Page