Installing Windows 10 as secondary OS on GPT disk in UEFI mode

So I uninstalled Windows 10 from my computer a few months ago, and started using Ubuntu as my main OS. But, I've been having some issues with my graphics card on Ubuntu lately, so I decided to finally reinstall Windows 10.

I had already downloaded the ISO a while ago, and all I had to do was burn it to a USB. I've had quite a few problems while doing that, since a file (install.wim) was too large for a FAT32 file system, and only found out I could use NTFS instead about a day later.

I burned the ISO to the USB successfully. However, when I ran the installer, and I tried to make a new partition to install Windows on, the installer returned an error saying Windows cannot be installed to this disk. The selected disk is of the GPT partition style. I've searched online for a while, and the only solutions I could find were either: formatting the whole disk and making a new partition table (which I don't want since I want to dual-boot), or switching from Legacy to UEFI mode, which didn't work obviously because I already am using UEFI mode.

Now I have no idea what's the problem or how to fix it, and I haven't found a similar question here on superuser, so I decided to ask myself.


Solution 1:

The problem is that you've prepared the USB stick for BIOS-style boot.

If the Windows installer is booted in BIOS mode, it will only install the final system for BIOS mode and will require the system disk to use a MBR partition table (and likewise, an UEFI-booted installer will use UEFI and require GPT).

To be bootable in UEFI mode, the USB stick must generally use FAT32 for the main partition. Fortunately there are several easy workarounds for the Install.wim problem:

  • The WIM image can be split into smaller chunks (.swm files) using either DISM...

    Dism /Split-Image /ImageFile:Install.wim /SWMFile:Install.swm /FileSize:2000
    

    ...or PowerShell...

    Split-WindowsImage -ImagePath Install.wim -SplitImagePath Install.swm -FileSize 2000
    

    ...or wimlib-imagex (which is available for Linux and other similar systems – the Ubuntu package is called wimtools):

    wimsplit Install.wim Install.swm 2000
    
  • Alternatively, you can copy the entire installer except for Install.wim to the FAT32 partition – while the WIM image alone can be placed on an NTFS partition. (Recent Windows 10 versions finally support multiple partitions on removable drives, and of course GParted can set this up on Linux.)

  • Rufus can create an UEFI-compatible Windows USB stick that puts an UEFI NTFS driver in the initial partition so that it could boot the entire installer from an NTFS partition.

    This is apparently doable by hand from Linux (see the UEFI:NTFS docs).

  • Finally, if you have another Windows system available, the official "Media Creation Tool" will directly prepare a USB stick, although it will re-download all files.