UEFI boot enabling on a preinstalled OS

revoconner

Honorable
Nov 20, 2013
37
0
10,530
During installation of windows 8 I disabled UEFI boot and installed as legacy boot. Now i wanna enable UEFI boot any idea how?
I have a intel board with visual bios 2.0, i have enabled uefi boot but it says no devices.
 

revoconner

Honorable
Nov 20, 2013
37
0
10,530
Since no one could give an answer I find the solution myself and decided to get it here in case anyone else wants it.

Convert a Windows 7/8 BIOS (MBR) installation to UEFI (GPT) without moving, copying or loosing data.
Prerequisites:

A computer able to boot UEFI. You can check that on your computer manufacturer. Also in the BIOS setup should display UEFI boot options.
Windows 7/8 x64
A computer able to boot from USB or memory card (only for this process).
A pen drive or memory card with at least 4GB. Or a Windows installation disc.
BitLocker TURNED OFF. If you have BitLocker enabled on your hard drive, it will have to be TOTALLY turned off for this procedure. After the procedure is performed, BitLocker can be turned on again.
A "standard" Windows installation. This means, the disk where Windows is installed has to contain the System Partition (something above 200MB) and then the OS Partition. This is because Windows will require some space at the beginning of the disk to create the new boot partitions, and we will use the previous System Partition. To verify this you can follow Instructions steps 8 through 11. If there isn't enough space at the beginning (the primary small partition is under 200MB), partitions may be resized using some tool like Easus Partition Master or such. Don't continue the operation until you have done so because you may not be able to finish it.


Warnings:

As usually, I won't take any responsibilities if data is being lost, your computer doesn't boot up anymore, or some gremlins attack your family. You are doing this at your own responsibility. :) This is not a documented feature at all.
After this procedure, old versions of Windows probable won't be able to boot from this disk drive since it has to be converted to GPT.

Recommendations:

Is VERY recommended for you to perform a backup of your data. If you have a second disk drive big enough, you can simply create a system image and able to recover the full installation as it was before you started this procedure if anything goes wrong.
Download this guide to another computer or print it out, since you will have to make some operations without Windows working.
These procedures are likely to render your on-board Recovery partition unusable. Thus, a backup of your Recovery partition onto a USB device is highly recommended if your PC came with Win 8 preinstalled or you don't have your Windows installation media. Once created, this bootable Recovery USB can optionally be substituted for the System Repair disc in the steps below. For a creating the Recovery USB, see the following: (http://www.techrepublic.com/blog/window-on-windows/create-a-recovery-drive-in-windows-8/7261

Notes:

Steps were performed on Windows 8. Some steps in Windows 7 may have different menus, but the options and results are the same.
Instructions:

Create a system repair disc http://windows.microsoft.com/en-US/windows7/Create-a-system-repair-disc You can skip this step if you have a Windows installation media. Is a good measure to reboot and verify you can start your system from this disc.
Identify which disk you want to convert (usually is #0). This can be done by looking at the number in the Windows Disk Management.

Download gptgen from here http://sourceforge.net/projects/gptgen This tool will allow you to convert your MBR disc to GPT with the data included.
ATTENTION: After this step, you won't be able to boot into Windows the whole process is completed. There is no turning back!
Unzip gptgen and then run CMD with admin privileges. (replace the 0 with the identified disk number).
This will result in a BSOD shortly after and it's to be expected:
gptgen.exe -w \\.\physicaldrive0



Boot using your Windows installation or previously generated system repair disc.
Choose language and preferences, and then select Repair Your Computer -> Troubleshoot -> Advanced options -> Command Prompt

We will need the disk partitioning tool. With this, we will recreate the boot partitions. Type:
diskpart

Identify the boot disk where Windows is located, typing:

list disk

Something like this should appear:

Disk ### Status Size Free Dyn Gpt
-------- ------------- ------- ------- --- ---
* Disk 0 Online 128 GB 0 B *


Once identified, select the disk (replace with the correct number):
select disk 0

Verify the partitions:
list partition
Something similar at the info below should appear.

Partition ### Type Size Offset
------------- ---------------- ------- -------
Partition 1 Primary 350 MB 1024 KB
Partition 2 Primary 126 GB 350 MB


Delete the previous system partition:

select partition 1
delete partition


Create the new boot partition, Microsoft reserved partition:
create partition EFI size=100 offset=1
format quick fs=fat32 label="System"
assign letter=S
create partition msr size=128 offset=103424
If you list the partitions again, you should have ended up with 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

Ensure that your Windows installation is mounted, replacing 3 with the volume number of the Windows installation (usually 1):
list volume
select volume 3
assign letter=C

Exit diskpart:
exit

Generate boot partition data, replacing C: with the letter of the Windows installation (usually C:):
bcdboot c:\windows /s s: /f UEFI
Restart your computer!

Final tasks:

BitLocker can be enabled again.
If Hyper-V was installed before this procedure, it may not work. To fix it, just remove the feature, restart your PC and then enable it again. No VM is lost.
In Windows 8 and if the computer supports it, Windows 8 Secure Boot can be enabled inside the computer BIOS. This will improve the computer security by some degree and maybe reduce boot time. Refer to information from your system manufacturer and/or http://communities.intel.com/community/vproexpert/blog/2012/06/26/microsoft-windows-8--enabling-secure-boot [This link is external to TechNet Wiki. It will open in a new window.]