Page 1 of 1

How to repair the EFI bootloader on a GPT disk for Windows 7, 8, 8.1 and 10

Posted: 24 Jun 2021, 09:59
by daniele
ORIGINAL ARTICLES used as a reference:
https://www.ventoy.net/en/experience_rebuildBCD.html
https://support.novastor.com/hc/en-us/a ... 8-1-and-10


A couple of premises:
- GPT is not MBR:
- GPT doesn't need the boot partition to be active
- GPT doesn't want the command BOOTREC /FIXMBR to be executed

Second premise: EFI uses a boot partition which has a couple of characteristics
- the EFI partition must be FAT32 formatted
- it is, in general, a 500MB large in size

A typical scenario where the bootloader can't boot anymore a Windows EFI, could be after cloning the disk to another and resizing the partitions.

In order to repair the EFI bootloader in Windows 7-11:

If you do have the Installation Media :

1. Insert the Media (DVD/USB) in your PC and restart.

2. Boot from the media.

3. Select Repair Your Computer.

4. Select Troubleshoot.

5. Select Advanced Options.

6. Choose Command Prompt from the menu :

i. Type and run the command :

Code: Select all

    diskpart
ii. Type and run the command in order to identify main disk, where your O/S is installed (more precisely: where your EFI partition resides):

Code: Select all

    list disk
iii. Type and run the command :

Code: Select all

    sel disk <number>
iv. Type and run the command :

Code: Select all

   list vol


7. Verify that the EFI partition (EPS - EFI System Partition) is using the FAT32 file system and assign a drive letter to it (Assign a letter that isn't already in use.):

i. Type and run the command :

Code: Select all

        sel vol <number of volume>
ii. Type and run the command :

Code: Select all

        assign letter=<drive letter>:
iii. Type and run the command :

Code: Select all

        exit

8. In order to repair the boot record :

i. Type and run the command :

Code: Select all

        cd /d <drive letter>:\EFI\Microsoft\Boot\
ii. Type and run the command :

Code: Select all

        bootrec /FixBoot


Se compare errore ACCESS DENIED o altri errori, allora si rinomina il file BCD
1) cd S:\EFI\Microsoft\Boot
2) attrib bcd -h -r -s
3) ren BCD BCD.old
4) bootrec /rebuildbcd
Se l'operazioneha successo: riavviare il computer


If you don't have the Installation Media :


1. Restart your PC

2. Tap rapidly on the <F8> key once the PC has turned on, but before the Windows Splash Screen appears.

Please be aware this may take several attempts. The timing for this option was shortened significantly from that in Windows 7.

3. Select Repair your computer from the menu that appears.

4. Select Command Prompt from the Advanced Options tab in the Troubleshoot screen :

i. Type and run the command :

Code: Select all

        diskpart
ii. Type and run the command in order to identify main disk, where your O/S is installed (more precisely: where your EFI partition resides):

Code: Select all

    list disk
ii. Type and run the command :

Code: Select all

        sel disk <disk_number>
iii. Type and run the command :

Code: Select all

        list vol
5. Verify that the EFI partition (EPS - EFI System Partition) is using the FAT32 file system and assign a drive letter to it (Assign a letter that isn't already in use.):

i. Type and run the command :

Code: Select all

        sel vol <number of volume>
ii. Type and run the command :

Code: Select all

        assign letter=<drive letter>:
iii. Type and run the command :

Code: Select all

        exit
6. In order to repair the boot record :

i. Type and run the command :

Code: Select all

        cd /d <drive letter>:\EFI\Microsoft\Boot\
ii. Type and run the command :

Code: Select all

        bootrec /FixBoot
The next step is the same across all the operating systems at this point :

1. Rebuild the BCD store

2. First run the command below to backup the old BCD :

Code: Select all

    ren BCD BCD.old
3. Now recreate it using this command :

Code: Select all

    bcdboot c:\Windows /l en-us /s <boot letter>: All
Note: If you are creating boot entries on an attached USB Flash or other external drive add /f between the : and the ALL. Please remember that the <boot letter> is replaced with whatever the letter of the drive you are booting from is. (ie. C:\, D:\)