Converting Windows BIOS installation to UEFI

Converting Windows BIOS installation to UEFI

There are several reasons to use UEFI instead of BIOS. I won't go into details regarding that. But there are some cases when you already have a fully functional Windows installation running on BIOS and you don't want to start all over again. Sadly, there are no tools that performs this job. And I found there is not too much documentation regarding how this can be performed either, or even how this should work. Since after some digging and trial-and-error I was able to perform the operation, I will post the instructions for anyone who needs it.

If you have any doubt, feel free to contact me. I will answer whatever (and whenever) I can.

Goal:

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

Prerequisites:

  1. A computer able to boot UEFI. You can check that on your computer manufacturer. Also in the BIOS setup should display UEFI boot options.
  2. Windows 7/8 x64 (I'm not sure if x86 supports it or how).
  3. A computer able to boot from USB or memory card (only for this process).
  4. A pen drive or memory card with at least 4GB. Or a Windows installation disc.
  5. 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.
  6. 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:

  1. 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.
  2. 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:

  1. 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.
  2. Download this guide to another computer or print it out, since you will have to make some operations without Windows working.
  3. 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:

  1. 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.
  2. Identify which disk you want to convert (usually is #0). This can be done by looking at the number in the Windows Disk Management.
  3. 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.
  4. 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 elevated 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
  5. Boot using your Windows installation or previously generated system repair disc.
  6. Choose language and preferences, and then select Repair Your Computer -> Troubleshoot -> Advanced options -> Command Prompt
  7. We will need the disk partitioning tool. With this, we will recreate the boot partitions. Type:
      diskpart
  8. 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        *
  9. Once identified, select the disk (replace with the correct number):
      select disk 0
  10. Verify the partitions:
      list partition
  11. 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
  12. Delete the previous system partition:
      select partition 1
      delete partition
  13. 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
  14. 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
  15. 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
  16. Exit diskpart:
      exit
  17. Generate boot partition data, replacing C: with the letter of the Windows installation (usually C:):
      bcdboot c:\windows /s s: /f UEFI
  18. Cross your fingers and then restart your computer!

Final tasks:

  1. BitLocker can be enabled again.
  2. 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.
  3. 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
Leave a Comment
  • Please add 6 and 5 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Carlos J S A edited Revision 5. Comment: Added note for MSR partitions under 200MB.

Page 1 of 1 (1 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • There is an Easier way!

    Use a Backup tool Make a backup of your current Win8 system, (i used Acronis, but Ghost and other should work.

    Using a bootup tool (acronis boot disk, or other usb/ODD startup tools) Format the disk in GDP.

    Then adjust your bios settings for UEIF Start-up.

    Install Fresh copy of Windows 8, or Windows 7* on the newly formatted Hard Drive.(Check the BIOs for a UEIF Startup option for your installation media there should be two boot options for your media now).

    After Windows has installed, Check Disk Manager to see that you have the 100mb EFI partition.

    Then use your backup tool to restore your original Windows installation over the new system. Making sure to uncheck any options for restoring the "MBR" .

    Bam ya done.

    *Like many people, i don't have a Windows 8 install disk, So i used a Windows 7, install disk, then used my Windows 8 install files to upgrade the newly installed Windows 7. This worked because the Windows 7 install disk was x64.

  • Make sure there is enough space before your main partition to create the two partitions in step 13. I had only 100MB and I got stuck there.

    I was able to shrink and move my main partition thanks to a live-CD I had lying around, and complete the instructions successfully.

  • Well, this command simply does not work in W7 x64, there is no such syntax:

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

    Ended up copying the EFI boot files by hand - 3.6 Recreate the Boot Configuration Data from

    gitorious.org/.../Windows_x64_BIOS_to_UEFI

    and while booted from Win7 x64 SP1 DVD (non SP1 DVD hanged on Dell Vostro 3560) I simply rebuild bcd with bcdedit /rebuildbcd

    Seb

  • Used this guide and worked perfectly despite some typo on step 4. Revised! :D I hope I helped others!

  • Regarding step 6 of Prerequisites:

    what should I do if I have Windows 8 installed at the disk as a 1 partition?

  • I got stuck at step 13 as well. Please make a note at the top of your guide that lists the minimum required size of the System Partition. You mention it's usually around 1GB. I am on a default Windows 7 Ultimate installation and it is 100MB. I had to do a system restore before I even finished your guide.

    Also, thanks for the info and your hard work!

  • Carlos J S A edited Revision 5. Comment: Added note for MSR partitions under 200MB.

  • @DarkKewlz: that would assume that you have third-party apps and enough additional storage. I never hard that scenario thus I wouldn't know if it works. But thanks for the tip.

    @_-TaLSoftware: Haven't find that scenario. I just added a note to avoid such issue. Thanks!

    @scerazy: thanks for the info on W7. Please feel free to edit and add info!

    @daniyo27: thanks for the revision!

    @rxulan: Are you sure you don't have a MSR partition? Anyway, you can "move" the Windows installation partition using some tool like Easus Partition Master (free) to create empty space at the beginning. Good luck!

    @Orkalass: I just added a note. I'm sorry for your troubles. Please notice that you can move the W8 partition using some tool like Easus Partition Master to create empty space at the beginning. Good luck!

  • Sorry for the long post. This worked as advertised for my system, which came with Win8 preinstalled, except for one minor issue: my Recovery partition was broken after the procedure. It still shows up under diskpart and Disk Management, but I cannot use (for example) Settings->General->Refresh Your PC without an error indicating that files are missing. Same goes for Resetting the PC and Automatic Repair, etc, even when starting them under Advanced Startup with reboot required. So, it’s either a hosed Recovery partition or the OS is no longer able to access it.

    I then found out the hard way that the System Repair Disc is not fully functional without a working Recovery partition – for one thing, most folks, myself included, cannot boot into UEFI mode from the DVD drive. Even after copying an ISO of the Repair Disc to a USB drive, which did allow boot into UEFI, I could not run the above mentioned Refresh/Reset/Auto Repair etc. without a working Recovery partition.

    Luckily, I had taken a bare-metal Ghost image of the machine when it was brand new. My solution was to restore this pristine image to a spare machine, and then run Create a Recovery Drive to make a fully functional Recovery USB, which includes all of the functionality of the Recovery partition (the USB needs to be at least 16GB, I believe). I can now boot this USB in UEFI mode to run Refresh/Reset/Auto Repair, etc, on the machine that was converted to UEFI. The useless Recovery partition can then be deleted, and its space added to the C drive (using Disk Management), which is what many would prefer anyway (hence the Delete the Recovery partition option that appears when creating the Recovery USB).

    On my spare machine, I tested a technique for restoring a working Recovery partition on the PC, for those who prefer that to a separate Recovery USB: on the machine that was converted to UEFI using the above technique, make a Ghost backup of the C drive (main Windows 8 OS drive) only. Then boot into the Recovery USB (in UEFI mode) and run Reset Your PC, which will wipe everything and reinstall the OS (in UEFI mode, if the USB was booted that way), including a working Recovery partition. Then boot Ghost and restore the C drive, and the onboard Recovery partition should now work. A lot of trouble, and some risk, plus the loss of C drive space, so it’s probably better to use the separate Recovery USB – just be sure to back it up somewhere. Other backup SW can be substituted for Ghost so long as it can back up a single partition instead of the entire drive.

    If there is some way to re-write the steps above to preserve the Recovery partition, that would be welcome, unless my system was odd and no one else had Recovery Partition issues. My suggestion is that folks make a full Recovery USB in addition to Carlos’s recommendation to create a System Repair disc. This can then be substituted for the repair disc in Step 5 above. Instructions on making the Recovery USB can be found here:

    www.techrepublic.com/.../7261

  • D-FENZ edited Revision 9. Comment: Added recommendation that the recovery drive be backed up to USB

  • It work for me without any issues.

  • Thanks for the guide, it work for me without any issues.

  • Thanks for the guide, however some things need to be clarified:

    1.

    "System Partition (something above 200MB)" - The minimum should be 228MB. distributed as follows - System: 100 MB + Reserved 128 MB

    I had reserved only 200 and had to create the reserved partition with only 100MB. (I hope that no problems will arise).

    2.

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

    This does not work in windows media DVD below SP1 as it does not recognize the /f option.

    I tried to run it without the "/f UEFI" but it gave me an error. I could not execute this step.

    Never the less the Windows recovery DVD was able to solve the boot problems. The system now shows as GPT (EFI system partition).

    3.

    Can no longer boot from DVD.

Page 1 of 1 (13 items)