So i have a Windows 2016 Datacenter edition EC2 instance that was used for a SQL server and it’s killing me today with the INACCESSIBLE BOOT DEVICE blue screen.
Here’s me documenting what i tried to use to fix it and things that failed:
[Preparations]
- Take snapshot of the instance
- Stop instance
- Detach root volume
- Create a secondary windows instance, which i’ll be using for restore purposes and log on via RDP to it.
- Points 1 2 3 below are happening with the volume attached to the recovery instance, after which i detach it, and reattach it to the damaged instance, and boot it up, see if it works.
- Between each failed point 1 2 3 etc, i am detaching the volume from the damaged instance, and attaching it back to the rescue instance to try the next thing. Make sure you attach it as “/dev/sda1”, as that’s the root mount.
[Things that have failed so far]
1 – Attach it to the recovery instance, run CMD in an elevated prompt and run the command below(didn’t boot):
bcdedit /store D:\boot\bcd /set {default} bootstatuspolicy ignoreallfailures
2 – Use DISM to figure out if it was an automated windows update that installed some patch that bricked it (wasn’t)
dism /Image:D:\ /Get-Packages
3 – Installed EC2 Recovery tools and tried using the offline mode both to “fix boot issues” and “restore last known registry config” (neither worked)
4 – Running a SFC scan to see if there’s any integrity issues (didn’t work):
sfc /scannow /offwindir=d:\windows /offbootdir=d:\
5 – Attempt to rewrite the boot records with bcdedit:
bootsect /nt60 D: /mbr
D:\windows\system32\bcdboot.exe D:\Windows /s D:
bcdedit /store D:\Boot\BCD /set {default} device partition=D:
bcdedit /store D:\Boot\BCD /set {default} osdevice partition=D:
bcdedit /store D:\Boot\BCD /set {bootmgr} device partition=D:
6 – Re-create the boot partition:
bcdboot C:\Windows /S D: