Windows Server 2012 R2 Boot Repair

For UEFI-based servers:

diskpart
select disk 0
list partition
select partition X   (X = EFI system partition, typically ~100 MB, type "System")
assign letter=S
exit

Then repair BCD:

cd /d S:\EFI\Microsoft\Boot\
bootrec /fixboot
ren BCD BCD.old
bcdboot C:\Windows /s S: /f UEFI

| Error Message | Likely Cause | Immediate Action | | :--- | :--- | :--- | | 0xc0000225 | Missing or corrupt BCD | Rebuild BCD (Method 2) | | 0xc000000f | Boot selection failed | Run bootrec /rebuildbcd and bootmgr fix | | 0xc0000001 | Corrupt registry | Restore from RegBack (Method 4) | | Bootmgr is missing | Inactive system partition | In DiskPart, mark partition as active | | Inaccessible boot device | Faulty storage driver | Boot into Safe Mode or Last Known Good Configuration |


To repair a non-booting Server 2012 R2, you cannot rely on the OS itself. You will need:

Critical Note: Before attempting any repair, if your data is not backed up, consider removing the hard drive and connecting it to another system to copy critical data. Boot repair tools modify system partitions and can, in worst-case scenarios, lead to data loss. windows server 2012 r2 boot repair


This is the first line of defense. Windows Server 2012 R2 includes a built-in Startup Repair tool that automatically scans and fixes common boot issues.

Steps:

Outcome: If successful, the server will reboot normally. If it fails, you’ll see a message: "Startup Repair couldn’t repair your PC." Proceed to the next method.

Still in the Recovery Environment:

Tip: Startup Repair often fixes BCD errors, missing boot files, and some registry corruption. If it fails, proceed to manual methods below.


If your server uses BIOS/Legacy boot (not UEFI), run:

bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd

After each command, you should see a success message.


DISM /image:D:\ /cleanup-image /restorehealth /source:WIM:E:\Sources\Install.wim:1 /limitaccess

Note: Replace D: with the correct OS drive and E: with the drive letter of the installation media (mount the ISO if needed). For UEFI-based servers: diskpart select disk 0 list


A less common but tricky cause is a corrupt system registry hive. Windows keeps backups of the registry in the RegBack folder.

Steps:

cd d:\windows\system32\config
ren default default.old
ren sam sam.old
ren security security.old
ren software software.old
ren system system.old
copy d:\windows\system32\config\regback\default .
copy d:\windows\system32\config\regback\sam .
copy d:\windows\system32\config\regback\security .
copy d:\windows\system32\config\regback\software .
copy d:\windows\system32\config\regback\system .

This effectively rolls back your registry to a previous working state.