none
REAgentC.exe - Deploying WindowsRE to a separate disk partition than the system and boot partitions.

    Question

  • I am following through the doucmentation in the WinPE 3.0 User's Guide and am trying to deploy Windows Recovery Environment to a primary partition other than the boot or system partitions.  The documentation mentions that I need to associate the Windows RE image to Windows 7 using the command tool REAgentC.exe.  I am doing some searching within the program files and also through the WinRE images, but cannot find any trace of this tool. 

    Is this tool released with the WAIK3.0 Beta package?  Should I be able to find it right now?  If not, then should I be able to configure all boot options through bcdedit.exe? 
    MCITP, MCTS Vista
    Monday, March 30, 2009 4:15 PM

Answers

  • Thanks for your reply.  The links definitely helped, but I had to do some digging to find an answer.  This one's going to be long - I've been banging my had at this for two weeks now. 

    My ultimate goal here is to deploy the Windows Recovery Environment to a partition other than the system or boot partitions.  This is in preparation for deploying BitLocker in Windows 7. 

    The Windows PE WAIK 2.0 Beta documentation mentions to use the command reagentc.exe to associate the Windows Recovery Environment into the boot configuration data for the Windows 7 operating system.  This file is located within the \Windows\System32 directories of Windows 7 and Server 2008 R2.  There is a switch called /setreimage that tries to update the Windows Boot Loader for the Windows Recovery Environment. 

    Problem is that this switch does not work when booted into the Windows 7 OS, so you must run it from a WinPE environment.  Furthermore, the command does not come in the WindowsPE or WindowsRE images by default.  And you cannot pack the executable ReagentC.exe and its associated library file Reagent.dll into the WinPE image and expect to execute ReagentC.exe from the ram drive system32 folder (X:\Windows\System32).  The only way I've been able to get it to work so far is to execute the command from the \Windows\System32 path on the boot partition (Windows 7 installation partition) when running from WinPE. 

    And my difficulty with this command continues...

    When all the stars align, and you begin to execute the command ReagentC.exe /setreimage /path r:\ successfully, I found that it does not update the Windows Recovery Environment bootloader GUIDs accordingly.  So I ditched this command and had to find another route.

    The Vista SP1 BitLocker Design Guide mentions that in order to use Windows RE in conjunction with BitLocker, "the Windows RE boot image must reside on a volume that is not protected by BitLocker".  By default, Windows 7 places the boot configuration data on the system partition and the operating system files on the boot partition (in contrast to Windows Vista where the boot configuration data and the operating system files on the same partition, which is the system/boot partition).  I could deploy Windows RE to the system partition, but this configuration would not give me the ability to do a CompletePC restore:  according to the Design Guide, a "Complete PC must always restore the active [system] partition, but fails to do so when the files that Windows RE uses to start from are also on the active partition."

    So my other option now is to follow the BitLocker partitioning guidelines from the Design Guide.  This involves creating three partitions, one for the boot configuration data (system partition), one for the recovery environment (recovery partition), and one for the operating system files (boot partition). 

    By default, Windows 7 configures the Recovery Environment to run from the boot partition.  For comparison, Vista does not configure a Recovery Environment at all.  In the default case of Windows 7, the Recovery Environment is set to run from the winre.wim file in the \Recovery\{WinRE_BootLoader_GUID} directory on the boot partition (the one with the Windows files on it). 

    But things change as soon as you enable BitLocker.  This is because the Windows Recovery Environment must reside on a volume that is not protected by BitLocker.  In fact, when you enable BitLocker through the control panel in Windows 7, you will receive a message stating that the Windows Recovery Environment will be moved to either the System or Recovery partitions. 

    So far, here are the main points:

    1.  The Windows Recovery Environment cannot reside on the boot partition (the partition with the Windows files on it) when BitLocker is enabled.

    2.  The Windows Recovery Environment cannot reside on the system partition (the first partition containg the boot configuration data) when you want to do a Complete PC Restore.



    So where do you go from here?  Well...You need to manually configure the Windows Recovery Environment to deploy to a third partition.  Here's how I did it:

    1.  In the WinPE pass of your answer file, create three partitions.  The first partition you create will always be the system partition.  You need to make this partition the active partition.  This is the partition on which Windows 7 Setup places the boot configuration data files (bcd and bootmgr).  Do not assign it a drive letter.  Make the size around 1GB.  The second partition you create is the recovery partition.  Assign it the drive letter R and make the size around 1.5 GB.  The third partition you create is the boot partition.  Assign it the drive letter C and extend the partition to fill the rest of the disk.  NOTE:  when you complete the remaining steps below, the system partition and the recovery partition will not show up in Windows Explorer.  Right now the system partition does not have a drive letter, but the recovery partition does.  You will run a command later that removes the drive letter for the recovery partition.  See answer file below for Window 7 Unattend for BitLocker and WinRE partitions.

    2.  In your answer file, prevent the Windows Recovery Environment from installing itself by default.  This can be done by setting the UninstallWindowsRE item from Microsoft-Windows-WinRE-RecoveryAgent(WAIK 2.0 Beta) to true.  This component is added in the oobeSystem pass.  You do not want the Windows Recovery Environment installed by default because it is easier to manually install it.  If you installed it by default, then you would have to use bcdedit.exe to configure the Windows Recovery Environment boot loader so that it points to your new partition. 

    3.  Grab the winre.wim file from the install.wim file in the Windows 7 source media (you'll need to use the mounting functions from dism.exe or imagex.exe).  You can find the winre.wim file in the \Windows\System32\Recovery folder.  Also grab the boot.sdi file from the \Windows\Boot\DVD\PCAT folder.  Place them both in the \Windows\System32 directory of your Windows 7 image (you'll need to mount this as well :). 

    4.  Grab the script SetAutoFailover.cmd from the old WAIK 1.1 and place it in the \Windows\System32 directory of your Windows 7 image.  For some reason, Microsoft chose not to include this script in WAIK 2.0 Beta.  The SetAutoFailover.cmd script is found in the WAIK 1.1 \Program Files\Windows AIK\Recovery folder.  This script modifies the boot configuration data to incorporate the Windows Recovery Environment from the recovery partition.  This is the part that I was hoping the command mentioned at the beginning of my post, ReagentC.exe, would make life easier for me.  But I actually installed the old WAIK in a virtual machine to get this file. 

    5.  During the oobeSystem pass, introduce a SynchronousCommand from the FirstLogonCommands field in the Microsoft-Windows-Shell-Setup component.  This command will point to a batch file (which you incorporate into your Windows 7 image) that does the following:

    a.  Copies the winre.wim and boot.sdi files from the \Windows\System32 folder in your Vista image (from Step 1) to your R drive.  You can use the command attrib +R +S +H r:\boot.sdi and attrib +R +S +H r:\winre.wim to make these files super hidden. 

    b.  Runs the SetAutoFailover.cmd script, which updates the boot configuration data to point to the Windows Recover Image on your R drive.  The command I use is SetAutoFailover.cmd /target R: /wim /partition 2 /disk 0.  Keep in mind that partition indexing starts with a 1 and disk indexing starts with a 0.  So the system partition has index 1, the recovery partition has index 2, and the boot partition has index 3.  And the disk on which I am installing all the partitions is the first disk, disk 0. 

    c.  Performs cleanup of the extraneous winre.wim and boot.sdi files on your \Windows\System32 directory of the boot (Windows) partition. 

    That's all there is to it.  During first logon, Windows will begin copying the winre.wim and boot.sdi files to the R partition.  From that point, the SetAutoFailover.cmd script configures the Boot Configuration Data to provide a repair option in the F8 menu that boots from the recovery partition.  The SetAutoFailover.cmd script will also remove the recovery partition's R letter assignment from Windows Explorer.

    Hope this helps...now it's on to scripting BitLocker Deployment :-) 


    Windows 7 Unattend for BitLocker and Windows Recovery Environment Partitions (WinPE Pass)

            <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <WindowsDeploymentServices>
                    <ImageSelection>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>3</PartitionID>
                        </InstallTo>
                    </ImageSelection>
                </WindowsDeploymentServices>
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>1500</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Size>1000</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Extend>true</Extend>
                                <Order>3</Order>
                                <Type>Primary</Type>
                            </CreatePartition>
                        </CreatePartitions>
                        <ModifyPartitions>
                            <ModifyPartition wcm:action="add">
                                <Active>true</Active>
                                <Format>NTFS</Format>
                                <Label>System</Label>
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <TypeID>07</TypeID>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Active>false</Active>
                                <Format>NTFS</Format>
                                <Label>Recovery</Label>
                                <Order>2</Order>
                                <PartitionID>2</PartitionID>
                                <TypeID>07</TypeID>
                                <Letter>R</Letter>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Active>false</Active>
                                <Format>NTFS</Format>
                                <Label>OS</Label>
                                <Letter>C</Letter>
                                <Order>3</Order>
                                <PartitionID>3</PartitionID>
                                <TypeID>07</TypeID>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <DiskID>0</DiskID>
                        <WillWipeDisk>true</WillWipeDisk>
                    </Disk>
                </DiskConfiguration>
            </component>


    MCITP, MCTS Vista
    Friday, April 17, 2009 4:57 AM

