- Note down instance information such as instance ID, attached block devices (volumes), private IP address, associated elastic IP address
- Stop the instance
- Detach the root volume
- Attach the volume to repair instance
- Login to the repair instance
- Bring the disk online (eg: drive E)
- Run regedit
- Go to HKLM
- Select File->Load Hive
- Browse to E:\Windows\System32\config
- Open the hive you want (eg: SYSTEM)
- Pick a Key Name (eg: System_old)
- Make whatever changes you need
- Select the root of the hive you just loaded and modified (eg: HKLM\System_old)
- Select File->Unload Hive
- [Optional: Note if you are running SharePoint you may need to set Ec2SetComputerName to Disabled so the machine does not change names on restart]
- Take the disk offline
- You can now logoff or close the connection to the repair instance
- Detach the volume from the repair instance
- Attach volume to original instance
- Start instance
- You will also need reconfigure your security groups as the internal IP address would have changed and to reassociate the Elastic IP Address.
Now, I could just plop in the steps from Amazon EC2 instance not accessible via RDP after Windows Update and reboot into step 13 and I can repair those unresponsive instances. Note that when the hive is loaded, there won't be a CurrentControlSet. However, you can look at the value of HKLM\System_old\Select\Current to determine which ControlSet to use. See the knowledgebase article What are Control Sets? What is CurrentControlSet? for details.
No comments:
Post a Comment