Creating a UEFI/BIOS Windows 7 USB and installing to GPT partitions

Standard

I bought a new Asus Zenbook a few days ago and decided to format it and replace the win 7 home premium with bloatware with a clean install of win7 ultimate.

With no DVD drive you have to boot off USB to install it. Then I realized I’d never actually setup a bootable windows install USB before.

After some research I noticed it’s not as easy as it seems if you want to install on a UEFI computer that already has GPT partitions created.

Steps to create bootable Windows 7 USB for UEFI support and GPT partitions:

  1. Open a command line in administrator mode
  2. run DISKPART
  3. type LIST DISK
  4. Look for the disk number that represents your USB drive
  5. type SELECT DISK # where # represents the number of your USB drive. Get this right or you will wipe a different drive out.
  6. type CLEAN
  7. type CREATE PARTITION PRIMARY
  8. type SELECT PARTITION 1
  9. type ACTIVE
  10. type FORMAT fs=fat32
  11. type assign
  12. The drive should now be formatted and marked as active and fat32. Do not format the drive as NTFS or you will only be able to boot into the installer in BIOS mode.
  13. Now you will need to copy the contents of the windows 7 install dvd to the USB with a regular copy paste from windows explorer.
  14. Once this is done you will need to get a copy of the EFI boot manager firmware file from a computer that has windows 64 bit installed on a UEFI system.
  15. This file is located in C:WindowsBootEFIbootmgfw.efi
  16. On your USB (Let’s assume it’s drive E:) look in E:efimicrosoftboot and copy this boot folder up one level so it sits in E:efiboot
  17. Now copy the bootmgfw.efi file from your computer which has windows installed to this new E:efiboot folder and rename it to bootx64.efi
  18. Insert the USB in the machine and turn it on and boot into the UEFI/BIOS loader and check for boot options. On the ASUS Zenbook it detected two boot options on the USB drive. One was UEFI and one was regular BIOS. I made the UEFI option the first choice and restarted the machine.
  19. I could now install windows to the formatted existing GPT partitions that were on the machine.

The reason I didn’t want to install in a regular BIOS MBR scenario is because there are recovery partitions on this drive that are GPT as well and to convert back to MBR from GPT you have to delete all partitions on the drive which would have caused me to lose my recovery and data partitions.

This solution was perfect and gives me the added bonus of UEFI and GPT partitions.

If you need to find out if you have booted into BIOS mode or UEFI mode when the installer starts you can press SHIFT+F10 when the welcome installer shows up to open a cmd prompt. from here you will likely be at X:Sources. Type cd .. to go back a dir and move into WindowsPanther

Then type notepad setupact.log

Within this file do a ctrl+f and search for

    Callback_BootEnvironmentDetect: Detected boot environment:

It should either say BIOS or UEFI.

73 thoughts on “Creating a UEFI/BIOS Windows 7 USB and installing to GPT partitions

  1. Somya Bhatnagar

    Hello Prof. Hodgin,

    Just wanted to say hello to you.
    Your guidance about ULI is helping me perform well in OPS235 and INT213. I hope that with your guidance I can further enhance my skills, I have subscribed to the feeds of your website and its super enriching.

    Thank you again for your guidance on your website.

  2. Paul

    Brilliant, I just wish your post came up first in Google!

    If I could suggest one improvement – make the format a quick format (format fs=fat32 quick). Typing this while waiting for my 100gb disk to full format…. 5%…

  3. Abesik

    Hi I,ve done everything what u said and i have an problem-pendrive its booting ok the files are loaded and its stucks at starting windows instalation… Notebook is asus x501a can u have something to solve that problem?
    thx

  4. Storm Wind

    “14. Once this is done you will need to get a copy of the EFI boot manager firmware file from a computer that has windows 64 bit installed on a UEFI system.”

    Can you send me one?

    Thanks.

  5. Seemork

    Thank you! I have been looking for the solution and this works great. I did this for Windows 8 Professional installation on my new Asus laptop. In my case, I don’t need to do step 14-17 as the files are all ready in the right place when the content from the CD are copied to the USB.

  6. eltranced

    If you use windows8 bootmgfw.efi you may have issue with not finding CD/DVD drives in installation which will hault the whole process
    you can try windows 7’s version in setup. (can use 7zip to dig it out)

    cd or usb:sourcesinstall.wim1WindowsBootEFIbootmgfw.efi

    also
    11. format fs=fat32 quick <– quicker , i had no problem formatting usb in windows as well.

  7. Sia

    Hi,

    I was wondering whether I could apply this procedure also on the Windows 7 installation DVD instead of making a Boot USB because I do have a DVD drive?
    So this means that I should pass only step 13 but perform all other steps and copy those files to the instalation DVD?

    In my Bios I changed the ´boot from storage device´ to ´UEFI drive first´ but I get the error message: Windows kan´t install on this disk because it has a GPT partitition!
    Therefor I think that I should perform your procedure but as I mentioned above I am not sure whether I can do it with the istallation DVD or not?
    I have a ASUS CP-6230 with Windows 8 64 bit preinstalled
    (this means that I should have a GPT Disk, wright!?) but I want to install the Windows 7 64 bit as a dual boot.

    Thanks and regards,
    Sia

  8. Gerhard

    Thanks so much for this guide it helped me install windows 7 on my Lenovo Z580 without losing recovery partition . I appreciate it. thanks

    • Affable

      Hello brother please i also have Lenovo z580 but i couldn’t get the bootx64….file plz could you send me yours. thanks. affable37@gmail
      com.

  9. Edu

    Hi,

    I want to install windows 7 on a machine with GPT and Windows 8. I tryed what says the post but with the difference I dont wat to format the unit, I want to keep windows 8 and windows 7. When the usb loads and starting windows 7 installation screen it freezes and the computer stops. Always the same and with an original windows x64 iso.

    This method only wirks if you format the primary partition? Or you tryed it in HDD with another OS installed and not formated?

    • eltranced@gmail.com

      yes, you can have SAFEBOOT bios, GTP partitions and preinstalled win8 and run dual-booted Windows 7 side-by-side with recovery partitions all intact.
      Thats what I did with Asus K55A

      You most likely need windows 7 version of bootmgfw.efi to bypass CD/DVD error while using usb.

      and when u get

      “The partitions on the disk selected for installation are not in the recommended order. Do you want to proceed with installation?”

      You can proceed with new gpt partition that you’ll create, i forgot but i think i created mine in windows environment before i booted into usb

  10. Sebastian

    Thank you!

    After getting the “Windows cannot be installed to this disk. The selected disk is of the GPT partition style” message I looked around for about two hours to see if there was an answer.

    You’re the only person I found who didn’t say “Just format the entire harddrive”.

  11. kp

    I performed each and every command in prompt….then started copying files from window 7 dvd…when the copying process was about to complete..my usb drive started showing unallocated space.in disk management….I tried to recover my usb drive by booit tool….somehow it started showing full capacity.. but now nothing can be deleted neither copied to it…when I connect usb to my pc it show full capacity with the copied file..but when trying to delete or formate…it starts showing unallocated space and windows cant acces it..i.e. access denied….
    help me please…thanks.

  12. Tyron

    “14. Once this is done you will need to get a copy of the EFI boot manager firmware file from a computer that has windows 64 bit installed on a UEFI system.”

    How do I get this file, if this installation is exactly what I’m trying to achieve?

    • Daniel H

      Good point. You would have to copy it from another computer. I guess i assumed most people have at least one other computer in their household or at work they could get this from.

      Might be able to find it on the net but who knows if it would contain a virus or be the right version.

  13. Jjb

    Sir,
    I have bought a new asus k55vd sx314d with dos in it.
    I want to install windows 8 using bootable USB.but wen I enter the bios in the boot option I can’t find an option to boot from USB.it has only two options -to boot from cd/DVD and other hard drive.the bios is aptio ,version 2.14….
    I searched a lot but couldn’t find a way out.
    Please help me.wat to do???

    • lalala

      If i remember correctly with ASUS you have to have USB plugged in when entering BIOS for it to show up on list. . . . Otherwise it will only show those that are connected which is DVD and HD.

  14. Danius

    Thanks. a lot. i tried to instal win from usb and it did not allowed me to. because of GPT partition. you helped me to solve that. thanks again

  15. Arnaud L

    Great article, thanks !
    I tried it on my Asus S200, and got an error after choosing the UEFI boot option : winload.efi file is missing or corrupt (0xc0000359).
    I have googled for this but have not found a solution so far …

  16. Shaheen

    And why exactly couldn’t I find this the first result on Google (another fail)

    All I can say is you are Brilliant ! Thanks a lot

  17. Damien

    Hi
    I don’t own a win 7-64 UEFI based system so I cannot get that boot64x.efi file. Altough i dit get the one from my new laptop wich is a win 8-64 EFI based… So I did everything as descibed by your article, wich is great by the way, and my laptop started to boot in “win 7 mode” but it did not progress for quite a while.
    Do you think the file from win 8 should be working????
    I waited about 5 minutes with this black screen where its written
    “Starting Windows” should I wait longer or not?

    In any case CAN YOU provide that EXTREMELY HARD to find file in any way possible!!!!!!!!!!

  18. jhonny

    my problem is actually, like arnaud L above, after choosing uefi boot usb drive : winload.efi.
    i has googled it too but not found yet….
    thanks.

  19. jhonny

    my problem is actually like arnaud L above, after choosing uefi boot usb drive : winload.efi missing or corrupt.
    i has googled it too but not found yet….
    thanks.

  20. Eraj

    Unfortunately after Loading Files screen the main Windows 7 installation screen did not appear. Is it something because of the videocard drivers were not loaded? I think it is working but it doesn’t show the screen. Please help.

  21. Mike

    Step 16 seems confusing to me.
    So the MicrosoftBoot folder will be copied into the previous Boot folder like so:
    E:EFIBootBoot (two Boot folders don’t seem right)

    or did you mean copy the file contents from the MicrosoftBoot folder to the E:EFIBoot folder?

    And depending which is correct, where exactly does the bootmgfw.efi get placed? Does it go in:

    E:EFIBootBoot
    or
    E:EFIBoot

    Also you mention that you copy these folders over. Did you mean move them or is it fine to leave the original folders where they are?

  22. Capt. Saria

    Thank you, I tried it on my brand new Dell 5521 Windows 8 64 1 TB, and it worked like a charm.
    I even tried both, GPT and MBR format and both worked OK. Of course I had to change the BIOS setup to match the format.
    Thanks again for this great work and have a good day.

  23. shubham singhal

    hi….i have dell inspiron 5520 with windows 8 pre installed and uefi firmware).i wish to dual boot my w8 with w8 enterprise.i have followed the above procedure but when i go into my bios(uefi) i could not see as my usb listed under boot option.default windows manager and some network options are listed. when i add another boot option as “usb” it is asking me for file system path.i m confused about wat to give ? should i give it as efi bootbootx64.fi or something else.anyone out there can help me with that?

  24. Thank you, Daniel H.
    This is the only guide that helped me install Win 7 x64 on my Asus UX31A-DH51 with UEFI and GPT.
    I did have 2 options to boot from BIOS and UEFI.
    Selecting UEFI options allows to install on existing GPT partitions if you don’t wan’t to delete them, but deleting existing partitions won’t reformat your HDD to MBR – it will remain GPT which is good 🙂

  25. raj

    when i install win8 in my pc i want to partition of disk but i didnot find any option of partition in win8 installing processing so please give me a solution of this problem

  26. Andy

    I have Samsung 270E5E, windows 8 preinstalled.
    When I tried to install Windows 7 on MBR, i.e. deleting all partitions on disk thus making it MBR, I lost BIOS completely ! This was resolved by replacement of motherboard (warranty).
    Now, using this guidelines, I’m trying to install Windows 7 on GPT.
    First thing: you must disable Secure Boot in BIOS, otherwise it says that signature is incorrect.
    Then I’m stuck on “Starting Windows” screen, it won’t go further…

    • Andy

      Solved that too. I have three options in Boot type: UEFI OS, CSM OS, UEFI AND CSM OS.
      If I choose UEFI OS, boot hangs.
      CSM OS — boots ok, but cannot install on GPT
      UEFI AND CSM OS — boots and can be installed on GPT

  27. Goran

    Hello everyone. I tried to install Win 7 on “GPT partition” by burning a DVD from Win 7 iso.

    I have opened an ISO file (Win 7 setup), copied “boot” folder from “efi/microsoft” to “efi”, as Daniel wrote. Then I copied “bootmgfw.efi” from other Win 7, renamed it to “bootx64.efi” and copied to the same boot folder.

    Then I saved an ISO file as a new one and burned DVD from that file.

    But now, in the setup start, it says “Windows could not collect information for OSImage since the specified image file install.wim does not exist”.

    Is there some way you could help me?

  28. Netnissen

    Hi Daniel.
    Thanks for your guide I have refined it a bit.

    Hi friends of the internet

    I have been reading several forums regarding the issue of installing windows 7 (64 bit) to a computer that have had windows 8 installed previously or just a GPT formatted disk.
    My Case:
    Windows version installed: Windows 7 Professional N with Service Pack 1 (x64) or Windows 7 Professional (x64)
    Computer used: Samsung laptop
    Model Code: NP53U4C-A02SE
    See the specks here:
    http://www.samsung.com/dk/consumer/computer-peripherals/notebook/notebook/NP535U4C-A02SE-spec
    Create a USB install disk that not freezes at ”starting windows” screen:
    First I followed this great guide (Thanks Daniel):
    http://hodgin.ca/2012/10/02/creating-a-uefibios-windows-7-usb-and-installing-to-gpt-partitions/
    STOP AFTER STEP 13!
    1. Open a command line in administrator mode
    2. run DISKPART
    3. type LIST DISK
    4. Look for the disk number that represents your USB drive
    5. type SELECT DISK # where # represents the number of your USB drive. Get this right or you will wipe a different drive out.
    6. type CLEAN
    7. type CREATE PARTITION PRIMARY
    8. type SELECT PARTITION 1
    9. type ACTIVE
    10. type FORMAT fs=fat32 quick
    11. type assign
    12. The drive should now be formatted and marked as active and fat32. Do not format the drive as NTFS or you will only be able to boot into the installer in BIOS mode.
    13. Now you will need to copy the contents of the windows 7 install dvd to the USB with a regular copy paste from windows explorer.
    Here comes a very weird hack… I do not know why it works, but I think it is all about flash drive data structure. I did these steps on a win 7 prof. computer.
    (Let’s assume it’s drive E:)
    1) Make a copy of your e:efimicrosoft folder to e.g. your desktop.
    2) Delete the e:efi folder
    3) Copy the efi folder from a windows 8 installation disk (I used Windows 8 (x64) Professional) to the e:efi folder. Sorry I cannot provide this for you.
    4) Here comes the weird part. Then delete e:efimicrosoft you just copied from the win 8 installation disk.
    5) Copy the microsoft folder form the desktop to e:efimicrosoft
    Resume the guide from step 18.:
    http://hodgin.ca/2012/10/02/creating-a-uefibios-windows-7-usb-and-installing-to-gpt-partitions/
    18. Insert the USB in the machine and turn it on and boot into the UEFI/BIOS loader and check for boot options. On the ASUS Zenbook it detected two boot options on the USB drive. One was UEFI and one was regular BIOS. I made the UEFI option the first choice and restarted the machine.
    • My bios setup was:
    • Secure Boot = Disable
    • OS Mode Selection = CSM and UEFI OS
    • Boot Device Priority = I made the UEFI option the first choice and restarted the machine.
    The installation should start normal.
    E.g. See this guide:
    http://www.sevenforums.com/tutorials/186875-uefi-unified-extensible-firmware-interface-install-windows-7-a.html
    What I did was:
    1) Select custom installation (Advanced).
    2) Click Drive options (Advanced).
    3) Delete all partitions (this might not be needed). When I did not delete all partitions I was asked every time after the install, during start up by the windows boot manager to select ether win 8 or win 7.
    4) Click new (DO NOT make Changes in the size of the disk), apply, see NOTE!
    5) Edit the Primary partition as you want it e.g. divide it to more partitions.
    6) Select the one you will install windows on and do a normal install.
    7) I do not make changes in the Bios after install. The Boot priority is automatic set to “Windows boot manager”. If I change the boot mode back to OS Mode Selection = UEFI OS, the computer will freeze at the “starting windows” screen again.

    All this worked for me, good luck. There might be more to it, but this is a start.
    By the way, the start up time for a MBT install was 37 s. And for the GPT it was 49 s.
    Remember if we stand on each other’s shoulders we will reach higher .

    NOTE: Here the installation program should create three partitions automatically!
    – Partition 1 – System – The EFI System partition that contains the NTLDR, HAL, Boot.txt, and other files that are needed to boot the system, such as drivers.
    – Partition 2 – MSR – The Microsoft Reserved (MSR) partition that reserves space on each disk drive for subsequent use by operating system software.
    – Partition 3 – Primary – Where Windows is to be installed to.
    If this isn’t the cast you are not installing in UEIF mode. To check for this (thanks again Daniel):
    If you need to find out if you have booted into BIOS mode or UEFI mode when the installer starts you can press SHIFT+F10 when the welcome installer shows up to open a cmd prompt. from here you will likely be at X:Sources. Type cd .. to go back a dir and move into WindowsPanther
    Then type notepad setupact.log
    Within this file do a ctrl+f and search for
    Callback_BootEnvironmentDetect: Detected boot environment:
    It should either say BIOS or UEFI.

    To check if your disk is in the GPT format.
    Open the command prompt.
    Type: DISKPART
    Type: List Disk
    See for the star (*) in the GPT column

  29. Vincent M Graziano

    Thank you very, very much for your work.
    After many attempts with other suggestions,
    your solution work the first time.

    Thanks again.

  30. katalup

    what if win7 install dvd has file larger than 4GB you know it cannot be copied because fat 32 system on usb won’t copy such large file , can it be passed somehow ?

  31. Wayne

    tried the above, no joy… Laptop has no legacy mode settings, only UEFI. With win7 pro 64 bit disk, it boots up and freezes at “Starting windows” with a red line on top. It had Ubuntu 64 before I cleaned the drive (but kept it as a GPT partition.) The USB option above does exactly the same thing.

  32. waleed

    Hey how r u i have done all steps but still no hope
    When i check setupact the callback _boot enviroment :detected boot enviroment : Bios ,
    please help i dont want to wipe my hdd
    My laptop model is dell5520 and bios updated to A12
    In uefi boot menu only 2 options showing
    Ipv4
    Ipv6 some thing like that

  33. john

    While trying to install windows 8 to my newly formated ntfs hard disk…setup shows can’t install to this disk because bios cannot boot from the disk…tried all the settings in bios and still no change please help out….hp 620

  34. somayeh

    hello Daniel, thanks for helpful post. I have sony vaio(s series) note book. I have two “legacy” and “UEFi”, and the default is”UEFI” and i don’t change it. atfer i have done above steps in your post, i still get the error message “Windows can not be installed to the disk. The selected disk is of the GPT partition style.” i have a lot af data on my hard disk and i don’t want wipe them all. please help me. thx.

  35. lkin

    thanks mate . u saved me !!! 🙂 u are great. thank u and for your support . thanks for your time . thanks for your great guide

  36. Sourabh Katoch

    Sir i have Dell Inspiron 15 3542
    i tried to install Windows 7 ultimate through Usb drive
    but after clicking on custom option during installation firstly i format the C: drive(old window 8.1)
    now by highlighting free space drive it cannot show Next option only shows
    (Window can not b install in this drive. This is GPT partition.
    Now i have lost my old window by formatting and not able to install the New one
    please help me out!!

  37. Jack

    Hello… and thank you for all the time and effort you’ve obviously devoted to this. Your process worked perfectly but I’m getting stuck by the lack of a driver. It looks like it want the 6th Gen processor driver and I can point to the eSupport folder where it locates it but says it’s not the right one. It’s an Asus Zenbook UX303UB purchased a month ago. The Asus site is useless for anything other than Win10 stuff. I’ve searched high and low to no avail. Any suggestions?
    I also moved (not deleted) the recovery partition so now the option in Win10 is a bust. Do you know how I can get Win10 to find it so it’s usable? Not for nothing MBR and BIOS was reliable and suitable for the consumer market…
    Thanks in advance for any support you can lend.
    Jack

  38. Daniel

    I wish I could find this post before I messed up with my laptop, in order to reinstall windows 10 I had to clean the HDD with diskpart, now I´m having troubles trying to reinstall the Dell factory image…

Leave a reply to Sourabh Katoch Cancel reply