Fixing Foobarred Recovery Partition


RH247a

New member
Member
Local time
11:13 PM
Posts
23
OS
Windows 10 & Windows 11
Was trying to figure out the logistics of WinRe due to a windows update failure.

I first in diskpart assigned drive letter T to Recovery Partition 5

So I then exited diskpart back to cmd shell

I was experimenting with watching the winre.wim move back to
C:\Windows\System32\Recovery\ when I disabled reagentc

Long story short, along the way something foobarred,
T:\Recovery\WindowsRE>reagentc /enable
REAGENTC.EXE: Operation failed: b7
REAGENTC.EXE: An error has occurred.
(I might of had diskpart running on one cmd shell and another cmd shell
running dir cmds at same time, anyhow I foobarred something)

So I try reagentc /info and it says none found.

I looked to the Recovery Partition on drive letter T and found windows had moved all the files that used to be in \Recovery\WindowsRE
to \Recovery\Temporary
Code:
T:\Recovery\Temporary>dir /a
 Volume in drive T has no label.
 Volume Serial Number is 44F1-0F2C
Directory of T:\Recovery\Temporary
05/08/2024  05:47 PM    <DIR>          .
05/08/2024  05:47 PM    <DIR>          ..
05/07/2022  01:19 AM         3,170,304 boot.sdi
01/13/2024  05:38 PM       703,297,296 Winre.wim
               2 File(s)    706,467,600 bytes
               2 Dir(s)      82,210,816 bytes free

T:\Recovery\WindowsRE>dir /a
 Volume in drive T has no label.
 Volume Serial Number is 44F1-0F2C
Directory of T:\Recovery\WindowsRE
05/08/2024  05:35 PM    <DIR>          .
05/08/2024  05:47 PM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)      82,210,816 bytes free
--Anyhow it created a Temporary folder to hold the 3 files boot.sdi, ReAgent.xml, winre.wim.

And winre.wim was also not in C:\Windows\System32\Recovery

So I did this, dir /a /s c:\winre.wim
and it found one in,
C:\$WinREAgent\Backup\
So in a file manager I copied it to the
C:\Windows\System32\Recovery\

Then did this,
Code:
T:\Recovery\WindowsRE>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.

