I have a PC that can boot both Ubuntu and Win10, with Win10 pre-installed. While experimenting with bootable USB drives, I mistakenly formatted the Win boot partition on /dev/sda1, which is 524MB in size, causing me to lose access to my Windows system. Grub no longer lists it. Luckily, my user data and recovery partition are still intact. My goal now is to recreate the boot partition so that I can boot into Windows again without affecting the user-data partition.

I have already tried to repair the boot sector using a bootable Win10 USB drive and following a guide, but neither the automated option nor the command prompt option worked. I also attempted to use AOMEI, but encountered a “load driver failed” error message when trying to install it using Wine. Additionally, when trying to execute the “bootrec /fixboot” command prompt option mentioned in the guide, I received a “permission denied” message. I haven’t yet tried copying a boot sector from another working Win10 setup because I don’t have access to one.

Can someone please provide instructions on how to restore the boot sector safely?

Askify Moderator Edited question April 23, 2023