Fix windows boot sector

1. Put the Windows 7 installation disc in the disc drive, and power cycle your PC after setting it to boot from CD Drive in BIOS.

2. Press a any key when you are prompted & select [language, time, currency, keyboard etc.] & click Next . Select Repair Your Computer option in the dialog window.

3. In the ‘System Recovery Options’ window Click the 1st Option Startup Repair and let it do what it wants to do, but in my case it didn’t solve the problem so I went to the next step.

4. In the ‘System Recovery Options’ dialog box, go to the last option i.e. Command Prompt .

5. Once in the command prompt (X:\Sources> ), type exactly the following commands in the same sequence

bcdedit /export C:\BCD_Backup
C:
CD Boot
Attrib bcd –s –h –r
ren c:\boot\bcd bcd.old
bootrec /RebuildBcd

then it said

“Scanning all disks for windows installations.

Please wait, since this may take a while…

Successfully scanned windows installations: 1

[1] C:\windows

Add installations to boot list? Yes(y)/No(N)/All(A) : “

I pressed ‘Y’ as there was only one instance of windows installation. Then it said The operation completed successfully.

6. Next entred the following command bootrec /fixmbr It said The operation completed successfully.

7. Next entred the following command bootrec /FixBoot Again It said The operation completed successfully.

8. Set the BIOS again to boot from the HDD and reboot.

Added info for UEFI

Source (stackoverflow)

Boot from a UEFI Windows 8 recovery disk (CD/DVD/USB) – the automated recovery process may not find the correct Windows partition, and adding it to BCD settings could make it boot unreliably. Example; getting BCDEDIT to find and launch the Windows partition may cause it to refuse to cold boot, or it will not “keep” the settings after a 2nd reboot or power off.

Go into the Advanced options and run the Command Prompt.

Enter diskpart to use the DiskPart tool to ensure you have all the right partitions and to identify your EFI partition – the key thing here is that your EFI partition is formatted as FAT32:

DISKPART> sel disk 0

Disk 0 is now the selected disk.

DISKPART> list vol

Volume ### Ltr Label Fs Type Size Status Info
———- — ———– —– ———- ——- ——— ——–
Volume 0 E DVD-ROM 0 B No Media
Volume 1 C NTFS Partition 195 GB Healthy Boot
Volume 2 WINRE NTFS Partition 400 MB Healthy Hidden
Volume 3 FAT32 Partition 260 MB Healthy System
Then assign a drive letter to the EFI partition:

DISKPART> sel vol 3

Volume 3 is the selected volume.

DISKPART> assign letter=b:

DiskPart successfully assigned the drive letter or mount point.
Exit DiskPart tool by entering exit and at the command prompt run the following:

cd /d b:\EFI\Microsoft\Boot\

bootrec /fixboot
Delete or rename the BCD file:

ren BCD BCD.bak
Use bcdboot.exe to recreate BCD store:

bcdboot c:\Windows /l en-gb /s b: /f ALL
The /f ALL parameter updates the BIOS settings including UEFI firmware/NVRAM, /l en-gb is to localise for UK/GB locale. The localisation defaults to US English, or use en-US.

Reboot and cross your fingers.

[EDIT]

To re-enable Hyper-V, I also had to run the following:

bcdedit /set {default} hypervisorlaunchtype Auto
bcdedit /set {default} nx OptIn

Leave a Reply

Your email address will not be published. Required fields are marked *