Recreate the recovery partition. REAGENTC.EXE: Operation failed: 2

Page 1 of 2 12 LastLast

  1. Posts : 8
    Windows 10
       #1

    Recreate the recovery partition. REAGENTC.EXE: Operation failed: 2


    Hi, OS specs are below.

    Edition Windows 10 Home
    Version 22H2
    Installed on ‎05/‎03/‎2023
    OS build 19045.2728
    Experience Windows Feature Experience Pack 120.2212.4190.0

    The issue I am having is with recreating a deleted recovery partition, this is what I have done so far.

    Got a copy of winre.wim and ReAgent.xml from install.wim and placed them in C:\Windows\System32\Recovery

    Recreated the recovery partition
    diskpart
    DISKPART> select disk 0
    DISKPART> select partition 3
    DISKPART> shrink desired=700
    DISKPART> create partition primary
    DISKPART> format quick fs=ntfs label="winRE"
    DISKPART> set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    DISKPART> exit


    Details for this created partition here

    Partition 4
    Type : c12a7328-f81f-11d2-ba4b-00a0c93ec93b
    Hidden : Yes
    Required: Yes
    Attrib : 0X8000000000000001
    Offset in Bytes: 999470137344

    Volume ### Ltr Label Fs Type Size Status Info
    ---------- --- ----------- ----- ---------- ------- --------- --------
    * Volume 2 NTFS Partition 700 MB Healthy Hidden

    Sets the location of a Windows RE boot image.
    reagentc /setreimage /path C:\Windows\System32\Recovery
    Directory set to: \\?\GLOBALROOT\device\harddisk0\partition3\Windows\System32\Recovery

    Enabeled
    reagentc /enable
    REAGENTC.EXE: Operation failed: 2

    REAGENTC.EXE: An error has occurred.



    As you can see it is failing with error "2".
      My Computer


  2. Posts : 4,144
    Windows 3.1 to Windows 11
       #2

    reagentc /disable
    reagentc /info (should show disabled)
    reagentc /enable
    Reboot PC
    reagentc /info (should show enabled and location)
      My Computer


  3. Posts : 8
    Windows 10
    Thread Starter
       #3

    C:\>reagentc /disable
    REAGENTC.EXE: Windows RE is already disabled.


    C:\>reagentc /info
    Windows Recovery Environment (Windows RE) and system reset configuration
    Information:

    Windows RE status: Disabled
    Windows RE location:
    Boot Configuration Data (BCD) identifier: 00000000-0000-0000-0000-000000000000
    Recovery image location:
    Recovery image index: 0
    Custom image location:
    Custom image index: 0

    REAGENTC.EXE: Operation Successful.


    C:\>reagentc /enable
    REAGENTC.EXE: The Windows RE image was not found.


    -----


    Before I restart, what should I have been expecting when the reagentc /enable command was executed?
      My Computer


  4. Posts : 4,144
    Windows 3.1 to Windows 11
       #4

    reagentc /disable

    copy just the winre.wim to windows/system32/recovery
    remove reagent.xml file..

    reagentc /enable
      My Computer


  5. Posts : 8
    Windows 10
    Thread Starter
       #5

    C:\>reagentc /disable
    REAGENTC.EXE: Windows RE is already disabled.

    Copied just winre.wim to C:\Windows\System32\Recovery

    C:\>reagentc /enable
    REAGENTC.EXE: Operation failed: 2

    REAGENTC.EXE: An error has occurred.


    Still the same error 2
      My Computer


  6. Posts : 15,497
    Windows10
       #6

    Your winre.wim folder is in the wrong starting folder. It should be in c:\windows\system32\recovery along with reagentc.xml

    Also recovery partition should have existing folders \Recovery\WindowsRE.
      My Computer


  7. Posts : 8
    Windows 10
    Thread Starter
       #7

    Hi, I have mounted the recovery partition and unhid the content, it contained the following structure

    R:\Recovery\Temporary\boot.sdi

    There was no WindowsRE folder so I have created the folder R:\Recovery\WindowsRE\ which is empty.

    I now have the folder structure you mentioned "Also recovery partition should have existing folders \Recovery\WindowsRE."

    As well as ReAgent.xml and Winre.wim in C:\Windows\System32\Recovery



    C:\Windows\system32>reagentc /disable
    REAGENTC.EXE: Windows RE is already disabled.


    C:\Windows\system32>reagentc /enable
    REAGENTC.EXE: Operation failed: 2

    Same issue as before.
      My Computer


  8. Posts : 15,497
    Windows10
       #8

    Licence23 said:
    Hi, I have mounted the recovery partition and unhid the content, it contained the following structure

    R:\Recovery\Temporary\boot.sdi

    There was no WindowsRE folder so I have created the folder R:\Recovery\WindowsRE\ which is empty.

    I now have the folder structure you mentioned "Also recovery partition should have existing folders \Recovery\WindowsRE."

    As well as ReAgent.xml and Winre.wim in C:\Windows\System32\Recovery



    C:\Windows\system32>reagentc /disable
    REAGENTC.EXE: Windows RE is already disabled.


    C:\Windows\system32>reagentc /enable
    REAGENTC.EXE: Operation failed: 2

    Same issue as before.
    What do the logs say?

    Code:
    REAGENTC.EXE /enable /logpath C:\Temp\Reagent.log
      My Computer


  9. Posts : 8
    Windows 10
    Thread Starter
       #9

    Code:
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ------------------------------------------------------
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] -----Executing command line: REAGENTC.EXE  /enable /logpath C:\Temp\Reagent.log-----
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ------------------------------------------------------
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Enter WinRECheckGuid
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Parameter: TargetOsGuid: : NULL 
    2023-04-20 18:11:52, Warning                      [ReAgentc.exe] winreGetOSGuidOrDefault GetCurrentOsGuid returned 0x2
    2023-04-20 18:11:52, Warning                      [ReAgentc.exe]  (WinRE)WinRECheckGuid() winreGetOSGuidOrDefault failed
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Exit WinRECheckGuid return error code: 0x0
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Enter WinReInstall
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Parameter: ReInstallBecauseOfBitlocker: 0
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] --Install on target OS step 1: collect info like partition list, loading reagent.xml, source winre.wim and partition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Enumerate and log all fixed partitions:
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] --Partition info--
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] VolumeName: \\?\Volume{f2628f99-4bc0-4b57-b9ba-d50a75f8ae96}, PartitionName: \\?\GLOBALROOT\device\harddisk0\partition3
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Partition number: 3, offset: 1087373312, free space: 364920729600, total space: 998382759936
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] DiskNumber:0, DiskSignature:0, NTFS:1, Mbr:0, Active:0, Boot:1, BitlockerEnabled:0
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] GPT partition GUID:: {EBD0A0A2-B9E5-4433-87C0-68B6B72699C7} 
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] DiskId: {483E6208-E30A-46D9-B199-859313EB89E2} 
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] --Partition info--
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] VolumeName: \\?\Volume{a05acb42-b7fc-47cc-a292-57513136249d}, PartitionName: \\?\GLOBALROOT\device\harddisk0\partition2
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Partition number: 2, offset: 17825792, free space: 1022427136, total space: 1068494848
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] DiskNumber:0, DiskSignature:0, NTFS:1, Mbr:0, Active:0, Boot:0, BitlockerEnabled:0
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] GPT partition GUID:: {EBD0A0A2-B9E5-4433-87C0-68B6B72699C7} 
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] DiskId: {483E6208-E30A-46D9-B199-859313EB89E2} 
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Get downlevel ReAgent config
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  Downlevel config file path: \Recovery\ReAgentOld.xml
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  Checking for downlevel WinRE installation.
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] First round search
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Get ReAgent config
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] GetReAgentConfig Config file path: C:\Windows\system32\Recovery\ReAgent.xml
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] CheckRegKey test hook (SystemSetupInProgress) present and disabled
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Update enhanced config info is enabled.
    2023-04-20 18:11:52, Warning                      [ReAgentc.exe] winreGetWinReGuid open store failed: 0xc000000f
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] winreGetWinReGuid returning 0X2
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ReAgentConfig::ReadBcdAndUpdateEnhancedConfigInfo WinRE disabled, WinRE Guid could not be determined  (0x2) 
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] FindWinReSourceImageAndPartition No source winre.wim was specified.  Checking for a staged winre.wim.
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] FindWinReSourceImageAndPartition using winre.wim from C:\Windows\system32\Recovery
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] --Install on target OS step 2: detect and fix if there is any issue for winre settings
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] DetectAndFixWinReIssues nothing to do because winre is not enabled.
    2023-04-20 18:11:52, 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-20 18:11:52, 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-20 18:11:52, Info                         [ReAgentc.exe] CanPutWinREOnOtherPartitions WinRE is not staged. Searching for a suitable partition for WinRE.
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Entering FindTargetPartition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] RegLoadKey $OFFLINE$SYSTEM failed. Error: 0x522.
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  Not allowed to repartition the disk
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Start looping through each partition and initialize os partition, recovery partition and system partition for MBR
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  Checking partition at offset 1087373312, partition number: 3
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  find OS partition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  Checking partition at offset 17825792, partition number: 2
    2023-04-20 18:11:52, Info                         [ReAgentc.exe]  skip GPT Partition which type is not PARTITION_MSFT_RECOVERY_GUID
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Complete looping through each partition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ----Search target partition option #1: try existing WinRE partition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ----Search target partition option #2: try first recovery partition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ----Search target partition option #3: try system partition for MBR
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ----Search target partition option #4: try new recovery partition if allowed
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ----Search target partition option #5: try target OS partition
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] MeetPartitionRequirements Partition details: {Offset: 1087373312, Free space: 364920729600, Total space: 998382759936}
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] MeetPartitionRequirements WinRE WIM size: 457159580
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] MeetPartitionRequirements Required free space: 356515840
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Found target partition: use target OS partition, offset: 1087373312
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Exit FindTargetPartition returns with status code: 0x0
    2023-04-20 18:11:52, 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-20 18:11:52, Info                         [ReAgentc.exe] Enter SetWinRESettings
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] RegLoadKey $OFFLINE$SYSTEM failed. Error: 0x522.
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Copying WinRE from C:\Windows\system32\Recovery to staging location on \\?\GLOBALROOT\device\harddisk0\partition3
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] RegLoadKey $OFFLINE$SYSTEM failed. Error: 0x522.
    2023-04-20 18:11:52, Warning                      [ReAgentc.exe] winreCopyWIM Deleted existing sdi file in \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\Temporary\boot.sdi
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Copied WinRE to staging location
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Creating BCD entry
    2023-04-20 18:11:52, Error                        [ReAgentc.exe] open store failed: 0xc000000f
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Failed to create BCD recovery entry 2
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] BCD could not be set, Copying Winre.wim from  to staging location
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Moving \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\Temporary\Winre.wim to C:\Windows\system32\Recovery\\winre.wim
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] SetWinRESettings return with error code 0x2
    2023-04-20 18:11:52, Error                        [ReAgentc.exe] failed to set WinRE settings, error:0x2
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] Exit WinReInstall return value: 0, last error: 0x2
    2023-04-20 18:11:52, Error                        [ReAgentc.exe] failed to install winre: : 0x2
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ------------------------------------------------------
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] -----Exiting command line: REAGENTC.EXE  /enable /logpath C:\Temp\Reagent.log, Error: 2-----
    2023-04-20 18:11:52, Info                         [ReAgentc.exe] ------------------------------------------------------
      My Computer


  10. Posts : 4,595
    several
       #10

    open store failed: 0xc000000f
    what do you get when runing bcdedit from admin cmd prompt?
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 06:01.
Find Us




Windows 10 Forums