Changing Windows installation from BIOS to UEFI

I’ve recently re-imaged a Lenovo Yoga 14, unfortunately i couldn’t get it  boot using UEFI from our SCCM server.  I changed the UEFI to boot legacy and booted from a USB drive, which picked up the advertised deployment from the SCCM server. I needed to be able to boot UEFI so that once i restored the original image it would boot without a problem.

Pre-Requsites:

Windows Installation/Recovery media (USB, or DVD) Instructions on creating that can be found here

GPTGen

Once you have your recovery media, restart your computer/laptop and ensure that you can actually boot from it.

Extract GPTGen to somewhere simple like “c:\GPTGen”

Press the “Windows Key” + “X” at the same time, and select “Command Prompt (Admin)” (or press “A”) If UAC is enabled select yes to open the command prompt.

ctrl+x

WANRING:

WARNING !!From this point, until all the steps are completed you are left without a bootable computer!!

The next step **may** cause your computer to Bluescreen, mine did not, but this is expected behaviour.

cd c:\GPTGen

gptgen.exe -w \\.\physicaldrive0

Recovery Media Boot.

Boot using your recovery media and select Repair your computer > Troubleshoot > Advanced > Command Prompt.

From the Command Prompt we will identify the disk

Identify the disk you want to convert by running disk part. (usually this is disk 0)

Disk Part

list disk

list disk Convert to UEFI

Once you have identified the disk you need to select it:

Select disk X (replace X with the identified disk number)

you should see something like this:

Partition ### Type Size Offset

————- —————- ——- ——-

Partition 1 Primary 350 MB 1024 KB

Partition 2 Primary 126 GB 350 MB

When you installed windows it would have created a system partition (around 350Mb) this needs to be deleted.

select partition 1

delete partition

Now you need to create a new boot partiton

Create Partition EFI size=100 offset=1

Format quick fs=fat32 Label=”system”

Assign Letter=S

Create Partition MSR Size=128 Offset=103424

you can check that your partitions have been created by listing the partitions again.

List Partition

you should now see something like this:

Partition ### Type Size Offset

————- —————- ——- ——-

Partition 1 System 100 MB 1024 KB

Partition 2 Reserved 128 MB 101 MB

Partition 3 Primary 126 GB 229 MB

You now need to assign a drive letter to windows (replace “X” on select volume with the identified windows volume from “List Volume” below.

List Volume

select volume x

assign letter=C

exit (to exit diskpart)

Creating the boot partition within UEFI:

bcdboot c:\windows /s s: /f UEFI

Now its time to hope for the best and reboot your computer.

 

 

Let me know what you think...