So tried to set the path back,
T:\Recovery\WindowsRE>reagentc /setreimage /path T:\Recovery\WindowsRE
REAGENTC.EXE: No valid image found in the specified path (obviously since it's been moved into the temporary folder).

T:\Recovery\WindowsRE>reagentc /enable
REAGENTC.EXE: Operation Successful.
Code:
T:\Recovery\WindowsRE>reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration
Information:
Windows RE status:         Enabled
Windows RE location:       \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\WindowsRE
Boot Configuration Data (BCD) identifier: 828f9305-b225-11ee-a3db-adda79cfde9f
Recovery image location:
Recovery image index:      0
Custom image location:
Custom image index:        0

REAGENTC.EXE: Operation Successful.

So it's now running on C drive partition.
So looked at foobarred Recovery partition 5,
DISKPART> list part
  Partition ###  Type              Size     Offset
  -------------  ----------------  -------  -------
  Partition 1    System             100 MB  1024 KB
  Partition 2    Reserved            16 MB   101 MB
  Partition 3    Primary            750 GB   117 MB
  Partition 4    Primary            202 GB   750 GB
* Partition 5    Recovery           768 MB   953 GB

DISKPART> det part
Partition 5
Type    : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden  : Yes
Required: Yes
Attrib  : 0X8000000000000001
Offset in Bytes: 1023402835968

Volume #  Ltr  Label    Fs    Type       Size   Status   Info
-------   ---  ------ ----- ----------  ------  ------- --------
*Volume 3       T      NTFS  Partition  768 MB  Healthy  Hidden
--Everything still looks good except all the files are in a sub folder named Temporary and /setreimage /path T:\Recovery\WindowsRE
gets-> REAGENTC.EXE: No valid image found in the specified path.

It's getting late and I'm beat, but I'm guessing I need to edit a new
ReAgent.xml in the C:\Windows\System32\Recovery

I can get into the T:\Recovery\Temporary in a cmd shell only,
Code:
T:\Recovery\Temporary>dir /a
 Volume in drive T has no label.
 Volume Serial Number is 44F1-0F2C
 Directory of T:\Recovery\Temporary
05/08/2024  05:47 PM    <DIR>          .
05/08/2024  05:47 PM    <DIR>          ..
05/07/2022  01:19 AM         3,170,304 boot.sdi
01/13/2024  05:38 PM       703,297,296 Winre.wim
               2 File(s)    706,467,600 bytes
               2 Dir(s)      82,210,816 bytes free
--But I can't robocopy or xcopy anything in or out of there.
Robocopy /S /E T:\Recovery C:\My Scans
Robocopy said it copied them but they're not there. I tried attrib etc.
If anyone read this far and knows a direction to head me in would be much appreciated.
I was able to open the ReAgentOld.xml sitting in T:\Recovery
and it looks obliterated with zero guids. I could post up it's contents tomorrow. Short of that I guess I could delete the foobarred recovery partition and create a new one in it's place and try to get it going from scratch.
The C:\$WinREAgent\Backup\ folder has the 3 files boot.sdi, ReAgent.xml, winre.wim. But the ReAgent.xml contents doesn't look promising.
The irony is this Win11 device I just foobarred the recovery partition on was only an experiment so I could learn to fix my wife's device that has a recovery partition Win10 update issue. Experimenting on my Win11 device so I could apply my notes to her Win10 device. Yea whatever.
Hope I didn't typo anything too bad. Logging out for tonight.
 

My Computer

System One

  • OS
    Windows 10 & Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
I thank you much for that excellent video, however I already have a copy of winre.wim. I did get my issue fixed. I found some great info here,

Sparing all the stuff I tried, long story short, it appears whenever you change the path as in,
reagentc /setreimage /path c:\Recovery\Temporary /target C:\windows
Directory set to: \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\Temporary

REAGENTC.EXE: Operation Successful.

** And then IF it won't enable as in,
reagentc /enable
REAGENTC.EXE: Operation failed: 2
REAGENTC.EXE: An error has occurred.

** Then immediately you need to do this in C:\Windows\System32\Recovery
** ren ReAgent.xml ReAgent_backup.xml and copy Winre.wim to there.
** (my winre.wim was already there cause I couldn't enable reagentc)
** In most cases, this method will repair WinRE.
** You can do the above in explorer file manager or cmd shell

** THEN enable reAgentc

C:\Windows\System32\Recovery>reagentc /enable
REAGENTC.EXE: Operation Successful.

** A new ReAgent.xml should be created and it will change these lines
** In ReAgent.xml
<WinreBCD id="{828f930b-b225-11ee-a3db-adda79cfde9f}"/>
<WinreLocation path="\Recovery\WindowsRE" id="0" offset="1023402835968" guid="{57a258cb-5467-4dfe-b989-7c8898d0238f}"/>
<ImageLocation path="" id="0" offset="0" guid="{00000000-0000-0000-0000-000000000000}"

** THEN check the info

c:\Recovery\Temporary>reagentc /info
Windows Recovery Environment (Windows RE) and system reset configuration Information:
Windows RE status: Enabled
Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition5\Recovery\WindowsRE
Boot Configuration Data (BCD) identifier: 828f930b-b225-11ee-a3db-adda79cfde9f
Recovery image location:
Recovery image index: 0
Custom image location:
Custom image index: 0

REAGENTC.EXE: Operation Successful.

** Notice the location, it's my original Recovery Partition #5
** Windows RE location: \\?\GLOBALROOT\device\harddisk0\partition5

** So going there to look,
c:\Recovery\Temporary>diskpart
Microsoft DiskPart version 10.0.22621.1
Copyright (C) Microsoft Corporation.
On computer: DTM-2023A

DISKPART> sel disk 0
Disk 0 is now the selected disk.
DISKPART> list part
Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 System 100 MB 1024 KB
Partition 2 Reserved 16 MB 101 MB
Partition 3 Primary 750 GB 117 MB
Partition 4 Primary 202 GB 750 GB
Partition 5 Recovery 768 MB 953 GB

DISKPART> sel part 5
Partition 5 is now the selected partition.
DISKPART> assign letter=T
DiskPart successfully assigned the drive letter or mount point.
DISKPART> exit
Leaving DiskPart...
c:\Recovery\Temporary>T:

T:\>cd recovery

T:\Recovery>cd windowsre

T:\Recovery\WindowsRE>dir /a
Volume in drive T has no label.
Volume Serial Number is 44F1-0F2C
Directory of T:\Recovery\WindowsRE
05/09/2024 10:28 PM <DIR> .
05/09/2024 10:28 PM <DIR> ..
05/07/2022 01:19 AM 3,170,304 boot.sdi
05/09/2024 10:28 PM 1,110 ReAgent.xml
01/13/2024 05:38 PM 703,297,296 Winre.wim
3 File(s) 706,468,710 bytes
2 Dir(s) 82,210,816 bytes free

** There they all are! Thanks to God and the aforesaid site url.

T:\Recovery\WindowsRE>diskpart

Microsoft DiskPart version 10.0.22621.1
Copyright (C) Microsoft Corporation.
On computer: DTM-2023A

DISKPART> sel disk 0
Disk 0 is now the selected disk.
DISKPART> sel part 5
Partition 5 is now the selected partition.
DISKPART> remove letter=T
DiskPart successfully removed the drive letter or mount point.
DISKPART> exit
Leaving DiskPart...
T:\Recovery\WindowsRE>
exit (cmd shell)
 

My Computer

System One

  • OS
    Windows 10 & Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
BTW I have one more novice question:
If one does have to resize the separate Recovery Partition (sitting right past the C: windows drive)
After doing any necessary shrinking of the C: (windows drive), I surmise since the Recovery Partition is system protected you can't just resize or move it over next to the C: drive, correct (?) I.e. you have to delete the Recovery Partition and then create it again, correct (?) yes, no, or comment ?

And of course it would appear if you don't already have backups, then copying the ReAgent.xml, winre.wim and boot.sdi to a backup folder would be prudent before you delete the old Recovery Partition.
 

My Computer

System One

  • OS
    Windows 10 & Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1
You can always use a free version of MiniTool Partition Wizard to resize or extend partitions.

Ok so it's just diskpart that has to delete it first and it's not windows having a problem with it being moved or resized after it's in service?

l.e. when I read most all the info on dealing with the separate Recovery Partition most seem to delete the recovery partition first then recreate it larger.

BTW how do you change from dark mode display to normal on this forum?
 

My Computer

System One

  • OS
    Windows 10 & Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    HP 17" Laptop, Acer Aspire 5
Diskpart cannot do everything, yes it can delete but may have problem extending the partitions.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1
Back
Top Bottom