USB Flash Drives, UEFI and large WIMs

If you have already started working with UEFI devices, then you have probably figured out a few of the gotchas when it comes to booting these devices. First, you need to boot the device using the native architecture. So, if the device you are attempting to boot is a 64-bit device, then it needs to boot with a 64-bit boot image. Second, if you are using a USB Flash Drive, then you probably have realized that UEFI devices will not boot from a NTFS formatted flash drive. The flash drive needs to be formatted using FAT32 in order to boot UEFI. That is all fine and dandy, but what happens if you have a large WIM file (one that is greater than 4GB, like the Windows Server 2016 install.wim that is 4.38GB) that you need to copy onto the flash drive? The short answer is that you can’t, at least on the FAT32 partition. You can always split the WIM, but what fun is that? Plus, it sounds like extra work to me. Lucky for you, with the right USB flash drive and the information in this blog post, I will show you have you can fit that 4+GB WIM on your flash drive and still boot UEFI (because if you are still using BIOS, stop reading now and switch your system to UEFI).

The trick is to create multiple partitions on your flash drive, just like you do (or like Windows setup does for you) when you install Windows in UEFI mode. The problem is a limitation for creating multiple partitions on removable media. By flipping the ‘removable bit’ on the flash drive, you can then use diskpart to create a bootable FAT32 partition (large enough to fit all of the boot files) and then a second NTFS partition that contains the large WIM file (along with the other setup files that are needed. There are a few utilities out there on the Internet, like BootIT from Lexar (although I could not get it to work on some new Lexar USB flash drives that I just bought), that may or may not do the trick for you (NOTE: this does not work on all USB flash drives and you might toast your flash drive so use at your own risk). There are also some other tools that you might come across if you search long enough (and on some sketchy sites), but once again – use at your own risk. Hopefully one day soon, Windows will allow us to partition removable media since eventually most devices will be class 3 UEFI and WIM files are getting larger, not smaller.

Lucky for me, the SanDisk Ultra 16GB (Model SDCZ45-016G), which I bought at Costco several years ago, already shows up as a basic disk type (in other words, not removable), and allows me to create multiple partitions so that I can make it bootable in a UEFI configured system and still have the ability to copy large WIM files onto it.

sandisk-ultra-16gb002-disk-management-disk-type

It also looks like these are still available on Amazon (although I cannot guarantee that they are like the Costco model apart from the matching characters on the model number).

The process:

  1. Plug in the flash drive and open up an elevated command prompt. Run the following commands:
    diskpart
    list disk
    select disk x (where x is the disk # of your flash drive)
    clean (this is a destructive process, so be sure you have the correct drive and have backed up anything you want to keep)
    create partition primary size=500
    format fs=fat32 quick
    active
    assign
    create partition primary (this creates the second partition)
    format fs=ntfs quick
    assign
    exit
    001-diskpart002-disk-management
  2. For this example, we will use the Windows Server 2016 ISO (you could also do the same with Configuration Manager OSD Media). Mount the ISO (in this example, it is on drive E:) and copy the subfolders boot and efi and files bootmgr and bootmgr.efi to the fat32 drive that was created above (in this example, it is on drive F:).
    003-copy-files
  3. On the fat32 drive create a subfolder called sources.
    004-copy-files
  4. On the Windows Server 2016 ISO drive, navigate to the sources directory. Locate the boot.wim and copy it to the fat32 drive in the sources subfolder.
    005-copy-files
  5. Copy the entire contents of the Windows Server 2016 ISO drive to the ntfs drive (in this example, it is on drive G:).
    006-copy-files
  6. Optionally name the partitions on the USB flash drive for easy identification.
    007-disk-management

Now you should be able to boot right up using the USB flash drive in UEFI mode and in this case proceed to install Windows Server 2016.

Originally posted on https://miketerrill.net/

9 thoughts on “USB Flash Drives, UEFI and large WIMs

  1. Pingback: Create multiple partitions on ANY USB Flash Drive | Mike's Tech Blog

  2. Great catch, the really works well, I am using an old 60GB SSD drive in an external carrier, this just gets seen as a Disk and partitions however you want. Nice one

  3. Hi, thanks for this. There is lot of misleading info on the internet. My machine is HP Microserver Gen8 and Windows Server 2016. First I tried Rufus. It creates bootable USB disk that works just fine in VMware (in UEFI mode). But this Microserver just do not like it. Probably something to do with UEFI:NTFS plugin it uses. Your guide just works. I wonder why MS wont just provide split install.wim to work with FAT32.

    • You can now do multiple partitions on removable media in Windows 10 1703. I tried on a Lexar USB key that I have that I could not do double partitions before and I was able to create multiple partitions. This means that the OS you boot from still needs to be able to read it.
      -Mike

  4. After following the steps I was finally able to get the IFO image on the flash drive, thank you!

    When I did try to install Windows Server 2016 on my device however, it gets to the install page and once I click install and it says setups is starting, the next screen says that no drivers could be found for installation. Any idea why I am getting this error? Thank you!

    • I seem to be having the same issue! I am currently trying to reinstall Server ’16 datacenter onto a DL380p gen 8 when the error pops up. I was previously able to get the .iso to install over iLO, but it caused some corruption in the windows files and I decided to reinstall using a USB key

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s