Moving to a secure boot UEFI is a great option. However, in some cases, the conversion from Legacy to UEFI using mbr2gpt fails and your computer is stuck in a boot loop.
You will need a Windows 10 iso. Burn it on a disk, or use software to write it to a USB. (Link to Microsoft)
Boot into the windows install, click next on the first page and then select Repair your computer.
On the next page click on Advanced options and then Command Prompt.
In the Command Prompt window, type diskpart. After that, type list disk. The command will display all the mounted disks on the system.
Type in Sel disk # (in my case and most commonly it’s 0) to select the disk that has Windows installed on it. After that, type List vol and look for a FAT32 volume with no letter.
Therefore, type: Sel vol 3 to select the appropriate volume that windows used for the BCD (Boot Configuration Data) file.
Next, we need to assign a letter to the volume to be able to move all the files we need to it. Type in assign letter=t to set that.
Type exit to go back in command prompt, we need to format the drive we just attached by typing: format T: /FS:FAT32. Select Yes when prompted.
Optional steps in case you get a permission denied error
In the case that you get permission denied because the drive is read-only, go back into diskpart.
Type sel disk # (your disk number), after that sel vol # (your FAT32 volume). In addition, we need to now type attributes vol clear readonly .
After that, type exit and try the format command again.
After the drive is formated, we need to recreate all the necessary file for Windows to boot again by typing: bcdboot c:\windows /s T: /f UEFI
In addition, start DiskPart again to remove the letter from the drive we added in the steps above. Type in diskpart, after it loads type remove letter=t.
Type exit twice to restart your computer.
Working in IT for more than 10 years now, I’ve run into problems that are very specific to network and system administration.