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

Filed under Microsoft, Open Source, Personal

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:\Windows\Boot\EFI\bootmgfw.efi
  16. On your USB (Let’s assume it’s drive E:) look in E:\efi\microsoft\boot and copy this boot folder up one level so it sits in E:\efi\boot
  17. Now copy the bootmgfw.efi file from your computer which has windows installed to this new E:\efi\boot 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 \Windows\Panther\

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.

66 Comments

  1. Somya Bhatnagar says:

    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 says:

    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. Christopher says:

    Very Nice :D
    but it wont work with my Acer E1, it say ”No bootale device” :/
    In Legacy Bios, it work out of Box O_O

  4. Abesik says:

    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

  5. Storm Wind says:

    “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.

  6. Seemork says:

    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.

  7. eltranced says:

    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:\sources\install.wim\1\Windows\Boot\EFI\bootmgfw.efi

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

  8. Sia says:

    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

  9. Gerhard says:

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

  10. Edu says:

    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 says:

      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

  11. Sebastian says:

    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”.

  12. kp says:

    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.

  13. Tyron says:

    “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 says:

      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.

  14. gwapito says:

    I need to try this. hope it works. Thanks

  15. gwapito says:

    UNFORTUNATELY IT DIDN’T WORK.

  16. gwapito says:

    MY NEWLY BOUGHT LAPTOP IS ACER V3 471G W/ PRE-INSTALLED WINDOWS8

  17. Jjb says:

    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 says:

      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.

  18. nurullah says:

    thank you so much you saved my day

  19. Danius says:

    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

  20. Arnaud L says:

    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 …

  21. Shaheen says:

    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

  22. rx says:

    Easy… just clean the gpt partitiom using disk part cmd with live windows 7..

  23. Damien says:

    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!!!!!!!!!!

  24. jhonny says:

    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.

  25. jhonny says:

    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.

  26. Eraj says:

    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.

  27. Mike says:

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

    or did you mean copy the file contents from the Microsoft\Boot folder to the E:\EFI\Boot folder?

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

    E:\EFI\Boot\Boot
    or
    E:\EFI\Boot

    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?

  28. Capt. Saria says:

    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.

  29. Joseph says:

    Hi, Is the USB created on a Windows 8 OS?

  30. ed says:

    THANKS!
    you’re a life saver! worked like a charm on my taichi

  31. shubham singhal says:

    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 \boot\bootx64.fi or something else.anyone out there can help me with that?

  32. Roma says:

    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 :)

  33. Murtaza says:

    But i want to do dual boot widnows 8 and windows 7

  34. Hafsa says:

    I formatted my drives . i didnt have idea that my laptop has all GPT drives . Now m unable to install windows. Please help

  35. Kasper says:

    Boot works but during Windows 7 setup it freezes when displaying circling windows logo

  36. raj says:

    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

  37. Andy says:

    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…

  38. John says:

    Or you can google search “How to Create a Bootable UEFI USB Flash Drive for Installing Windows 7, Windows 8, or Windows 8.1″ there is an app like the windows usb tool that sets everything up for you called rufus.

    http://www.eightforums.com/tutorials/15458-uefi-bootable-usb-flash-drive-create-windows.html

  39. sakil says:

    But my laptop can’t open then i what to do ?

  40. tedros says:

    hi i want to format my pc from window-8 to window-7 but not allowed me due to GPT type of partition

  41. Gal says:

    For those who are looking for the file bootmgfw.efi and don’t have another computer with Windows 7 installed on it, this website explains how to do it using 7-Zip:
    http://www.eightforums.com/tutorials/15458-uefi-bootable-usb-flash-drive-create-windows.html

  42. Goran says:

    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?

  43. Netnissen says:

    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:\efi\microsoft 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:\efi\microsoft you just copied from the win 8 installation disk.
    5) Copy the \microsoft folder form the desktop to e:\efi\microsoft
    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 \Windows\Panther\
    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

  44. Vincent M Graziano says:

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

    Thanks again.

  45. katalup says:

    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 ?

  46. Wayne says:

    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.

  47. waleed says:

    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

  48. john says:

    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


Trackbacks/Pingbacks

  1. Downgrade Windows 8 to Windows 7 - Page 8

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*