I have corrupted the registry on my Amazon EC2 Windows instance. Is there a way to restore my registry hive?

A corrupt Windows registry can cause your instance to freeze, slow down, restart randomly, or become unusable.

You can use RegBack to restore the Windows registry. Even without installed backup utilities, Windows automatically makes its own backup of the registry here: C:\Windows\System32\config\RegBack

1.    Stop the inaccessible instance.
Note: If this instance has an instance-store volume, ensure you have backed up the contents of the volume before stopping it.

2.    After the instance is stopped, create an EBS-backed Amazon Machine Image (AMI) by selecting the instance in the EC2 console, choose Actions from the top navigation pane, choose Image, and then choose Create Image.

3.    Launch a fresh Windows Server 2008 R2 instance in the same AWS region and availability zone as the inaccessible instance. You’ll use this new instance as the “recovery” instance, and you can terminate it after your corrupted registry is restored.
Note: If your recovery instance is based on the same AMI that the original instance is based on, and the operating system is later than Windows Server 2003, you must repair the disk signature collision. AWS recommends that you to select a different Windows AMI for the temporary instance.

4.    Detach the boot volume of the corrupt instance.

5.    Attach the volume to the recovery instance using the default settings in the EC2 console.

6.    Connect to the recovery instance through Remote Desktop Protocol (RDP).

7.    Make the attached volume available to use.

8.    Open a Windows Command Prompt window in administrator mode and run the following command:

xcopy d:\\windows\\system32\\config\\regback d:\\windows\\system32\\config /y

Note: This copies the files in the d:\\windows\\system32\\config\\regback directory to the d:\\windows\\system32\\config\ folder, overwriting the existing files.

9.    Bring the disk offline from Disk Manager and detach the secondary volume from the recovery instance.

10.   Attach the volume to the corrupt instance, using the device mapping /dev/sda1.

11.   Start the corrupt instance by using the EC2 console.

12.   Wait for the instance to boot and pass status checks. You can monitor the process using the Instance Console Output.
Note: To confirm that Windows booted successfully on your instance, check for the message “Windows is Ready to use” in the Instance Console Output.

13.   If your instance has finished passing status checks and you are able to connect to it by using RDP, you can safely delete the temporary instance (from step 3) to avoid unexpected charges.

regback, registry hive, restore registry hive, Windows EC2, instance, registry


Did this page help you? Yes | No

Back to the AWS Support Knowledge Center

Need help? Visit the AWS Support Center

Published: 2016-12-05