So I have tried to install CentOS on a laptop with existing Windows 10, after freeing some space by shrinking Windows parttion inside Windows. But, while it did boot up, it moved the system no non-EFI and garbled the Windows boot.

I do have Windows 10 installation media now. So I tried:

bootrec /fixmbr - succeeded

bootrec /scanos - finds 0 windows instalations?? Despite the Windows partition being perfectly readable.

bootrec /fixboot - access is denied?! Even after reformatting the EFI system partition.

bcdboot C:\windows /s N: /f UEFI - success. But boot is not fixed. (N is where I mount the EFI system drive)

So I renamed N:\EFI\Microsoft\Boot\BCD to BCD.old and did

bootrec /rebuildbcd

This did find the Windows installation successfully. But the boot is still not working!

Startup Repair from the installation media also fails.

I found that the installer created a second EFI style partition (but never marked it System). I tried creating BCD on that too, then I deleted the partition. Now I only have the original EFI partition with newly created BCD for the Windows I have, marked as System in diskpart. It still will not boot!

Moreover, after deleting the partition I tried to switch to Legacy First boot. Parted shows the EFI system partition as "boot" so I tried to create boot files on it also for BIOS:

bcdboot C:\windows /s N: /f UEFI

Still no boot!

I am totally baffled at this now. What can I do to get Windows back? I don't care if Linux boots - i can do a new install (probably a different distro) after I fix Windows.

1 Answer 1


I have eventually found the solution. It is pretty non-trivial. Namely, I ran gdisk under a Linux system (booted from USB) and there used the v command. The result was:

Command (? for help): v

Warning: The 0xEE protective partition in the MBR is marked as active. This is
technically a violation of the GPT specification, and can cause some EFIs to
ignore the disk, but it is required to boot from a GPT disk on some BIOS-based
computers. You can clear this flag by creating a fresh protective MBR using
the 'n' option on the experts' menu.

No problems found. 227331437 free sectors (108.4 GiB) available in 3
segments, the largest of which is 225280000 (107.4 GiB) in size.

Then I used e (expert mode), then n, then w (write out). Then rebooted and Windows fired up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.