All replies

  • Tuesday, March 31, 2009 5:21 PM
    Moderator
  • Thanks for your reply.  The links definitely helped, but I had to do some digging to find an answer.  This one's going to be long - I've been banging my had at this for two weeks now. 

    My ultimate goal here is to deploy the Windows Recovery Environment to a partition other than the system or boot partitions.  This is in preparation for deploying BitLocker in Windows 7. 

    The Windows PE WAIK 2.0 Beta documentation mentions to use the command reagentc.exe to associate the Windows Recovery Environment into the boot configuration data for the Windows 7 operating system.  This file is located within the \Windows\System32 directories of Windows 7 and Server 2008 R2.  There is a switch called /setreimage that tries to update the Windows Boot Loader for the Windows Recovery Environment. 

    Problem is that this switch does not work when booted into the Windows 7 OS, so you must run it from a WinPE environment.  Furthermore, the command does not come in the WindowsPE or WindowsRE images by default.  And you cannot pack the executable ReagentC.exe and its associated library file Reagent.dll into the WinPE image and expect to execute ReagentC.exe from the ram drive system32 folder (X:\Windows\System32).  The only way I've been able to get it to work so far is to execute the command from the \Windows\System32 path on the boot partition (Windows 7 installation partition) when running from WinPE. 

    And my difficulty with this command continues...

    When all the stars align, and you begin to execute the command ReagentC.exe /setreimage /path r:\ successfully, I found that it does not update the Windows Recovery Environment bootloader GUIDs accordingly.  So I ditched this command and had to find another route.

    The Vista SP1 BitLocker Design Guide mentions that in order to use Windows RE in conjunction with BitLocker, "the Windows RE boot image must reside on a volume that is not protected by BitLocker".  By default, Windows 7 places the boot configuration data on the system partition and the operating system files on the boot partition (in contrast to Windows Vista where the boot configuration data and the operating system files on the same partition, which is the system/boot partition).  I could deploy Windows RE to the system partition, but this configuration would not give me the ability to do a CompletePC restore:  according to the Design Guide, a "Complete PC must always restore the active [system] partition, but fails to do so when the files that Windows RE uses to start from are also on the active partition."

    So my other option now is to follow the BitLocker partitioning guidelines from the Design Guide.  This involves creating three partitions, one for the boot configuration data (system partition), one for the recovery environment (recovery partition), and one for the operating system files (boot partition). 

    By default, Windows 7 configures the Recovery Environment to run from the boot partition.  For comparison, Vista does not configure a Recovery Environment at all.  In the default case of Windows 7, the Recovery Environment is set to run from the winre.wim file in the \Recovery\{WinRE_BootLoader_GUID} directory on the boot partition (the one with the Windows files on it). 

    But things change as soon as you enable BitLocker.  This is because the Windows Recovery Environment must reside on a volume that is not protected by BitLocker.  In fact, when you enable BitLocker through the control panel in Windows 7, you will receive a message stating that the Windows Recovery Environment will be moved to either the System or Recovery partitions. 

    So far, here are the main points:

    1.  The Windows Recovery Environment cannot reside on the boot partition (the partition with the Windows files on it) when BitLocker is enabled.

    2.  The Windows Recovery Environment cannot reside on the system partition (the first partition containg the boot configuration data) when you want to do a Complete PC Restore.



    So where do you go from here?  Well...You need to manually configure the Windows Recovery Environment to deploy to a third partition.  Here's how I did it:

    1.  In the WinPE pass of your answer file, create three partitions.  The first partition you create will always be the system partition.  You need to make this partition the active partition.  This is the partition on which Windows 7 Setup places the boot configuration data files (bcd and bootmgr).  Do not assign it a drive letter.  Make the size around 1GB.  The second partition you create is the recovery partition.  Assign it the drive letter R and make the size around 1.5 GB.  The third partition you create is the boot partition.  Assign it the drive letter C and extend the partition to fill the rest of the disk.  NOTE:  when you complete the remaining steps below, the system partition and the recovery partition will not show up in Windows Explorer.  Right now the system partition does not have a drive letter, but the recovery partition does.  You will run a command later that removes the drive letter for the recovery partition.  See answer file below for Window 7 Unattend for BitLocker and WinRE partitions.

    2.  In your answer file, prevent the Windows Recovery Environment from installing itself by default.  This can be done by setting the UninstallWindowsRE item from Microsoft-Windows-WinRE-RecoveryAgent(WAIK 2.0 Beta) to true.  This component is added in the oobeSystem pass.  You do not want the Windows Recovery Environment installed by default because it is easier to manually install it.  If you installed it by default, then you would have to use bcdedit.exe to configure the Windows Recovery Environment boot loader so that it points to your new partition. 

    3.  Grab the winre.wim file from the install.wim file in the Windows 7 source media (you'll need to use the mounting functions from dism.exe or imagex.exe).  You can find the winre.wim file in the \Windows\System32\Recovery folder.  Also grab the boot.sdi file from the \Windows\Boot\DVD\PCAT folder.  Place them both in the \Windows\System32 directory of your Windows 7 image (you'll need to mount this as well :). 

    4.  Grab the script SetAutoFailover.cmd from the old WAIK 1.1 and place it in the \Windows\System32 directory of your Windows 7 image.  For some reason, Microsoft chose not to include this script in WAIK 2.0 Beta.  The SetAutoFailover.cmd script is found in the WAIK 1.1 \Program Files\Windows AIK\Recovery folder.  This script modifies the boot configuration data to incorporate the Windows Recovery Environment from the recovery partition.  This is the part that I was hoping the command mentioned at the beginning of my post, ReagentC.exe, would make life easier for me.  But I actually installed the old WAIK in a virtual machine to get this file. 

    5.  During the oobeSystem pass, introduce a SynchronousCommand from the FirstLogonCommands field in the Microsoft-Windows-Shell-Setup component.  This command will point to a batch file (which you incorporate into your Windows 7 image) that does the following:

    a.  Copies the winre.wim and boot.sdi files from the \Windows\System32 folder in your Vista image (from Step 1) to your R drive.  You can use the command attrib +R +S +H r:\boot.sdi and attrib +R +S +H r:\winre.wim to make these files super hidden. 

    b.  Runs the SetAutoFailover.cmd script, which updates the boot configuration data to point to the Windows Recover Image on your R drive.  The command I use is SetAutoFailover.cmd /target R: /wim /partition 2 /disk 0.  Keep in mind that partition indexing starts with a 1 and disk indexing starts with a 0.  So the system partition has index 1, the recovery partition has index 2, and the boot partition has index 3.  And the disk on which I am installing all the partitions is the first disk, disk 0. 

    c.  Performs cleanup of the extraneous winre.wim and boot.sdi files on your \Windows\System32 directory of the boot (Windows) partition. 

    That's all there is to it.  During first logon, Windows will begin copying the winre.wim and boot.sdi files to the R partition.  From that point, the SetAutoFailover.cmd script configures the Boot Configuration Data to provide a repair option in the F8 menu that boots from the recovery partition.  The SetAutoFailover.cmd script will also remove the recovery partition's R letter assignment from Windows Explorer.

    Hope this helps...now it's on to scripting BitLocker Deployment :-) 


    Windows 7 Unattend for BitLocker and Windows Recovery Environment Partitions (WinPE Pass)

            <component name="Microsoft-Windows-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <WindowsDeploymentServices>
                    <ImageSelection>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>3</PartitionID>
                        </InstallTo>
                    </ImageSelection>
                </WindowsDeploymentServices>
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>1500</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Size>1000</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Extend>true</Extend>
                                <Order>3</Order>
                                <Type>Primary</Type>
                            </CreatePartition>
                        </CreatePartitions>
                        <ModifyPartitions>
                            <ModifyPartition wcm:action="add">
                                <Active>true</Active>
                                <Format>NTFS</Format>
                                <Label>System</Label>
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <TypeID>07</TypeID>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Active>false</Active>
                                <Format>NTFS</Format>
                                <Label>Recovery</Label>
                                <Order>2</Order>
                                <PartitionID>2</PartitionID>
                                <TypeID>07</TypeID>
                                <Letter>R</Letter>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Active>false</Active>
                                <Format>NTFS</Format>
                                <Label>OS</Label>
                                <Letter>C</Letter>
                                <Order>3</Order>
                                <PartitionID>3</PartitionID>
                                <TypeID>07</TypeID>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <DiskID>0</DiskID>
                        <WillWipeDisk>true</WillWipeDisk>
                    </Disk>
                </DiskConfiguration>
            </component>


    MCITP, MCTS Vista
    Friday, April 17, 2009 4:57 AM
  • Greg, thanks for that information, I have run into the same issue as well. I have been struggling all week to get a recovery enviroment going. While I have been beta testing the WAIK 2.0 /PE 3.0 enviroment, it seems like the documentation was whipped up in a jiffy by someone who has never acually gone through this process. There are also several errors in the documentation about the partition ID's etc etc. I suppose that is no different then the documentation for WAIK 1.0 and 1.1.

    Microsoft, please go through this documentation and try to eliminate the many errors and inconsistencies. This deployment process shouldn't be this hard!

    Greg, again thanks for sharing that and keep up the good work! 

    Thursday, May 7, 2009 7:06 PM
  • Hi,

    I think I have a similar problem. I posted but no one can help me or understanding, so I thought to ask you directly who would you solve the following problem:

    I am creating a recovery image install.wim from a custom installation of windows7, to recover my system in case of failure and I want to deploy this image in a recovery partition at the beginning of the disk

    I followed the steps in the guide for deployment tool and in partitucular:

    1) prepared the hd with the following script

        select disk 0
        clean
        create partition primary size=10000 id=27
        format quick fs=ntfs label="Recovery"
        assign letter="R"
        create partition primary size=300
        format quick fs=ntfs label="System"
        assign letter="S"
        active
        create partition primary
        format quick fs=ntfs label="Windows"
        assign letter="W"


    2) I installed w7 with dvd and it used the two partitions System and Windows above
    note that after the installation, my drive letter when I start the system with winPE are the following:

    d -> recovery
    c -> system
    e -> windows

    3) after customized the system, I captured the windows partition with the following comand

        imagex /capture e:\ e:\my-windows-partition.wim "My Windows partition"

    and copied the above wim image in a share location which for simplicity I will call \\myshare (can be a usb mass storage...)

    3) now my goal is to move the windows image in the recovery partition and have the possibility to restore the system in a factory state with winRE, according with what expressed in

    http://technet.microsoft.com/en-us/library/dd744280%28WS.10%29.aspx

    'setup-based recovery solution' or possibly whit 'custom recovery solution'. starting with the same procedure there are some problems in using reagentc.exe
    In particular, during the installation w7 creates a winre.wim file located in e:\Recovery\<guid>\winre.wim, but when I try to move this file into the system partition as described in the procedure, I get an error saying that this file doesn't exist, while I can see it with dir command.

    So I created my own winre.wim file using the procedure described here

    http://technet.microsoft.com/en-us/library/dd744525%28WS.10%29.aspx

    and used this version sas winre.wim file. I moved this file to the system partition with the following

    mkdir C:\Recovery\WindowsRE

    move \\myshare\winre.wim C:\Recovery\WindowsRE
    remember that for me C is the 'system' partition and not the 'windows' partition, when I boot my system with winPE.
    now in order to instruct the system to use this winre.wim image i issued the command
    E:\Windows\System32\Reagentc.exe /setreimage /path C:\Recovery\WindowsRE /target E:\Windows
    but I received and error saying that I cannot use Reagentc because of x86 x64 compatibility issues. thus I worked around this using the version under SysWOW64, which takes care of those issues, but the error was 'cannot create an existing file'. Basically the system has already his own winre.wim file and it doesn't allow to move it on my 'system' directory (error before) not even instruct windows to use another one...

    At this point I completed the procedure using my windows installation image and moving it in the recovery partition

    copy \\myshare\images\my-windows-partition.wim d:\
    rename d:\my-windows-partition.wim d:\install.wim
    e:\Windows\SysWOW64\Reagentc.exe /setosimage /path d:\ /target e:\Windows
    which was accepted... the system now is using this recovery image in case we follow the procedure described below:

    Step 2: Test your recovery solution

    In this step, you start the destination computer to verify that the recovery tool can be started.

    1. Remove the CD-ROM and any USB drives.
    2. Start the destination computer and complete Windows Welcome.
    3. Click Start , click Control Panel , click System and Security , click Backup and Restore , and then click Recover system settings or your computer .
    4. Click Advanced recovery methods and then click Reinstall Windows
    5. Follow the on-screen instructions. The computer restarts.
    6. Verify that the computer starts in Windows RE. The system reinstalls Windows by using the image that you placed in the recovery partition. When the installation is complete, you have the option to restore other files you have backed up.

    but the problem is that in case of a failure of the whole system, when I cannot even boot in windows, the only way I know to recover my system is to boot the pc with WinPE, format 'windows' partition and apply the image with imagex. For example in the above configuration I would say:

    imagex /apply d:\install.wim 1 e:\



    Do anyone know how to work around this and any suggestion? especially why cannot I move the winre.wim image that w7 creates during the installation process from 'windows' to 'system' partition and instruct the system to use it? In practical worlds, why Reagentc fails when I am trying to redirect it to 'system' partition?
    What I would like to perform is a similar task to F8 repair your computer option we had in vista... It should be possible I guess.



    If you know how to help me that would be really helpful to me :)
    Tuesday, November 3, 2009 6:14 PM
  • Hello,

    Highkftj, You should try this solution:
    Prepare disk with: diskpart.exe /s disk.txt, where disk.txt is:

    select disk 0
    create partition primary size=500
    select partition 1
    format fs=ntfs label="System" quick

    create partition primary size=5000 id=27
    select partition 2
    format fs=ntfs label="winre" quick
    assign letter = D

    create partition primary
    select partition 3
    format fs=ntfs label="Win7" quick
    assign letter = C


    Install Win 7 to partition 3. When You'll see first OOBE screet (this one where You can select Your regional settings) hit Ctrl+Shift+F3. Computer will boot into audit mode. Now install all the software You want and run:
    c:\windows\system32\sysprep\Sysprep.exe /generalize /oobe /shutdown

    Boot to some WinPE environment  (eg. Windows 7 OPK DVD). Check drive letters in diskpart and run:
    mkdir D:\Recovery\WindowsRE
    imagex.exe /capture /compress fast C: D:\Recovery\WindowsRE\install.wim "Win7oobe"
    move C:\windows\system32\recovery\winre.wim D:\Recovery\windowsRE
    C:\windows\system32\Reagentc.exe /setreimage /path D:\Recovery\windowsRE /target C:\Windows
    C:\windows\system32\Reagentc.exe /setosimage /path D:\Recovery\windowsRE /target C:\Windows

    If You encounter any problems with hdd recovery solution, try not to install any additional software 'cause it sometimes may conflict with sysprep's generalize option.

    I made it work so if You'll have any questions feel free to ask me.
    Thursday, November 5, 2009 10:12 AM
  • Hello,

    Highkftj, You should try this solution:
    Prepare disk with: diskpart.exe /s disk.txt, where disk.txt is:

    select disk 0
    create partition primary size=500
    select partition 1
    format fs=ntfs label="System" quick

    create partition primary size=5000 id=27
    select partition 2
    format fs=ntfs label="winre" quick
    assign letter = D

    create partition primary
    select partition 3
    format fs=ntfs label="Win7" quick
    assign letter = C


    Install Win 7 to partition 3. When You'll see first OOBE screet (this one where You can select Your regional settings) hit Ctrl+Shift+F3. Computer will boot into audit mode. Now install all the software You want and run:
    c:\windows\system32\sysprep\Sysprep.exe /generalize /oobe /shutdown

    Boot to some WinPE environment  (eg. Windows 7 OPK DVD). Check drive letters in diskpart and run:
    mkdir D:\Recovery\WindowsRE
    imagex.exe /capture /compress fast C: D:\Recovery\WindowsRE\install.wim "Win7oobe"
    move C:\windows\system32\recovery\winre.wim D:\Recovery\windowsRE
    C:\windows\system32\Reagentc.exe /setreimage /path D:\Recovery\windowsRE /target C:\Windows
    C:\windows\system32\Reagentc.exe /setosimage /path D:\Recovery\windowsRE /target C:\Windows

    If You encounter any problems with hdd recovery solution, try not to install any additional software 'cause it sometimes may conflict with sysprep's generalize option.

    I made it work so if You'll have any questions feel free to ask me.

    Hi,

    first of all thanks for your help, I strongly appreciate it, since that really few people are aware of this issue with reagentc.

    so I have few questions before starting with the process. I am not very familiar with the audit mode installation, but it shouldn't be a problem if I follow your instructions. just when you say:

    Now install all the software You want and run:
    c:\windows\system32\sysprep\Sysprep.exe /generalize /oobe /shutdown

    you meant I have to finish windows7 installation, start the pc, install antivirus and office... this would require several reboot I guess, so what's happen with the audit mode? should I change something in the way I should install my software?

    After I complete the personalized installation of win7 (with drivers, antivirus, office - I will stick just into this software in order to avoid problems with sysprep...) I will perform the image stuff & deploy. I noticed you move the winRE to the recovery partition instead of the system partition as suggested by microsoft. Is this the right thing to do? while I was trying to move the winRE.wmi from windows to system partition I received errors like unable/the file does not exist... In practical terms I wasn't able to move that file. Again I am referring to the winRE.wim that windows generates automatically in its installation process, not the one described by microsoft tutorial 'how to create a winre image...'

    If everything I said makes sense to you probably I understood your help. Please let me know...

    After that should I be able to restore my image with F8 'repair your computer' option or still I have to use winPE and imagex /apply. I noticed that when you use F8, it actually doesn't format windows partition, but creates windows.old... I don't like this idea because consider you get a virus or your windows gets overloaded of old software, you want to get rid off everything and starting from scratch, a clean installation or image which has all what you need. this was the real porpoise of my post....
    Thursday, November 5, 2009 6:27 PM
  • Hi,

    I am trying your solution but I couldn't make it work yet, also after several trials...
    when I boot in audit, and start installing, it always pop up the sysprep windows to ask me to generalize oobe... don't know if this is normal, I just cancel the windows
    Also after not having installed practically anything I try to generalize and sysprep fails (with no software installed).
    is this normal? and btw, do I have to do this syspre thing or I just can disregard and capture an image from my harddrive?
    thanks...
    please if you can help me...
    Monday, November 9, 2009 6:37 AM
  • Hello,

    Highkftj, You should try this solution:
    Prepare disk with: diskpart.exe /s disk.txt, where disk.txt is:

    select disk 0
    create partition primary size=500
    select partition 1
    format fs=ntfs label="System" quick

    create partition primary size=5000 id=27
    select partition 2
    format fs=ntfs label="winre" quick
    assign letter = D

    create partition primary
    select partition 3
    format fs=ntfs label="Win7" quick
    assign letter = C


    Install Win 7 to partition 3. When You'll see first OOBE screet (this one where You can select Your regional settings) hit Ctrl+Shift+F3. Computer will boot into audit mode. Now install all the software You want and run:
    c:\windows\system32\sysprep\Sysprep.exe /generalize /oobe /shutdown

    Boot to some WinPE environment  (eg. Windows 7 OPK DVD). Check drive letters in diskpart and run:
    mkdir D:\Recovery\WindowsRE
    imagex.exe /capture /compress fast C: D:\Recovery\WindowsRE\install.wim "Win7oobe"
    move C:\windows\system32\recovery\winre.wim D:\Recovery\windowsRE
    C:\windows\system32\Reagentc.exe /setreimage /path D:\Recovery\windowsRE /target C:\Windows
    C:\windows\system32\Reagentc.exe /setosimage /path D:\Recovery\windowsRE /target C:\Windows

    If You encounter any problems with hdd recovery solution, try not to install any additional software 'cause it sometimes may conflict with sysprep's generalize option.

    I made it work so if You'll have any questions feel free to ask me.

    Hi,

    following your description took me one big step forward. Thanks for kickin me in the right direction ,-)
    But after all, I still have one big problem. If I have done all the stuff including the image file etc. I tested my (your) work. Recovering the system works fine up to one point. If I delete the Windows 7 Partition and recreate it, I am still able to recover the machine, but if I do a reboot between recreation and recovery, I am not able to boot anything anymore.
    You might say, hey, don't reboot the maschine and your problem is gone! No, it isn't :( Some people do strange things with their PC and they need to reinstall even after the Windows partition is lost. Some kind of desaster recovery...
    Could you give me a hint on that? Do you have an idea? I already googled a lot of things, but nothing really helped me out of this sandpit.

    thanks in advance!

    M.
    Tuesday, November 10, 2009 1:40 PM
  • HI,

    I did all the steps and make it work.

    you should tell me a little more about your problem but for now I have the feeling that there is something wrong with the boot bcd. you should try to look into bcdedit to understand if the boot table is configured properly according with your table. you can safely delete the entries and then with bootbcd c:\windows add the entry where your system is located (look into the help to understand it better)

    another problem I faced and you may have to is that after you sysprep your system with some software the system fails to restart and it goes in a endless loop. this is a well known problem caused by thirdy part sofware especially antivirus (norton, avira...)

    there in not known solution in this case, the only thing you can sysprep withouth the antivirus...

    hope this helps let me know in which side you are so I can help more in case
    Monday, November 16, 2009 5:52 PM
  • Hi highkftj,

    Thanks for your kind replay.

    I'll try to explain my problem a little more detailed. The Image I have is a generalized an resealed one. So the sysprep part is already done. This image is my "factory state image". I built a disc with three partitions on it. First one is the system-partition with 100MB of disc space. the second one is my WinRE partition with 10GB. the third one is the Windows 7 partition. I have placed my WinRE.WIM and my recovery.wim on the WinRE partition.

    So, after the "end user" booted the machine and went through the OOBE, he (she) has three options to run into the recovery process. First one is the link inside control panel. Second one is the pre-defined bootkey (F11 in my case). And the last way goes through F8 menu to "repair your computer".
    All these ways lead to the same goal. They work fine!

    Now the theory :)
    someone played around with some partition tools or with other operating systems. Of course, the worst case is a blank disc, but let's say, the WinRE partition and the System partition are still alive and only the Windows 7 partition is gone. So we have unused disc space where the Windows 7 partition was before.
    pressing the F11 key brings up the same message as the F8 key does: "C:\windows\system32\winload.exe is missing or corrupt"
    From my understanding the system should start winRE from the WinRE partition. Why is the machine looking for a file on drive c:? I already guess that this behavior is by design and must be taken as is.

    May I bother you with some other question as well? Do you know anything deeper about the recovery.txt that is created through the recovery process? I would like to delete the file to stop the "after OOBE message" from windows backup, but the side efect of deleting the file is, that the advanced recovery option returns an error.

    Thanks in advance for all the time you spend on my problems!

    best regards
    M.
     
    Wednesday, November 18, 2009 1:23 PM
  • Hi,

    I tried to figure out your error but I can't really help so much. I never had something like that although I am using the same configuration about partition and deploiment of winre.

    In my case I am trying to personalize the winre image following the guide "customize the windows RE experience". Basically I want to deploy some tools to have a different restore option at the end of the windows RE panel. I put all the files in the Tools directory of my winRE image but nothing, the option does not come up.

    do you have any clue about that. Any help is strongly appreciated!

    Thanks
    Monday, November 23, 2009 4:58 AM
  • Hi highkftj,

    You could reboot the OS being in audit mode as many times You want, I think.
    My solution is based on technet library's manuals so there's no un-kosher ideas ;)
    That's good it creates windows.old directory - You could then retrieve Your old files from that directory or just remove it.

    Sorry for answering so late, I didn't have much free time recently.

    Regards
    Friday, November 27, 2009 1:49 AM
  • You must use sysprep before capturing Your system.
    In audit mode, each time You reboot Your machine, the sysprep window appears -that's normal. You could cancel it and run sysprep from command prompt later.
    If sysprep fails (with no additional software or drivers installed) i suggest performing new installation.
    If You installed anything, the only way is to install one thing then test, install second then test etc.

    BTW I also suggest reading technet library more carefully ;)
    Friday, November 27, 2009 1:56 AM
  • hightftj, could You send me this giude  "customize the windows RE experience" ?
    I could take a look at this.
    Friday, November 27, 2009 2:05 AM
  • to highftj, great my answer disappeared.. grr @IE. im on my test install so no firefox :/

    Anyway... to make the tool.exe appear, your exe file must have some properties:

    A. must have some embedded version info, icon info, production version , somethign something... these must be extracted you see from the winre tool

    then it will show up. It doesn thave to be a 'real' exe, it can be a script wrpped into an exe as well.

    In my case I wrote a bat file to sort things out, so i found a free wrapper called bat2exe or something. there I could add these things and embed it into the 'exe' file.

    Other ones are perhaps autoit? I dont know.. just look up free exe wrappers or so.

    If* you however, ARE writing a full exe program, then again, just make sure you have an icon , verison info n those things defined in your exe.

    Ok so when that shows up you will have it working in the tools directory as specified in reagent.xml or what its called :)

    I have seen some people having problems with sub directories in tools folder so I just used my exe in tools (rememebr to add any dlls or other linked dependables in the same directory). I also noticed there can be some dependency issues... for example, my tool (bat) calls imagex but even if i add imagex in tools directory it failed somehow.. but I see this as another road to explore when Im back to that.

    My current issue is what the greg8 put as the total answer. Let me point out, you do NOT need 3 partitions as he claims to make the winreimage work. As long as one APPLIES the winre.wim to one's recovery partition and use setautofailover.cmd successfully (u might need to debug the .cmd file if you get errrors or like file or path not found etc.. quite trivial though with a few echos and pauses).

    Then , you can get all this to work... however, that is assuming one DOESNT actually do the reagentc.exe commands (so I guess one can't add a bootkey F11 or F12 in my case) :(

    The reagentc.exe commands seem to be when one doesnt apply winre.wim to partition but just stores the wim file to be launched into ram. Doh, microsoft really can give headaches :/

    I think it is because they have done one bad thing and the perenially bad thing; good thing: giving WAIK/dism/imagex/sysprep.. all these tools to end users (and winPE/RE).. this is a very nice move by them ad definitely will bring back more customers...bad thing... ALWAYS ASSUMING or giving cases of pure mass deployments, when they have a large HOME USER customer base and when one is tryign to set up a PRIVATE HOME recovery system by a retail version of windows 7 say, they should be kind enough to provide proper documentation. In my case, I am rebuilding my stand alone windows 7 for this laptop, hence I do NOT generalize and sysprep my image. somethign which gives raise to other issues with BOOTING this. It is still a disgrace and shame how little they bother to help end users with this when it is not wrong. Such an image would ONLY be illegal if it was used to another computer (which must of had same hardware).

    sigh.

    ANyway, the tool thing is just because you are lacking the proper embedded info in your exe file high.. hope it helps... use recoverytool or custom tool option. (it worked when I used recoverytools personally in the xml).

    Friday, November 27, 2009 9:14 PM
  • Dear All,

    I solved my issue and created the configuration I wanted.

    I wrote my program in C++ and customized the winre.wim image

    I also created the guide which is able to turn around the bugs that sysprep, winre have right now. I didn't capture a generalized image because it's well known that sysprep at the present fails with norton antivirus 2009 and the pc will not reboot anymore (check other blogs regarding this on the net).

    I can deliver my program and guide to anyone is interested, probably I will create a blog about that. For now I got what I want.

    Btw, the technet library sucks! it's totally unprecise and if you want to make it works you need to try till you don't come up with your own guide and method.

    Thanks anyway for the help to figure it out.

    Monday, November 30, 2009 5:13 PM
  • Hi highkftj,

    Could You send me Your program code and guide at %username%ATgmailDOTcom ?
    I'm interested in the way You done that.
    Wednesday, December 2, 2009 5:07 PM
  • hi there high.. I am doing the same in c++/c# (the tool is a mix of native for the winpe and c#/managed code for some gui stuff in win7).

    Did my advice earlir help you by the way? I would like to see your solutions as I have had some problem accomodating my tool in the more restricted subsytem of the winpe environment.

    solar
    Saturday, December 19, 2009 2:41 PM
  • hmm, did My post disappear again?

    did my advice help you high?

    By theway, Im writing my tool also in c++ and a frontend for some other stuff in win7 in c#.

    I have some problems with the more restricted subsystem of winpe for my tool so would like to see what you came up with if you are still around :)

    solar
    Saturday, December 19, 2009 2:44 PM
  • Hello,

    Highkftj, You should try this solution:
    Prepare disk with: diskpart.exe /s disk.txt, where disk.txt is:

    select disk 0
    create partition primary size=500
    select partition 1
    format fs=ntfs label="System" quick

    create partition primary size=5000 id=27
    select partition 2
    format fs=ntfs label="winre" quick
    assign letter = D

    create partition primary
    select partition 3
    format fs=ntfs label="Win7" quick
    assign letter = C


    Install Win 7 to partition 3. When You'll see first OOBE screet (this one where You can select Your regional settings) hit Ctrl+Shift+F3. Computer will boot into audit mode. Now install all the software You want and run:
    c:\windows\system32\sysprep\Sysprep.exe /generalize /oobe /shutdown

    Boot to some WinPE environment  (eg. Windows 7 OPK DVD). Check drive letters in diskpart and run:
    mkdir D:\Recovery\WindowsRE
    imagex.exe /capture /compress fast C: D:\Recovery\WindowsRE\install.wim "Win7oobe"
    move C:\windows\system32\recovery\winre.wim D:\Recovery\windowsRE
    C:\windows\system32\Reagentc.exe /setreimage /path D:\Recovery\windowsRE /target C:\Windows
    C:\windows\system32\Reagentc.exe /setosimage /path D:\Recovery\windowsRE /target C:\Windows

    If You encounter any problems with hdd recovery solution, try not to install any additional software 'cause it sometimes may conflict with sysprep's generalize option.

    I made it work so if You'll have any questions feel free to ask me.

    3. I would love to have my own customized recovery partition and I am digging init from last 3 weeks but no success.

    Have seen the WAIK /OPAK documentation for the recovery solution and the following links:

    http://technet.microsoft.com/en-us/library/dd744280(WS.10).aspx

    http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/1ab1c961-fbd0-4b84-8893-3974dfa8822e

    http://technet.microsoft.com/en-us/library/dd799242(WS.10).aspx

     but when I reach the following stage, i struck

    Configure Windows to recognize the default Windows Recovery image (Winre.wim)
    C:\Windows\System32\Reagentc.exe /setreimage /path S:\Recovery\WindowsRE /target C:\Windows

    All the times it says file is not found. So what should I do ? I got the hexa value for the F11 that later I can use to make my customized recovery to work.

    Can you help me with this?

    Here is the Disk Structure:

    C: is the System Drive

    D: is Recovery Drive

    E: is OS W7 drive

    (When I created these partitions in Diskpart I used letters S for system, R for Recovery and C for the OS, but I dont know why in winPE I am seeing the changed letters.)

    According to http://technet.microsoft.com/en-us/library/dd744280(WS.10).aspx

    4.  

    C:\Windows\System32\Reagentc.exe /setreimage /path S:\Recovery\WindowsRE /target C:\Windows

     

    I run the same commad but give me error that Reagentc.exe is not found.

    I run the command form the X:\Windows\System32 which is my WinPE (booted from WDS WinPE image).

    Also checked with drive E: X:\Windows\System32  that is my Win7 OS drive but I can not run this command.

    Checked it when the OS is fully installed and also checked after the going to the Audit mode and then Reaselin it, but no luck. (also checked the link: http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/1ab1c961-fbd0-4b84-8893-3974dfa8822e )but no success. 


    N.A.Malik
    Friday, December 17, 2010 7:15 AM
  •  I would love to have my own customized recovery partition and I am digging init from last 3 weeks but no success.

    Have seen the WAIK /OPAK documentation for the recovery solution and the following links:

    http://technet.microsoft.com/en-us/library/dd744280(WS.10).aspx

    http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/1ab1c961-fbd0-4b84-8893-3974dfa8822e

    http://technet.microsoft.com/en-us/library/dd799242(WS.10).aspx

     but when I reach the following stage, i struck

    Configure Windows to recognize the default Windows Recovery image (Winre.wim)
    C:\Windows\System32\Reagentc.exe /setreimage /path S:\Recovery\WindowsRE /target C:\Windows

    All the times it says file is not found. So what should I do ? I got the hexa value for the F11 that later I can use to make my customized recovery to work.

    Can you help me with this?

    Here is the Disk Structure:

    C: is the System Drive

    D: is Recovery Drive

    E: is OS W7 drive

    (When I created these partitions in Diskpart I used letters S for system, R for Recovery and C for the OS, but I dont know why in winPE I am seeing the changed letters.)

    According to http://technet.microsoft.com/en-us/library/dd744280(WS.10).aspx

    4.  

    C:\Windows\System32\Reagentc.exe /setreimage /path S:\Recovery\WindowsRE /target C:\Windows

     

    I run the same commad but give me error that Reagentc.exe is not found.

    I run the command form the X:\Windows\System32 which is my WinPE (booted from WDS WinPE image).

    Also checked with drive E: X:\Windows\System32  that is my Win7 OS drive but I can not run this command.

    Checked it when the OS is fully installed and also checked after the going to the Audit mode and then Reaselin it, but no luck. (also checked the link: http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/1ab1c961-fbd0-4b84-8893-3974dfa8822e )but no success. 



    N.A.Malik
    Friday, December 17, 2010 7:20 AM
  • Hello,

    Highkftj, You should try this solution:
    Prepare disk with: diskpart.exe /s disk.txt, where disk.txt is:

    select disk 0
    create partition primary size=500
    select partition 1
    format fs=ntfs label="System" quick

    create partition primary size=5000 id=27
    select partition 2
    format fs=ntfs label="winre" quick
    assign letter = D

    create partition primary
    select partition 3
    format fs=ntfs label="Win7" quick
    assign letter = C


    Install Win 7 to partition 3. When You'll see first OOBE screet (this one where You can select Your regional settings) hit Ctrl+Shift+F3. Computer will boot into audit mode. Now install all the software You want and run:
    c:\windows\system32\sysprep\Sysprep.exe /generalize /oobe /shutdown

    Boot to some WinPE environment  (eg. Windows 7 OPK DVD). Check drive letters in diskpart and run:
    mkdir D:\Recovery\WindowsRE
    imagex.exe /capture /compress fast C: D:\Recovery\WindowsRE\install.wim "Win7oobe"
    move C:\windows\system32\recovery\winre.wim D:\Recovery\windowsRE
    C:\windows\system32\Reagentc.exe /setreimage /path D:\Recovery\windowsRE /target C:\Windows
    C:\windows\system32\Reagentc.exe /setosimage /path D:\Recovery\windowsRE /target C:\Windows

    If You encounter any problems with hdd recovery solution, try not to install any additional software 'cause it sometimes may conflict with sysprep's generalize option.

    I made it work so if You'll have any questions feel free to ask me.

    C:\windows\system32\Reagentc.exe /setreimage /path D:\Recovery\windowsRE /target C:\Windows
    C:\windows\system32\Reagentc.exe /setosimage /path D:\Recovery\windowsRE /target C:\Windows
     
    I was able to boot the machine from the Recovery partition, I used the /bootKey as well and it was also working fine. But when I click the Re-install OS it give me message that there is no image available.
    Any idea?

    N.A.Malik
    Friday, December 24, 2010 11:02 PM
  • Malik.. just out of curiousity.. are you using a 64 bit image? In which case, you might be needing to use the sysWOW folder?

     

    don't know.. just a thought

    Friday, January 28, 2011 7:14 AM
  • Yes, I am using x64 base image.
    N.A.Malik
    Friday, January 28, 2011 10:02 PM
  • hi again.. sorry I didn't really get your problem(s).

     

    This whole thing is simple but extremely confusing in it's documentaiton (probably due to 23 different people all working on it for m$).

     

    This is typical.

     

    Hmm, can you more succinctly replicate your symptoms / problems and I will tell you what you need to do.

     

    you see, an additional little problem is when and if you choose to use the winre as A. a flat base partition (eg. imagex /apply winre.wim R:\Recovery, type 27) or as a ram solution (eg. Copy winre.wim R:\,,\recovery\boot.wim) etc. etc.

     

    Sometimes you would prefer to use reagentc.exe , sometimes setautofailover. but nevermind.

     

    IF you can identify and state accurately your problems , and how they arise, then I will let you know step by step what to do /.

     

    Solar

    PS. Oh.. by the way.. when making x64 solutions, keep in mind, that the winre can *only* deal wit native 64 bit, unlike x86.

     

    Are you using OPK or AIK? If you are using the OPK (Whcih I doubt), you could do copype.cmd amd64 <dir> and you would be safe.

    I assume you are using waik, so then you have ot make sure you extract the correct wim from install.wim from win 7.

     

    PPS. ALso, to not confuse yourself with the letters, you should A. create your partitions and assign letters to them in winpe.

    B. Reboot BACK into the winpe (eg. X:\).. you will know how the 'normalised' partition lettering for the winpe environment. Take note of these. (these are the ones you will be referring to when using Regaentc.exe in X:\ later on).

    C. BOot into Windows and notice how the letters will be changed probably (windows will be C:, Recovery will be hidden if you use type 27, etc). I do not use bitlocker so I disregard system partitions for now. I admit I do not rememebr right now if I could indeed use some extra space on my Recvoery partition for bitlocker.. as I wrote a program which automatically will set up the boot system ON R:\ (the type 27 hidden partition) AND adds automatically ALL OS (including linux if exists and is correctly set up but thats entirely my own coding and has nothing to do with these tools) and is also why high.. something or who it was was having boot problems. By applying images and keeping the bootmgr intact will create inaaccurate GUIDs which will lead to possible boot errors and the like. However, I shall leave that as an exercise as that is another topic.

    • Proposed as answer by N A Malik Sunday, February 6, 2011 9:58 PM
    Saturday, February 5, 2011 10:47 AM
  • Hi,

    Ok, I will try it again and tell you. Thanks for the reply.


    N.A.Malik
    Saturday, February 5, 2011 6:29 PM
  • I spent a long time discerning which things were relevant where; it is very contradictory at times. However, I ended with my scripts doing what I needed. Turned out, they are pretty much what setautofailover.cmd covers. 

    Having the script to look up would of saved me 1.5 months of reading but then again, I wouldn't perhaps learn so much from trial and error.

     

    The truth is, all solutions more or less are in that script. If you have it, use it (adjust to windows 7) and there is no need for ReagentC.exe *at all* (well, before I say that too strongly, I have made scripts which will identify one OS as {default} is several Win OS are installed).

    Also, In the odd chance you would like to use a custom bootkey, look up custom bootstrapping. 

    Ok , I read your post now.. sure I wil help ya.

    Note! On default winre solutions or moving it out to another partition ReagentC is the way to go I guess, however:

     

    A. Custom solution? Forget ReagentC.exe. bootkey we will sort out in a sec.

     

    B. wim or flat image? you didn't answer me. let us assume wim for those lean neat lil things.

     

    Scenario: Single win 7 OS, D0P2, OEM SYSTEM BUILDERS aka WIndows OPK, *not* AIK (however, it is a simple scripting task to do the setauto but requires a little insight and study into the bcd/bootmanager)

     

    (D0P1) partition R: 0x27,active,  size= sufficient for winre.wim + boot files (boot.sdi + boot\* + bootmgr) + install.wim + any-other-bloated-stuff-you-wish

    R:\winre.wim // custom winpe w/ srt + custom tool/scripts-whatever

    R:\wherever-I-want-on-R\install.wim // generalized-for-oobe 

    D0P2: C:\ apply.wim

    del R:\boot\BCD

    bootrec /rebuildbcd

    setautofailover /wim /target R:

    DOE.. oh hang on... custom bootkey eh? -> 

    bcdedit /enum {default} (get guid for recovery sequence created by rebuildbcd)

    bcdedit /set {bootmgr} custom:0x0000000054000001 {recovery sequence from above}

    bcdedit /set {bootmgr} customactions 0x000100003d000001 0x0000000054000001 (as an example, makes F3 your custom bootkey)

    double done..

    (you might need to wait to hide the R letter till you have done this; I don't remember, I worked on that a lot last year).

     

    enjoy

    Please propose as answer if it sort syou out, as it will help the poor souls like us in the long run :)

    • Proposed as answer by solar69 Sunday, February 6, 2011 10:39 AM
    Sunday, February 6, 2011 10:31 AM
  • Hi,

    Thanks but things are more different in my case.

    Now I am sacrificing the WinRe.WIM and using winPE to do what´I want. You asked before if I used imagex /apply or copy winre.wim ... I am copying , copy winre.wim R:\

    But thanks for the help.


    N.A.Malik
    Sunday, February 6, 2011 9:58 PM
  • Hi,

    Thanks but things are more different in my case.

    Now I am sacrificing the WinRe.WIM and using winPE to do what´I want. You asked before if I used imagex /apply or copy winre.wim ... I am copying , copy winre.wim R:\

    But thanks for the help.


    N.A.Malik

    Hi Malik.. please pay more attention.  The setup I describe *does* assume a /wim solution (aka what you call a 'copy wim' option).

     

    ok so you are changing the winre.wim and using a winpe.wim with SRT .. sure no difference.

     

    Again:

    DXPX => Disk_id X, Partition_id X

    Disk structure:

    D0P1: R: hidden , 0x27 , active

    D0P2: C, 07

    D0P3: 07, D, extended/logical or primary .. whatever [optional]

    1. capture sysprep.wim "generalized win7 oobe"

    2. Move sysprep.wim R:\wherever\install.wim (as long as it's called install.wim)

    3. copy [custom]-winre-or-winpe.wim R:\winre.wim (MUST be at ROOT and CALLED winre.wim ) * Not really but you would have to script more stuff to make it work

    4. xcopy /E /F ISO\Boot\*.* R:

    copy bootmgr R:

    del R:\Boot\BCD

    5. bootrec /rebuildbcd

     

     

    6. // create wim-entry as ramdisk (wim instead of flat image)

    {ramdisk-GUID} (a newly generated guid, different from wimre-guid) 

     

    bcd /create {ramdisk-GUID} /d "Ramdisk Device Options" /device

    bcd /set {ramdisk-GUID} ramdisksdidevice partition=R:

    bcd /set {ramdisk-GUID} ramdisksdipath \boot.sdi

     

    bcd /set  /create {winre} /d "look-at-me-winre[RAM]" /application OSLOADER

    bcd /set  {winre} device ramdisk=[R:]\winre.wim,{ramdisk-GUID}

    bcdedit /set {winre} path \windows\system32\winload.exe

    bcdedit /set {winre} osdevice ramdisk=[R:]\winre.wim,{ramdisk-GUID}

    bcdedit /set {winre} systemroot \windows

    bcdedit /set {winre} detecthal yes

    bcdedit /set {winre} nx optin

    bcdedit /set {winre} winpe yes

     

    7.

     

    Get or set the GUID for the winre.wim (eg. set GUID which is a qualified GUID id). setting it manually / statically is good in the sense for each recovery, your settings are easier to maintain

    bcdedit /set <winre guid>  custom:46000010 yes (this is only needed if I rememebr correctly if you are doing a custom winre thingy)

     

    bcdedit /set {default} recoverysequence {winre guid}

    bcdedit /set {default} recoveryenabled yes

     

    // to add custom bootkey as you wanted, do:

    bcdedit /set {bootmgr} custom:0x0000000054000001

    // example: ADD CUSTOM BOOTKEY (F3=3d00)

    bcdedit /set {bootmgr} customactions 0x000100003d000001 0x0000000054000001

     

     

    8. diskpart

    select disk 0

    select partition 1

    remove

     

    DONE!

     

    there.. FULL solution for your example , with no more 25 various MS tech papers which contradict each other for the pain of people.

    Please mark as solved for others.

    have fun

    solar

    PS. small notes .. to make this work you have to adjust ONE thing: hint -> boto.sdi must be at root of R:

    so move it form boot OR if you wish to move your beloved winre.wim somewhere but root.. again look at your bcd entries and you will see how to move it should you please. 

     

     

    • Edited by solar69 Monday, February 7, 2011 12:05 PM ignorance is bliss
    Monday, February 7, 2011 11:51 AM
  • Anticipating your next problem:

     

    When building your system or being in the winpe , {default} or {current} is not valid, so you will need to use for the OS you intend to recover

    its actual {GUID}. If your system does not know this [yet] when recovering, you will have to define the GUID as so

     

    bcdedit /default {OS_GUID}

    If you are not sure how to do it automatically OR you have several OS, you will have to create a script or so which automatically parses 

    bcdedit /enum osloader -v  to get the correct {guid}

     

    but this I will leave to you as it's not my job to do in this case :)

     

     

    Addendum: Ooops, sorry... forgot to add you need to link the custom action to your OS guid

    edit =>

     

    // to add custom bootkey as you wanted, do:

    bcdedit /set {bootmgr} custom:0x0000000054000001

     

    to 

     

    // to add custom bootkey as you wanted, do:

    bcdedit /set {bootmgr} custom:0x0000000054000001 {OS_GUID}

    Monday, February 7, 2011 2:37 PM
  • I'm building a PE/RE environment for use in my institutions images and following a similar scheme to those outlined here. I've experimented enough to provide a few tidbits of info that might steer other's thought processes in the right direction.

    The most important thing here is a correctly configured boot file (BCD). BCDEdit.exe is ultimately the only tool REQUIRED to allow for a relocated alternate rescue environment. Some of the main things the optional tools ReagentC.exe and Setautofailover.cmd do are just automating the adjusting of the BCD. Also, if you use those tools, they expect the name of the bootable file to be WinRE.wim. This is especially annoying if you want to use something like WinBuilder to create your custom PE 3.0 environment (which yields a file that is best left named as "boot.wim".)

    So, partition-scheme-wise, the BCD folder named BOOT (and its contents) and bootmgr.sys must reside on a partition that is primary and marked active. The BCD "OSLoader" reference to {default} (whatever that GUID is) must point to the Operating system (probably Win 7). Another "OSLoader" {guid} must define the properties and where the PE/RE wim file is. And another "Device Options" {guid} (or easier--> {ramdiskoptions} -which has a defined guid) must define the properties of the ramdrive (where boot.sdi resides).

    There are other items in the BCD that need to be there and work too, but the 3 items mentioned above are what you really need to provide the option to boot to a PE/RE environment. Let’s take each of those items on one by one in a 3 partition scheme that looks like this:

    Partition1: 1.5GB NTFS Type=27 Primary partition (hidden when booted to the OS) with drive letter R (removed when booted into the OS)

    Partition2: 100MB NTFS Type=07 Active Primary partition with drive letter C containing only bootmgr.sys & the BOOT folder at the root (and maybe memdiag.exe but that's another story).

    Partition3: Drive Letter D NTFS with a sysprepped Win7 or whatever applied to it.

    What does the BCD look like?

    BCDEdit /Store [locationtoBCDfile] /enum all

    -----------------------------------------------------------------------------------------------------

    Windows Boot Manager

    --------------------

    identifier {bootmgr}

    device boot path \bootmgr

    description Windows Boot Manager

    locale en-US

    inherit {globalsettings}

    default {default}

    displayorder {default}

    toolsdisplayorder {memdiag}

    timeout 15

    displaybootmenu Yes

    Windows Boot Loader

    -------------------

    identifier {default}

    device partition=D: path \Windows\System32\winload.exe

    description WhateverYouWannaCallIt

    locale en-US

    recoverysequence {RandomGuidIDentifyingThePEBootLoader}

    recoveryenabled Yes

    osdevice partition=D:

    systemroot \Windows

    resumeobject {GuidToTheResumeObject-NotAddressedHere}

    Windows Boot Loader

    -------------------

    identifier {RandomGuidIDentifyingThePEBootLoader}

    device ramdisk=[R:]\SOURCES\BOOT.WIM,{ramdiskoptions}

    path \Windows\System32\winload.exe

    description Recovery-Environment-WhateverUWantTOCallIt

    locale en-US inherit {bootloadersettings}

    osdevice ramdisk=[R:]\SOURCES\BOOT.WIM,{ramdiskoptions}

    systemroot \windows

    nx OptIn

    detecthal Yes

    winpe Yes

    Setup Ramdisk Options

    ---------------------

    identifier {ramdiskoptions}

    device partition=R:

    description Ramdisk

    ramdisksdidevice partition=R:

    ramdisksdipath \BOOT\BOOT.SDI

     -----------------------------------------------------------------------------------------------------

    Note specifically the two lines in the {default} identifier:

    recoverysequence {RandomGuidIDentifyingThePEBootLoader}

    recoveryenabled Yes

    The first line points at the info for where the RE/PE environment is and what to do with it. The second line says "use F8 to make "repair my computer" point to the item above. Without turning this into too much of a BCDEdit tutorial the above is done in this scenario by:

    BCDEdit /store C:\Boot\BCD /set {default} recoveryenabled yes

    BCDEdit /store C:\Boot\BCD /set {default} recoverysequence {RandomGuidIDentifyingThePEBootLoader}

    Where /store [location to BCD file] is optional if attached or booted from the BCD of interest, and {default} may need to be the actual GUID of the default entry if not booted to or attached to the BCD store of interest like via a recovery console.

    Tricky things about editing the BCD: The BCD references the absolute path or drive letter by the volume number and offset. This means you can't just copy the contents of a working boot partition (bootmgr.sys and the BOOT folder) to an analogous partition on another system with the same partition and lettering scheme. It won't work. Bootmgr.sys does not consult the BIOS for where the partitions are located. When you see an /Enum of the BCD and a particular line item like

    filedevice partition=D:

    is shown, it's really just a translation of the volume ID and offset. (If not using Ghost 11.5+ to clone your whole scheme) each of those line items has to be re-written (so that the underlying data is updated with the associated VolumeID and Partition Offset number (4 characters)) so that the BCD knows where the partitions actually are.

    For example, you may set the path to ramdisk options within your WinRE/PE bootloader {GUID} like this:

    BCDEdit /Store C:\Boot\BCD /Set {RandomGuidIDentifyingThePEBootLoader} osdevice ramdisk=[\Device\HardDisk0\Partition1]\SOURCES\BOOT.WIM,{ramdiskoptions}

    Note that "\Device\HardDisk0\Partition1" doesn't have to have a letter, but a later enum of the BCD (if the partition later acquires a letter) will show that letter (R in our example), or will change to whatever letter you change the partition to.

    So, as in the example above, this means that if you're applying a wim of the contents of each of your 3 partitions to a DISKPART partitioned drive (rather than relying on Ghost to adjust/automatically make the partitions) you'll have to write a BCDEdit script to address the BCD file adjusting any line in the BCD that has reference to a partition so that it updates the underlying data with the actual VolumeID and Partition Offset.

    We create all our source/final images in VMWare. If I take a ghost image of my master say... x86 image and ghost it to a second differently sized VM Hard Drive (retaining the size of the first 2 partitions), I can clear the contents of partition 1 & partition 3, add an X64 edition of WinRe to partition 1, and an X64 edition of Win 7 to partition 3, and my untouched BCD in bootable partition #2 will still function as expected with no adjustments. Ghost somehow deals with the VolumeID and Partition offset number. This means that I can just deal with formatting & re-applying a Win7 WIM to partition #3 of any machine our images are deployed to and expect the BOOT (BCD) to work without scripted adjustment.

    Wednesday, March 30, 2011 6:36 PM
  • Hi,

    My problem is this I have set the recovery partition usijng ReagentC.exe and it works fine. Only pboblem is if I formated my OS drive (C drive) recovery partition did not work.

    Any ideas_


    N.A.Malik
    Saturday, April 2, 2011 9:50 PM
  • Hi again.

     

    You don't need ReagentC.ece as such, although you do need to define a customaction which is recoveryenabled yes. This is what ReagentC.exe does i believe although I just do it manually and also add my own bootkey to OS or to the Recovery disk. Thus, when you reformat, the recovery disk becomes oprhaned. 

    You can avoid this by having your own scripts which rejuvenate the recoveryenabled link or when re-formatting OS. I do it by rebuilding the BCD with a script which re-defines a recoverysequence and my custom bootkeys.

    If you don't do it this way, you would need to for each install, inject a fixed GUID for your OS whcih becomes nstalled again, at least the primary OS if you happen to also have an xp or install another 7 for testing say.

    But, Itried telling you before you don't need Regaentc.exe so I guess you wish to do it differently. Fair enough.

     

    Tp Paul, yes the boot DB (BCD) is the only required file for proper definition, although I also make sure we remove winre from installing into Recovery folder during deployment.

     

    Although, it takes only an adjustment in either the batch or with bcdedit to change the file name of your winre.wiim :)

    I call it hive

     

    toodles

    and yes Malik, boot into your winre.. if it no longer works you will have to just boot into the disc then, use bootrec /rebuildbcd for example and define your recovery sequence and recovery enabled as you can see in eg. Paul's bcd example.

     

    If you wish this to be automatically done during a re-format, then you have ot pay more attention to what I said above a while ago, and define some simple scripts which automate the recoverysequence bcd entires during a re-install.

     

    hint: You can use Run once commands to do so or write a manual program in the winre, which you can launch for re-formats etc.

     

    Monday, April 4, 2011 2:29 AM
  • Hi, Good to see you again

    Could you please elaborate more on the following:

    hint: You can use Run once commands to do so or write a manual program in the winre, which you can launch for re-formats etc.

    Before I was trying to make recovery partition work, and it worked ... now if I formate / delete my OS drive boot key did not work. I want to avoid this. I know I can recovery it by using the recovery /repair disk, but this is not applicable in my senario.

    Thanks again for your support.


    N.A.Malik
    Wednesday, April 6, 2011 5:55 AM
  • Hi, Good to see you again

    Could you please elaborate more on the following:

    hint: You can use Run once commands to do so or write a manual program in the winre, which you can launch for re-formats etc.

    Before I was trying to make recovery partition work, and it worked ... now if I formate / delete my OS drive boot key did not work. I want to avoid this. I know I can recovery it by using the recovery /repair disk, but this is not applicable in my senario.

    Thanks again for your support.


    N.A.Malik

    I think Solar69 alluded to the solution to the problem you're having.   When  you kill the OS partition, then the BCD entry (Windows Boot Loader Entry GUID) referencing it (which also references the recovery sequence GUID for F8) no longer works. (If WinRE.wim was on your OS partition then it got blown away too, but I assume you've relocated it.)   So the answer here would be to have a way to directly call your WinRE.wim etc.  This can be done as Solar69 indicated by adding a custom boot-key that references the WinRE Windows Boot Loader entry directly.  I have not yet done that in our images, so I don't have an example, but there looks like enough info in the threads above to figure out how to add one.
    Tuesday, April 19, 2011 3:54 PM
  • Hi Friends !

    I will be appreciate if someone can provide me step to step guide / assistance to do this?

    OR refer me to some articles/KBs.

    Thank you all

    /Malik


    N.A.Malik
    Tuesday, April 19, 2011 5:34 PM
  • 1. Do you know the GUID for your recovery sequence?   (Go back & read Solaris69's posts as he shows how to find it if you don't know what it is, otherwise you can manually setup your own as I did in my post.)

    2. Are you comfortable editing the various types of boot entries?  Get some practice editing the various entries in a VM if not, or even just a copy of a BCD (Copy the BOOT folder somwhere & edit that).  You might be more comfortable looking at the BCD with VisualBCD for a while rather than BCDEdit.  http://boyans.my3gb.com/

    3. Solaris69 show's how to set a custom boot key "F3" to select the boot entry of choice. In this case the GUID referencing the WinRE boot entry:

    <quote>

    bcdedit /enum {default} (get guid for recovery sequence created by rebuildbcd)

    bcdedit /set {bootmgr} custom:0x0000000054000001 {recovery sequence GUID found in the last step}

    bcdedit /set {bootmgr} customactions 0x000100003d000001 0x0000000054000001 (as an example, makes F3 your custom bootkey)

    </quote>

     

    Good luck.

    Tuesday, April 19, 2011 6:55 PM
  • I'm curious. Why not just use Ghost, or an imaging software or hardware imaging solution and not even bother with the complicated mess of trying to use a Microsoft solution to restore/deploy an image?

     

    Wednesday, April 20, 2011 2:09 PM
  • This thread isn't necessarily about an imaging solution, although that's a possible outcome of separating WinRE onto its own partition. Essentially it's about how to use the built in windows boot loader to point to a bootable location on another partition which is used for some sort of rescue operations including imaging.  Using WinRE as the shell comes with the advantage of being able to set it so that one has to authenticate to a local administrator account on the OS partition before WinRe will present the user with rescue options.

    Examples:

    1. You've bitlockered the OS volume but need to perform an operation on it of some sort.

    2. You've got a malware infection and it's convenient to have your techs be able to F8 into an offline rescue environment.

    3. You've set up your offline PE with a scripted alternate shell that will automatically re-image the 3rd (os) partition while using USMT on the user's data and resetting the OS as the default partition after re-imaging. This automatic re-imaging could be initiated by a management tool built into the OS while the OS is online for an automated PC refresh for any needed reason....

    4, You want your F8 rescue environment to be Ubuntu...

    Deploiyment:  Ghost is just fine but it isn't free. (We use it for our initial image deploy.)  You can't compress multiple department images into one small image with it.  Ghost doesn't come with any tools that I'm aware of to automate post-imaging task sequences. Ghost doesn't come with a user-state-migration tool.

    Thursday, April 21, 2011 1:51 PM
  • 1. Do you know the GUID for your recovery sequence?   (Go back & read Solaris69's posts as he shows how to find it if you don't know what it is, otherwise you can manually setup your own as I did in my post.)

    2. Are you comfortable editing the various types of boot entries?  Get some practice editing the various entries in a VM if not, or even just a copy of a BCD (Copy the BOOT folder somwhere & edit that).  You might be more comfortable looking at the BCD with VisualBCD for a while rather than BCDEdit.  http://boyans.my3gb.com/

    3. Solaris69 show's how to set a custom boot key "F3" to select the boot entry of choice. In this case the GUID referencing the WinRE boot entry:

    <quote>

    bcdedit /enum {default} (get guid for recovery sequence created by rebuildbcd)

    bcdedit /set {bootmgr} custom:0x0000000054000001 {recovery sequence GUID found in the last step}

    bcdedit /set {bootmgr} customactions 0x000100003d000001 0x0000000054000001 (as an example, makes F3 your custom bootkey)

    </quote>

     

    Good luck.


    Hi,

    I will check it out and get back  here.


    N.A.Malik
    Friday, April 22, 2011 4:23 PM
  • Hi again.

     

    You don't need ReagentC.ece as such, although you do need to define a customaction which is recoveryenabled yes. This is what ReagentC.exe does i believe although I just do it manually and also add my own bootkey to OS or to the Recovery disk. Thus, when you reformat, the recovery disk becomes oprhaned. 

    You can avoid this by having your own scripts which rejuvenate the recoveryenabled link or when re-formatting OS. I do it by rebuilding the BCD with a script which re-defines a recoverysequence and my custom bootkeys.

    If you don't do it this way, you would need to for each install, inject a fixed GUID for your OS whcih becomes nstalled again, at least the primary OS if you happen to also have an xp or install another 7 for testing say.

    But, Itried telling you before you don't need Regaentc.exe so I guess you wish to do it differently. Fair enough.

     

    Tp Paul, yes the boot DB (BCD) is the only required file for proper definition, although I also make sure we remove winre from installing into Recovery folder during deployment.

     

    Although, it takes only an adjustment in either the batch or with bcdedit to change the file name of your winre.wiim :)

    I call it hive

     

    toodles

    and yes Malik, boot into your winre.. if it no longer works you will have to just boot into the disc then, use bootrec /rebuildbcd for example and define your recovery sequence and recovery enabled as you can see in eg. Paul's bcd example.

     

    If you wish this to be automatically done during a re-format, then you have ot pay more attention to what I said above a while ago, and define some simple scripts which automate the recoverysequence bcd entires during a re-install.

     

    hint: You can use Run once commands to do so or write a manual program in the winre, which you can launch for re-formats etc.

     


    Hi Solar69

    I am going to investigate this with GUID and will get back here with my findings.


    N.A.Malik
    Friday, April 22, 2011 4:24 PM
  • I spent a long time discerning which things were relevant where; it is very contradictory at times. However, I ended with my scripts doing what I needed. Turned out, they are pretty much what setautofailover.cmd covers. 

    Having the script to look up would of saved me 1.5 months of reading but then again, I wouldn't perhaps learn so much from trial and error.

     

    The truth is, all solutions more or less are in that script. If you have it, use it (adjust to windows 7) and there is no need for ReagentC.exe *at all* (well, before I say that too strongly, I have made scripts which will identify one OS as {default} is several Win OS are installed).

    Also, In the odd chance you would like to use a custom bootkey, look up custom bootstrapping. 

    Ok , I read your post now.. sure I wil help ya.

    Note! On default winre solutions or moving it out to another partition ReagentC is the way to go I guess, however:

     

    A. Custom solution? Forget ReagentC.exe. bootkey we will sort out in a sec.

     

    B. wim or flat image? you didn't answer me. let us assume wim for those lean neat lil things.

     

    Scenario: Single win 7 OS, D0P2, OEM SYSTEM BUILDERS aka WIndows OPK, *not* AIK (however, it is a simple scripting task to do the setauto but requires a little insight and study into the bcd/bootmanager)

     

    (D0P1) partition R: 0x27,active,  size= sufficient for winre.wim + boot files (boot.sdi + boot\* + bootmgr) + install.wim + any-other-bloated-stuff-you-wish

    R:\winre.wim // custom winpe w/ srt + custom tool/scripts-whatever

    R:\wherever-I-want-on-R\install.wim // generalized-for-oobe 

    D0P2: C:\ apply.wim

    del R:\boot\BCD

    bootrec /rebuildbcd

    setautofailover /wim /target R:

    DOE.. oh hang on... custom bootkey eh? -> 

    bcdedit /enum {default} (get guid for recovery sequence created by rebuildbcd)

    bcdedit /set {bootmgr} custom:0x0000000054000001 {recovery sequence from above}

    bcdedit /set {bootmgr} customactions 0x000100003d000001 0x0000000054000001 (as an example, makes F3 your custom bootkey)

    double done..

    (you might need to wait to hide the R letter till you have done this; I don't remember, I worked on that a lot last year).

     

    enjoy

    Please propose as answer if it sort syou out, as it will help the poor souls like us in the long run :)


    Hi,

    I checked the following link:

    http://support.microsoft.com/kb/927392 

    But I am still confused how and where I can use the above commands you mentioned?

     

    (D0P1) partition R: 0x27,active, size= sufficient for winre.wim + boot files (boot.sdi + boot\* + bootmgr) + install.wim + any-other-bloated-stuff-you-wish

    R:\winre.wim // custom winpe w/ srt + custom tool/scripts-whatever

    R:\wherever-I-want-on-R\install.wim // generalized-for-oobe

    D0P2: C:\ apply.wim

    del R:\boot\BCD

    bootrec /rebuildbcd

    setautofailover /wim /target R:

    DOE.. oh hang on... custom bootkey eh? ->

    bcdedit /enum {default} (get guid for recovery sequence created by rebuildbcd)

    bcdedit /set {bootmgr} custom:0x0000000054000001 {recovery sequence from above}

    bcdedit /set {bootmgr} customactions 0x000100003d000001 0x0000000054000001 (as an example, makes F3 your custom bootkey)

    double done..

    ----------------------- can you please assist me? ------------------------------------


    N.A.Malik
    Wednesday, April 27, 2011 6:50 AM
  • setautofailover /wim /target R:

     

    is not working, any more information?


    N.A.Malik
    Thursday, August 25, 2011 9:25 PM
  • setautofailover /wim /target R:

     

    is not working, any more information?


    N.A.Malik


    If you ouput the result of BCDEdit /enum all >> [drive:]\TextFile&Location.txt  what is the result?  Does the line referencing your WinRE.wim look correct? 

     

     e.g.  device ramdisk=[R:]\WINRE.WIM,{ramdiskoptions}

     Is boot.sdi in the root?   My preference is to use BCDEdit directlyas described above, that way I don't have to name my wim "WINRE.WIM" ... although I suppose I could edit SetAutoFailover.cmd...

    http://blogs.msdn.com/b/winre/archive/2007/01/12/how-to-install-winre-on-the-hard-disk.aspx

    Friday, August 26, 2011 2:30 AM
  • Hi,

    Thank you for the reply.

    You and Solar try to help me. but I guess things are more messed up for me.

    For example, if I follow Solar's post (he recommends using OPK, thats what I am using) and follow line by line steps, I cant find the

    xcopy /E /F ISO\Boot\*.* R: and also Setautofailover.cmd is not availbel (since I am using OPK for windows not for Vista )

     

    Initially I try standard Winre.WIM (extracted from OS install.wim) and late I try with WinPE and still here I was able to set the recovery partition. but if the OS drive is formated, recovery not work at all because its was relying on the OS partition. (I was using Reagentc.exe since I wasn't succedded with BCDEDIT). Also to follow the Solar steps, I booted the machine with Standard WinRE and go to the command prompt to run the BCDBOOT/rebuld etc, not no luck.                                     

    Can we proceed again with step by step instructions? When to boot the machine with WinPE and when with WinRE to execute the commands?

    I will appreciate you help and Solar assistance as well.

    /Malik


    N.A.Malik
    Saturday, August 27, 2011 9:43 PM
  • I realize that SetAutoFailover.cmd and ReagentC automate the generation of the boot profile, but I cannot tell you in depth how they work as I don't use them. I don't know how to explain them.  You're clearly trying to use these things to automate creating the boot profile, but in the process you're missing out on learning what a working bootloader (BCD) looks like.

    How many partitions are you using? (I'm using 3) 

    •      Partition 1 (Hidden type 27) contains enough space for my wim that I'm going to boot to and any other files I want.
    •      Partition 2 (System) contains the Windows boot loader  (with bootmgr.sys and the "BOOT" folder in the root)  It's 100mb (plenty big enought) 
    •      Partition 3 (My Windows OS  but NOT bootmgr.sys and NOT the BOOT folder)

    Where is your boot loader? What does the text output of the BCD instructions look like?

    It sounds like you're booting to partition 3 in this case because you lose your ability to get to the boot loader when you format your OS partition. So, this means that you've marked partition 3 as active with Diskpart. Whatever the active partition is, that's where the system will look for the boot loader when it's turned on. The MS bootloader consists of bootmgr.sys and the "BOOT" folder and contents. In my scheme above, partition 2 needs to be marked as active. The active partition is where the booting machinery will try to find a bootloader be it the MS bootloader, or GRUB, or LiLo, or whatever. So my machine starts, finds the bootloader on partition 2. It points to the appropriate items in partition 1 for PE/RE. When booting to the OS, it points to the appropriate items in partition 3. When creating the partitions using diskpart I assign partition 1 the letter "R", partition 2 the letter "C" and partition 3 the letter "D" Windows 7 (and vista) are designed to hide type 27 partitions and the system partition if it is not on the same partition as the OS. So when booting into the OS, the os re-labels partition 3 as "C" and hides partition 1 & 2.

    If you still want to use SetAutoFailover.Cmd post #16 has the script you can copy:  http://www.911cd.net/forums/index.php?showtopic=18995  But, again, I've never used it.  I know it assumes that your wim file is named WinRE.wim. 

    Monday, August 29, 2011 12:51 AM
  • Hi,

    Thank you for your reply. Yes, I dont want to use Setautofailover.cmd.

    Here I can try to explain what is my hard disk configuration is (same as in DiskPart)

    Diskpart

    Select disk 0
    clean
    create partition primary size=500 *I am using System drive to save boot config.data*
    format quick fs=ntfs label="System"
    assign letter=C
    active *I will point bcdboot.exe to use this >once imagex applied the image I use bcdboot.exe d:\windows /s c: *

    select disk 0
    create partition primary size=102400
    format quick fs=ntfs label="Windows"
    assign letter=D *so it will become C in OS"

    select disk 0
    create partition primary size=12288
    format quick fs=ntfs label="Recovery" *it contains Winre and Install.wim*
    assign letter=E

    ****so now I apply WIM image using : imagex /apply f:install.wim 1 d:
    bcdboot.exe d:\windows /s c: (to make the boot configuration data in System drive "C" )

    .....now i enable the recovery partition.....
    D:\windows\system32\Reagentc.exe /setreimage /path E:\Recovery\windowsRE /target D:\Windows /bootkey 8500

    It works fine, but if you format the OS drive then recovery partiton is going to be compromised.

    .///// Here I need your help/////


    N.A.Malik
    Saturday, September 3, 2011 10:38 PM