Share via

REAGENTC.EXE: Unable to update Boot Configuration Data.

Anonymous
2023-04-19T12:50:25+00:00

I am unable to enable WindowsRE?

Windows for home | Windows 11 | Recovery and backup

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2023-04-21T04:29:52+00:00

(1) You've got two System partitions each with its own BCD. C partition is doubling as a System partition, & EFI is a System partition...

Image

That is likely what is confusing ReagentC. It needs to find the BCD in order to enable the Recovery partition. We need to tell Windows that EFI is to be used -- not C. Let's try this...

DiskPart<<<Enter DiskPart

List  Vol<<<List the volumes & letters

Select  Vol  7           <<<Select EFI -- I guess it's still Volume 7

Assign  Letter=S     <<<Give it letter S -- unless List Vol shows it's already there

Exit<<<Exit Diskpart

BCDBoot  C:\Windows  /s  S:  /f  UEFI <<< **** Rebuild the BCD in EFI & all other boot files.

A reboot will be necessary to inform the rest of Windows of the change.

(a) I'm unsure that actually tells Windows to use EFI.

(b) I'm unsure whether that will also remove the System attribute from C.

(c) I'm unsure exactly what would remove it.

(d) So, maybe try this before the reboot...

REN C:\EFI EFI_unwanted <<<Rename the folder

..........................................................................

Then -- if it turns out it can't reboot -- you'll have to rename it back in the recovery environment, thus...

(a) At the Choose an Option screen, click "Troubleshoot > Advanced Options > Command Prompt".

(b) Enter the following commands...

DiskPart

List Vol

Exit

The Windows partition may have a different letter here. Use it instead of C in the following command...

REN C:\EFI_unwanted EFI <<<Rename it back

......................................................................

(2) After the reboot (presuming it did)...

Does BCDEdit /Enum {fwbootmgr} now show {bootmgr} on top?

Does BCDEdit /Enum {Bootmgr} name either HarddiskVolume9 or S: as the Device?

If so, try again...

ReagentC /Disable <<<Moves WinRE.wim to staging area

ReagentC /Enable <<<Moves it to the Recovery partition

ReagentC /Info <<<Show whether it is enabled

If it isn't enabled, let's see C:\Windows\Logs\ReAgent\Reagent.log. Just copy/paste the output of those three commands from the bottom of the log.

(3) A volume is a partition that has a file system on it. The Volume numbers enumerated by DiskPart are not the same as the HarddiskVolume numbers enumerated in the BCD. The BCD counts all partitions (with or without a file system) starting from Disk 0. Disk Management won't show them all. DiskPart will show them, this way...

DiskPart <<<Enter DiskPart

List Disk <<<List your 8 disks

Select Disk 0 <<<Focus on Disk 0

List Part <<<List its partitions

Select Disk 1

List Part

=== Continue with Disks 2 through 7 ===

Exit <<<Leave DiskPart

Looking at your prior listings, I now think the 8th partition down will be C. And EFI will be partition 9. Disks 0-5 will have 1 partition each, then Disk 6 shows...

Image

So -- HarddiskVolume8 is the Windows partition. (EFI is HarddiskVolume9). Yep, the BCD that is on C (shown with /Store) shows the letter...

Image

The one that is on EFI (S:) shows...

Image

We want the one on EFI (S:) to be the only one. Windows gets confused when there is more than one System partition.

Was this answer helpful?

10+ people found this answer helpful.
0 comments No comments

72 additional answers

