Tuesday 20 February 2018

How to handle system reserved partition while performing reverse imaging - Citrix


!!!Consult your Citrix Partner/Support before proceeding!!!

Applicable Products
·         Provisioning Services

Instructions
Part 1 - Boot master target device from vDisk
1.     To allow access to the System Reserved partition, use Disk Management to assign a drive letter to it:
1.     Press WinKey+R (press and hold the Windows key and press R) to open the Run dialog.
2.     Type diskmgmt.msc into the Open box and click the OK button. The Disk Management window will be displayed (may take several seconds to scan the drives).
3.     Right-click on the System Reserved partition and select Change Drive Letter and Paths... from the pop-up menu.
Note: If the System Reserved partition is hidden the label won't be shown (it will be blank) and the option to change the drive letter will be disabled. The partition will most likely be displayed as "100 MB Healthy (Active, Primary Partition)" (the size shown will vary depending on the version of Windows) and be located at the start of the drive, prior to the Windows partition. 
4.     Click the Add button.
5.     An available drive letter will automatically be selected. You can keep it or select a different one. When finished, click the OK button. In this example, E: will be assigned to the System Reserved partition.
6.     Leave the Disk Management window open (it will be needed again in later steps).
 
1.     Press WinKey+E to open Explorer.
2.     Make note of the drive letter assigned to the System Reserved partition and the letter assigned to the Windows partition. In this example, C: is the Windows partition and E:is the System Reserved (booting) partition.

Note: It's a good idea to give the partitions meaningful labels. This can help you tell them apart more easily. For example, the label for the Windows 7 partition might beWin7. This can be especially helpful when trying to tell which partition is which from the Command Prompt.
3.     Close Explorer once you've determined the drive letter assignments.
4.     Start an Administrator mode Command Prompt. To do this in Windows 7, click on theStart button, then All Programs, then Accessories. Right-click on the Command Prompt item and select Run as administrator from the pop-up menu. In Windows 8.x/10, press WinKey+X (or right-click the lower-left corner of the Desktop) and clickCommand Prompt (Admin) on the pop-up menu.
5.       Windows 8.x/10 only: Disable the Windows Recovery Environment (WinRE). Run the following command:
reagentc /disable

Verify that the 
winre.wim file was correctly moved to theC:\Windows\System32\Recovery folder by running the following command (if your Windows partition is not C:, use the letter that's correct for your system). You should see the file in the directory listing.
dir /a C:\Windows\System32\Recovery

Note: This step is necessary because WinRE also needs to be moved from the System Reserved partition to the Windows partition. Leaving WinRE enabled will result in a broken/unusable WinRE after this procedure has completed. If the above command does not report success, you may need to manually copy the WinRE files (in the hidden \Recovery\{GUID} or \Recovery\WindowsRE folder on the System Reserved partition) to an alternate location.
6.     Unload the BCD registry hive by running the following command:
reg  unload  HKLM\BCD00000000
7.     Copy the bootmgr file from the System Reserved (booting) partition to the Windows partition (make sure to use the drive letters as assigned on your computer). Run the following command:
robocopy  e:\  c:\  bootmgr
8.     Copy the Boot folder from the System Reserved (booting) partition to the Windows partition. Run the following command:
robocopy  e:\Boot  C:\Boot  /s
9.     The booting files have now been copied. If you wish to verify that they were copied correctly, run the following command (make sure to use the drive letter of the Windows partition):
dir  c:\  /ah

If the 
bootmgr file and the Boot folder show up in the list, the procedure was successful.
10.  To update the copied BCD file so it will boot correctly, run the following command:
bcdedit  /store  c:\boot\bcd  /set  {bootmgr}  device  partition=C:

Update the Memory Diagnostic entry by running the following command:
bcdedit  /store  c:\boot\bcd  /set  {memdiag}  device  partition=C:

Note: If your Windows partition is assigned a letter other than C:, make sure to use that value instead.

Note: If you are using BootIt BM, you can use the BCD Edit feature to update the BCD file instead of running the above commands. See Part 2 - Step 3 for details.
11.  Close the Command Prompt window.
12.  Remove the drive letter assignment from the System Reserved partition and set the Windows partition as the Active (booting) partition.
1.     Return to Disk Management (reopen, if not left open in Step 2).
2.     Right-click on the System Reserved partition and select Change Drive Letter and Paths... from the pop-up menu.
3.     Click the Remove button.
4.     Click the Yes button to confirm the change.
5.     Right-click on the Windows partition (C:) and select Mark Partition as Active from the pop-up menu.
6.     Click the Yes button to confirm the change. You should see the Active tag move from the System Reserved partition to the Windows partition.
7.     Close the Disk Management window. 
13.  Windows should now be configured to boot properly from its own partition. Restart the computer.
Note: If you receive an error message upon booting, the boot sector of the Windows partition may need to be repaired.
14.    Windows 8.x/10 only: Enable the Windows Recovery Environment (WinRE). To do this, open an Administrator Command Prompt (if necessary, refer to instructions in Step 6) and run the following command:
reagentc /enable

The command should be successful if the previous disable was successful. 
Part 2 - Remove the System Reserved Partition
 
Note:  This part is optional. Removing the partition will only gain 100-500MB unallocated space. However, it will free up one primary partition slot.
Important:  Windows 8.x/10 users may wish to verify that the Windows Recovery Environment (WinRE) functions correctly from the Windows partition before deleting the System Reserved partition. If disabling and enabling WinRE (per Part 1 instructions) failed, the winre.wim file may exist only on the System Reserved partition (in the hidden \Recovery\{GUID} or \Recovery\WindowsRE folder). Deleting the partition in this case would result in losing the file (unless a backup image has been created or the files have been copied elsewhere).
Deleting the partition can be done from either Windows Disk Management or BootIt BM.
Using Disk Management:
1.     If Windows hasn't been rebooted since the completion of the Part 1 instructions, restart Windows. It should boot normally.
2.     Start Disk Management 
3.     Verify that the Windows partition is now tagged as both the System and the Activepartition. The System Reserved partition should just be tagged as Primary Partition.
4.     Right-click on the System Reserved partition.
5.     Select Delete Volume... from the pop-up menu.
6.     Click the Yes button to confirm the deletion.
The space used by the System Reserved partition should now be shown as Unallocated

No comments:

Post a Comment