How to fix Boot Configuration Data (BCD) for Windows 8 EFI system

64,096

You have two partitions with boot flag and a bios_boot partition for grub which means you installed Ubuntu using BIOS mode!

On a GPT disk you should have only one EFI System Partition (ESP) which is used for storing all boot related files for Windows, Ubuntu e.t.c.

When installing / booting external media (CD, DVD, USB) use always EFI way of booting. This can be achived if you disable CSM/Legacy BIOS emulation in firmware.

In your case delete following partitions:(from GParted display)

sda3, sda7, sda8, sda9

Then you can boot from Windows installation DVD/USB (the UEFI way!!!), go to command prompt and use just

bcdboot drive_letter:\windows (drive_letter is drive where Windows is installed)

to repair UEFI booting.

You can also rewrite MBR to be in format "protected MBR" using

bootsect /nt60 all /force /mbr

Some explanations for repairing Windows BCD can be found here.

Then try rebooting to see if Windows boots OK.

After that you can install Ubuntu again but boot installation media the UEFI way !!!

Share:
64,096

Related videos on Youtube

Jai
Author by

Jai

Updated on September 18, 2022

Comments

  • Jai
    Jai almost 2 years

    I have Lenovo H530 Desktop which comes with Windows 8. I tried to install Ubuntu on the system and ended up messing something on my way. Current status is my system won't boot into either one of them and will just fall into GRUB shell on startup. I have a 64-bit system with EFI.

    enter image description here
    Partition structure in GParted on Ubuntu live CD

    enter image description here
    Partition structure in Windows 8 Repair command prompt

    I followed the instructions here as follows.

    DISKPART
    select disk 0
    select vol 2 --> EFI
    assign --> resulted in F: drive
    select vol 3 --> Windows8_OS drive (471 GB)
    assign --> resulted in G: drive
    exit
    cd /d F:\EFI\Microsoft\Boot\
    bootrec /fixboot
    ren BCD BCD.bak
    bcdboot G:\Windows /l en-us /s f: /f ALL
    

    Everything was success till here. But reboot still results in GRUB shell.

    I have also tried following links

    how-can-i-repair-the-windows-8-efi-bootloader

    windows-7-suddenly-wont-boot-reboot-and-select-proper-boot-device-or-insert-boot-media-in-selected-boot-device-and-press-any-key-repairing-the-windows-7-bootloader/

    but not much success. Any help to solve this would be really appreciated.

    EDIT 1: bcdedit results in error The boot configuration data store could not be opened. The requested system device cannot be found

    • Jai
      Jai over 10 years
      @tumchaaditya Unfortunately I dont have a recovery disk. I have Windows 8 installation CD that I am using to enter Repair mode.
    • tumchaaditya
      tumchaaditya over 10 years
      That should work. Is there something like startup recovery or startup configuration repair or something similar?
    • Jai
      Jai over 10 years
      @tumchaaditya Unfortunately I dont have them. Lenovo wants money to send them over.
    • tumchaaditya
      tumchaaditya over 10 years
      I meant in Windows 8 installation disk that you have!! See if it has startup repair option!
    • Jai
      Jai over 10 years
      @tumchaaditya All repair,refresh,reimage options fail. Including One Key Recovery that comes with Lenovo.