Sort by: Most helpful
  1. Anonymous
    2023-04-25T04:22:49+00:00

    (1) Here is a good /Disable I just ran. It opens the BCD to find out where WinRE.wim is, then moves it to the staging area which is the C:\WINDOWS\system32\Recovery folder. Then it removes all the Recovery entries that are in the BCD. I looked, they are all gone. WinRE.wim will sit inactive in the staging area until a /Enable is performed...

    2023-04-24 22:10:09, Info [ReAgentc.exe] ------------------------------------------------------

    2023-04-24 22:10:09, Info [ReAgentc.exe] -----Executing command line: ReagentC /Disable-----

    2023-04-24 22:10:09, Info [ReAgentc.exe] ------------------------------------------------------

    2023-04-24 22:10:09, Info [ReAgentc.exe] Enter WinReUnInstall

    2023-04-24 22:10:09, Info [ReAgentc.exe] Update enhanced config info is enabled.

    2023-04-24 22:10:09, Info [ReAgentc.exe] WinRE is installed

    2023-04-24 22:10:27, Info [ReAgentc.exe] winreCopyWIMBack moved WIM file from \?\GLOBALROOT\device\harddisk0\partition4\Recovery\WindowsRE\ to C:\WINDOWS\system32\Recovery\Winre.wim successfully!

    2023-04-24 22:10:27, Info [ReAgentc.exe] WinRE uninstall step 1 succeeded: copy WIM file back to its staging location

    2023-04-24 22:10:28, Info [ReAgentc.exe] WinRE uninstall step 2 succeeded: update agent config for BCD id, install state, schedule operation.

    2023-04-24 22:10:29, Info [ReAgentc.exe] The current Recovery BCD entry points to \Device\HarddiskVolume4[\Recovery\WindowsRE\Winre.wim]

    2023-04-24 22:10:29, Info [ReAgentc.exe] The WIM file being unregistered is \Device\HarddiskVolume4[\Recovery\WindowsRE\Winre.wim]

    2023-04-24 22:10:29, Info [ReAgentc.exe] Paths are the same, clearing Recovery BCD

    2023-04-24 22:10:29, Info [ReAgentc.exe] Cleared recovery BCD successfully

    2023-04-24 22:10:30, Info [ReAgentc.exe] WinRE uninstall step 3 succeeded: unregister winre.wim from recovery BCD.

    2023-04-24 22:10:30, Info [ReAgentc.exe] WinRE uninstall step 4 succeeded: remove recovery related sequence from BCD.

    2023-04-24 22:10:30, Info [ReAgentc.exe] WinRE uninstall step 5 completed with return value TRUE: remove validation task.

    2023-04-24 22:10:30, Info [ReAgentc.exe] Exit WinReUnInstall returns 1 with last error: 0x0

    2023-04-24 22:10:30, Info [ReAgentc.exe] ------------------------------------------------------

    2023-04-24 22:10:30, Info [ReAgentc.exe] -----Exiting command line: ReagentC /Disable, Error: 0-----

    2023-04-24 22:10:30, Info [ReAgentc.exe] ------------------------------------------------------

    In Lumince's case, aside from the fact it was already disabled in the BCD, /Disable couldn't open the BCD due to confusion with having two of them. That confusion somehow cleared up & it can be done now, but I still suspect the BCD that was settled on is the one that is at **C:**EFI\Microsoft\Boot. Better for it to be in the EFI partition instead. Also, **C:**Recovery\WindowsRE\WinRE.wim is being used, & it would be better to move that to the Recovery partition. /Enable is supposed to do that.

    (2) Here is a good /Enable...

    2023-04-24 22:33:15, Info [ReAgentc.exe] ------------------------------------------------------

    2023-04-24 22:33:15, Info [ReAgentc.exe] -----Executing command line: ReagentC /Enable-----

    2023-04-24 22:33:15, Info [ReAgentc.exe] ------------------------------------------------------

    2023-04-24 22:33:15, Info [ReAgentc.exe] Enter WinRECheckGuid

    2023-04-24 22:33:15, Info [ReAgentc.exe] Parameter: TargetOsGuid: : NULL

    2023-04-24 22:33:15, Info [ReAgentc.exe] Exit WinRECheckGuid return error code: 0x0

    2023-04-24 22:33:15, Info [ReAgentc.exe] Enter WinReInstall

    2023-04-24 22:33:15, Info [ReAgentc.exe] Parameter: ReInstallBecauseOfBitlocker: 0

    2023-04-24 22:33:15, Info [ReAgentc.exe] --Install on target OS step 1: collect info like partition list, loading reagent.xml, source winre.wim and partition

    2023-04-24 22:33:15, Info [ReAgentc.exe] Enumerate and log all fixed partitions:

    2023-04-24 22:33:15, Info [ReAgentc.exe] --Partition info--

    2023-04-24 22:33:15, Info [ReAgentc.exe] VolumeName: \?\Volume{3853bb65-3d72-4bb1-9964-7f26ee7ad47e}, PartitionName: \?\GLOBALROOT\device\harddisk0\partition1

    2023-04-24 22:33:15, Info [ReAgentc.exe] Partition number: 1, offset: 32768, free space: 72656896, total space: 100662272

    2023-04-24 22:33:15, Info [ReAgentc.exe] DiskNumber:0, DiskSignature:0, NTFS:0, Mbr:0, Active:0, Boot:0, BitlockerEnabled:0

    2023-04-24 22:33:15, Info [ReAgentc.exe] GPT partition GUID:: {C12A7328-F81F-11D2-BA4B-00A0C93EC93B}

    2023-04-24 22:33:15, Info [ReAgentc.exe] DiskId: {FF69AAFC-9985-4B5C-9E34-9AA629D8F4D7}

    2023-04-24 22:33:15, Info [ReAgentc.exe] --Partition info--

    2023-04-24 22:33:15, Info [ReAgentc.exe] VolumeName: \?\Volume{457ef4fb-b253-437a-8212-e3b0b7dc0926}, PartitionName: \?\GLOBALROOT\device*harddisk0\partition4*

    2023-04-24 22:33:15, Info [ReAgentc.exe] Partition number: 4, offset: 999313944576, free space: 869806080, total space: 888840192

    2023-04-24 22:33:15, Info [ReAgentc.exe] DiskNumber:0, DiskSignature:0, NTFS:1, Mbr:0, Active:0, Boot:0, BitlockerEnabled:0

    2023-04-24 22:33:15, Info [ReAgentc.exe] GPT partition GUID:: {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC} <<<That is the GUID of a Recovery partition

    2023-04-24 22:33:15, Info [ReAgentc.exe] DiskId: {FF69AAFC-9985-4B5C-9E34-9AA629D8F4D7}

    2023-04-24 22:33:15, Info [ReAgentc.exe] --Partition info--

    2023-04-24 22:33:15, Info [ReAgentc.exe] VolumeName: \?\Volume{e25e0508-48be-470f-a312-9a0ea0ce543e}, PartitionName: \?\GLOBALROOT\device\harddisk0\partition3

    2023-04-24 22:33:15, Info [ReAgentc.exe] Partition number: 3, offset: 121667072, free space: 944179523584, total space: 999190286336

    2023-04-24 22:33:15, Info [ReAgentc.exe] DiskNumber:0, DiskSignature:0, NTFS:1, Mbr:0, Active:0, Boot:1, BitlockerEnabled:0

    2023-04-24 22:33:15, Info [ReAgentc.exe] GPT partition GUID:: {EBD0A0A2-B9E5-4433-87C0-68B6B72699C7}

    2023-04-24 22:33:15, Info [ReAgentc.exe] DiskId: {FF69AAFC-9985-4B5C-9E34-9AA629D8F4D7}

    2023-04-24 22:33:15, Info [ReAgentc.exe] Get downlevel ReAgent config

    2023-04-24 22:33:15, Info [ReAgentc.exe] Downlevel config file path: \Recovery\ReAgentOld.xml

    2023-04-24 22:33:15, Info [ReAgentc.exe] Checking for downlevel WinRE installation.

    2023-04-24 22:33:16, Info [ReAgentc.exe] First round search

    2023-04-24 22:33:16, Info [ReAgentc.exe] Get ReAgent config

    2023-04-24 22:33:16, Info [ReAgentc.exe] GetReAgentConfig Config file path: C:\WINDOWS\system32\Recovery\ReAgent.xml

    2023-04-24 22:33:16, Info [ReAgentc.exe] CheckRegKey test hook (SystemSetupInProgress) present and disabled

    2023-04-24 22:33:16, Info [ReAgentc.exe] Update enhanced config info is enabled.

    2023-04-24 22:33:16, Warning [ReAgentc.exe] Failed to get recovery entries: 0xc0000225

    2023-04-24 22:33:16, Info [ReAgentc.exe] winreGetWinReGuid returning 0X490

    2023-04-24 22:33:16, Info [ReAgentc.exe] ReAgentConfig::ReadBcdAndUpdateEnhancedConfigInfo WinRE disabled, WinRE Guid could not be determined (0x490)

    2023-04-24 22:33:16, Info [ReAgentc.exe] FindWinReSourceImageAndPartition No source winre.wim was specified. Checking for a staged winre.wim.

    2023-04-24 22:33:16, Info [ReAgentc.exe] FindWinReSourceImageAndPartition using winre.wim from C:\WINDOWS\system32\Recovery <<<It finds WinRE.wim

    2023-04-24 22:33:16, Info [ReAgentc.exe] --Install on target OS step 2: detect and fix if there is any issue for winre settings

    2023-04-24 22:33:16, Info [ReAgentc.exe] DetectAndFixWinReIssues nothing to do because winre is not enabled.

    2023-04-24 22:33:16, Info [ReAgentc.exe] --Install on target OS step 3: check if we can keep winre.wim in the same partition if it is staged.

    2023-04-24 22:33:16, Info [ReAgentc.exe] --Install on target OS step 4: check if we can put winre.wim in other partitions or create one if needed.

    2023-04-24 22:33:16, Info [ReAgentc.exe] CanPutWinREOnOtherPartitions WinRE is not staged. Searching for a suitable partition for WinRE. <<<It wants to put it somewhere

    2023-04-24 22:33:16, Info [ReAgentc.exe] Entering FindTargetPartition

    2023-04-24 22:33:16, Info [ReAgentc.exe] RegLoadKey $OFFLINE$SYSTEM failed. Error: 0x522.

    2023-04-24 22:33:16, Info [ReAgentc.exe] Not allowed to repartition the disk

    2023-04-24 22:33:16, Info [ReAgentc.exe] Start looping through each partition and initialize os partition, recovery partition and system partition for MBR

    2023-04-24 22:33:16, Info [ReAgentc.exe] Checking partition at offset 32768, partition number: 1

    2023-04-24 22:33:16, Info [ReAgentc.exe] skip GPT Partition which type is not PARTITION_MSFT_RECOVERY_GUID

    2023-04-24 22:33:16, Info [ReAgentc.exe] Checking partition at offset 999313944576, partition number: 4 <<<That's my Recovery partition

    2023-04-24 22:33:16, Info [ReAgentc.exe] MeetPartitionRequirements Partition details: {Offset: 999313944576, Free space: 869806080, Total space: 888840192}

    2023-04-24 22:33:16, Info [ReAgentc.exe] MeetPartitionRequirements WinRE WIM size: 530417571

    2023-04-24 22:33:16, Info [ReAgentc.exe] MeetPartitionRequirements Required free space: 584943523

    2023-04-24 22:33:16, Info [ReAgentc.exe] partition meets requirements

    2023-04-24 22:33:16, Info [ReAgentc.exe] NOTE: select partition because it meets WinRE requirements <<<It meets the requirements

    2023-04-24 22:33:16, Info [ReAgentc.exe] Checking partition at offset 121667072, partition number: 3

    2023-04-24 22:33:16, Info [ReAgentc.exe] find OS partition

    2023-04-24 22:33:16, Info [ReAgentc.exe] Complete looping through each partition

    2023-04-24 22:33:16, Info [ReAgentc.exe] ----Search target partition option #1: try existing WinRE partition

    2023-04-24 22:33:16, Info [ReAgentc.exe] ----Search target partition option #2: try first recovery partition

    2023-04-24 22:33:16, Info [ReAgentc.exe] Found target partition: use the first recovery partition, offset: 999313944576

    2023-04-24 22:33:16, Info [ReAgentc.exe] Exit FindTargetPartition returns with status code: 0x0

    2023-04-24 22:33:16, Info [ReAgentc.exe] --Install on target OS step 5: set WinRE settings and restore system to a good state when hitting any errors

    2023-04-24 22:33:16, Info [ReAgentc.exe] Enter SetWinRESettings

    2023-04-24 22:33:16, Info [ReAgentc.exe] RegLoadKey $OFFLINE$SYSTEM failed. Error: 0x522.

    2023-04-24 22:33:16, Info [ReAgentc.exe] Copying WinRE from C:\WINDOWS\system32\Recovery to staging location on \?\GLOBALROOT\device\harddisk0\partition4 <<<It moves WinRE.wim to my Recovery partition

    2023-04-24 22:33:16, Info [ReAgentc.exe] RegLoadKey $OFFLINE$SYSTEM failed. Error: 0x522.

    2023-04-24 22:33:25, Info [ReAgentc.exe] Copied WinRE to staging location

    2023-04-24 22:33:25, Info [ReAgentc.exe] Creating BCD entry

    2023-04-24 22:33:25, Info [ReAgentc.exe] WinRE created BCD entry: : {8D71B059-E311-11ED-B29B-74E6E2074932} <<<The BCD entries are created

    2023-04-24 22:33:25, Info [ReAgentc.exe] Moving Winre and boot.sdi from staging location to target

    2023-04-24 22:33:25, Info [ReAgentc.exe] Moved Winre and boot.sdi from staging location to target

    2023-04-24 22:33:25, Info [ReAgentc.exe] Updating reagent.xml

    2023-04-24 22:33:25, Info [ReAgentc.exe] Set WinRE location path to: \Recovery\WindowsRE

    2023-04-24 22:33:25, Info [ReAgentc.exe] Set recovery guid

    2023-04-24 22:33:25, Info [ReAgentc.exe] Set scheduled operation: WinReNoOperation

    2023-04-24 22:33:25, Info [ReAgentc.exe] Set OS build version: 19041.1.amd64fre.vb_release.191206-1406

    2023-04-24 22:33:25, Info [ReAgentc.exe] Set Wimboot state: 0

    2023-04-24 22:33:25, Info [ReAgentc.exe] Set install state to: enabled

    2023-04-24 22:33:26, Info [ReAgentc.exe] Setting the recovery sequence for the target OS.

    2023-04-24 22:33:26, Info [ReAgentc.exe] Unable to get default BCD object (0xc0000225), checking display order instead

    2023-04-24 22:33:26, Info [ReAgentc.exe] Bootmgr has no default object set (0xc0000225), will use first display order entry instead

    2023-04-24 22:33:26, Info [ReAgentc.exe] Couldn't get top of display order: 0xc0000225

    2023-04-24 22:33:26, Info [ReAgentc.exe] We will report success and exit because recovery BCD is not used at all.

    2023-04-24 22:33:27, Info [ReAgentc.exe] Creating backup of reagent.xml

    2023-04-24 22:33:27, Info [ReAgentc.exe] Created backup of reagent.xml

    2023-04-24 22:33:27, Info [ReAgentc.exe] Configuring the WinRE validation task.

    2023-04-24 22:33:27, Info [ReAgentc.exe] Failed to clear WIM file trusted state: 0x2

    2023-04-24 22:33:27, Info [ReAgentc.exe] Failed to clear WIM file hash: 0x2

    2023-04-24 22:33:27, Info [ReAgentc.exe] Update enhanced config info is enabled.

    2023-04-24 22:33:28, Info [ReAgentc.exe] WinRE is installed

    2023-04-24 22:33:29, Info [ReAgentc.exe] Loading boot index 1

    2023-04-24 22:33:31, Info [ReAgentc.exe] winreValidateWimFile took 2234 ms.

    2023-04-24 22:33:40, Info [ReAgentc.exe] WinReValidateRecoveryWimInternal took 13390 ms.

    2023-04-24 22:33:40, Info [ReAgentc.exe] Completed the WinRE validation task.

    2023-04-24 22:33:40, Info [ReAgentc.exe] Creating backup of customization file

    2023-04-24 22:33:40, Warning [ReAgentc.exe] Recovery file not found at C:\WINDOWS\system32\Recovery\ReCustomization.xml

    2023-04-24 22:33:40, Warning [ReAgentc.exe] winreBackupRecoveryFile (C:\WINDOWS\system32\Recovery\ReCustomization.xml, ReCustomization.xml) failed, Err: 2

    2023-04-24 22:33:40, Info [ReAgentc.exe] Created backup of customization file

    2023-04-24 22:33:41, Info [ReAgentc.exe] Storing disk info in NVRAM

    2023-04-24 22:33:45, Info [ReAgentc.exe] NVRAM update not necessary

    2023-04-24 22:33:45, Info [ReAgentc.exe] Stored disk info in NVRAM

    2023-04-24 22:33:45, Info [ReAgentc.exe] SetWinRESettings return with error code 0x0

    2023-04-24 22:33:45, Info [ReAgentc.exe] WinReInstallOnTargetOSInternal WinRE installation completed successfully.

    2023-04-24 22:33:45, Info [ReAgentc.exe] Exit WinReInstall return value: 1, last error: 0x0

    2023-04-24 22:33:45, Info [ReAgentc.exe] Enter WinReSetConfig

    2023-04-24 22:33:45, Info [ReAgentc.exe] Parameters: configWinDir: NULL

    2023-04-24 22:33:45, Info [ReAgentc.exe] Update enhanced config info is enabled.

    2023-04-24 22:33:45, Info [ReAgentc.exe] WinRE is installed

    2023-04-24 22:33:46, Info [ReAgentc.exe] Exit WinReSetConfig return value: 1, last error: 0x0

    2023-04-24 22:33:46, Info [ReAgentc.exe] Clear non critical error when enabling auto repair

    2023-04-24 22:33:46, Info [ReAgentc.exe] ------------------------------------------------------

    2023-04-24 22:33:46, Info [ReAgentc.exe] -----Exiting command line: ReagentC /Enable, Error: 0-----

    2023-04-24 22:33:46, Info [ReAgentc.exe] ------------------------------------------------------

    So, that's what a good one looks like. Lumince has a good one too now, but it chose to put his WinRE.wim into the **C:**Recovery\WindowsRE folder. If we could see his /Enable, we might know why. In his bad one above, the Recovery enumerated well...

    "

    2023-04-18 17:16:33, Info [ReAgentc.exe] VolumeName: \?\Volume{98742bc3-3a5f-4ad5-bba7-88c203eef8dd}, PartitionName: \?\GLOBALROOT\device*harddisk6\partition4*

    ...

    2023-04-18 17:16:33, Info [ReAgentc.exe] GPT partition GUID:: {DE94BBA4-06D1-4D40-A16A-BFD50179D6AC} <<<That's a Recovery partition

    "

    And it wanted to move WinRE.wim to there, but found it was already there. Then tried to update the BCD but could not open it. Apparent it was BCD confusion at fault. I want to see his latest /Enable which did work -- but why didn't WinRE.wim go into the Recovery partition?

    (3) "I believe it's not just the /disable and /enable commands that did the trick. Something else suggested in between may have played its role, I think.

    Some commands executed during 19-23rd made the Recovery partition fit the requirements?"

    I'm not absolutely sure. I didn't do anything between my /Disable & /Enable above. But who knows whether some system setting is already set to make mine work. I'd like to see a /SetREImage to see whether a bit is set somewhere I didn't notice, but I'm loath to run one. Maybe that stuck & is no longer necessary for me. But the last one I saw appeared to do nothing.

    I think /Disable does a complete job. It moves WinRE.wim to the staging area & removes all recovery BCD entries. Then, /Enable checks for a Recovery partition first. If it finds it, WinRE.wim will go there. Otherwise, C partition is chosen. And the BCD gets a whole new set of recovery entries.

    I'd like to see Lumince's latest /Enable to hopefully see why C was chosen.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2023-04-24T18:27:08+00:00

    Another option might be to make a copy of the boot manager entry in the store and make changes as to location.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-04-24T16:24:46+00:00

    Has anyone suggested running the Bootrec /scanos command? Since it can't be done from windows, perhaps from the recovery tools?

    If it were to find another Windows installation, you could add it.

    Was this answer helpful?

    0 comments No comments
  4. Ramesh 176.3K Reputation points Volunteer Moderator
    2023-04-24T06:47:56+00:00

    Coming back to the BCD part, Let me summarize things for Lumince about what to do next.

    1. Pls upload the ReAgent.log as requested by PCR.
    2. Boot into WinRE, rename C:\EFI to C:\EFIBackup, or something else. Run BCDEDIT to find the OS partition's drive letter. Replace C:\EFI with the OS partition drive letter -- e.g., It could be E:\EFI. Keep the USB setup disk ready, just in case. If the system doesn't boot, you can revert the folder name to "EFI".
    3. Disconnect all HDDs except the OS drive either physically or via UEFI settings. Although this may not be required after PCR narrowed down the potential root cause. But this is the 3rd option you can try.

    Was this answer helpful?

    0 comments No comments