●  20 September 2015

Install Windows 7/8/10 to bootable external USB (Bootcamp)

If you are anything like me and have a Bootcamp partition taking up too much precious space on your Macs internal storage there is a solution -- externally bootable Windows drives. This is especially useful for gaming on a Mac, something that is infinitely faster when booting direct into Windows and generally takes up a massive amount of space.

In my case I also wanted a time-machine backup partition on the same drive for added flexibility. This is optionally covered in the drive preparation section below.

What you need:

1. Access to a Windows PC (a VM is fine) to initially partition and format the USB drive
2. imagex.exe, bcdboot.exe (A part of Windows Automated Installation Kit - WAIK)
3. A USB3 device to install Windows on (NOTE: content on this disk will be completely destroyed during this process).
4. A USB3 capable Mac
5. Bootcamp drivers on a second USB drive
6. Windows installation media or ISO file

The only binaries required from WAIK (Windows Automated Installation Kit) are imagex.exe and bcdboot.exe. You can download the full toolset (1.6 GB), but I would recommend using this tool which automates the extraction of files you need (something closer to 5 MB).

Step 1: Extract install.wim

The first thing you'll need to do is locate the install.wim file stored on the Windows installation media. If you are extracting from an ISO file you will need to mount it first.

Once you have access to the Windows installation content navigate to the 'sources' folder and find the 'install.wim' file. Copy this file somewhere accessible to the Windows machine you'll be using for this process.

Step 2: Prepare the boot drive.

1. Run cmd.exe as administrator (Start > type cmd.exe in the search box > Right click and run as administrator)
2. Run the disk partitioning utility to begin partitioning the USB device
diskpart.exe
3. Determine which disk number you want to repartition by typing list disk. Be careful here, choosing the wrong disk will destroy content. You may wish to disconnect any unneeded drives here just to be safe.
DISKPART> list disk

Disk ###  Status         Size     Free     Dyn  Gpt
--------  -------------  -------  -------  ---  ---
Disk 0    Online           64 GB      0 B        < This is my WinVM
Disk 1    Online         1024 GB      0 B        < This is my USB drive

4. Select the disk you've determined to be the USB disk you want to repartition. In my case this is Disk 1 so I would type select Disk 1.
DISKPART> select Disk 1

Disk 1 is now the selected disk.

5. Clean all existing partitions on the USB drive by typing clean. (Warning: this is the part the will destroy all data on disk!)
DISKPART> clean

DiskPart succeeded in cleaning the disk

6. Use the Master Boot Record (MBR) partitioning table by typing convert mbr
DISKPART> convert mbr

DiskPart successfully converted the selected disk to MBR format.

7. Create a 350MB boot partition by typing create partition primary size=350
DISKPART> create partition primary size=350

DiskPart succeeded in creating the specified partition.

8. Format the newly created boot partition as FAT32 by typing format fs=fat32 quick
DISKPART> format fs=fat32 quick

100 percent completed

DiskPart successfully formatted the volume.

9. Mark the new boot partition as active by typing active
DISKPART> active

DiskPart marked the current partition as active.

10. Assign a drive letter to the boot partition, we will use 'b' for boot, so type assign letter=b
DISKPART> assign letter=b

DiskPart successfully assigned the drive letter or mount point.

11. Next we will create the new Windows boot partition. I want to make this 150GB (of 1TB total), so I will type create partition primary size=150000 (you specify the value in MB).
DISKPART> create partition primary size=1000

DiskPart succeeded in creating the specified partition.

12. Format the new partition using the NTFS filesystem by typing format fs=ntfs quick
DISKPART> format fs=ntfs quick

100 percent completed

DiskPart successfully formatted the volume.

13. Assign a letter to the new Windows paritition, we will use 'w' for Windows so type assign letter=w
DISKPART> assign letter=w

DiskPart successfully assigned the drive letter or mount point.

14. Create a HFS partition with the remaining disk space by typing create partition primary id=af (to be used for Time Machine). In my case this will use the remaining 750GB.
DISKPART> create partition primary id=af

DiskPart succeeded in creating the specified partition.

15. Close diskpart.exe by typing exit

Step 3: Copy Windows files and make bootable

Next we want to copy the Windows system files and ensure the drive is actually bootable.

• Copy windows system files using imagex.exe by typing imagex.exe /apply c:\path\to\install.wim 1 w:
C:\wim>imagex.exe /apply install.wim 1 w:

ImageX Tool for Windows
Version: 6.2.9200.16384

[ 100% ] Applying progress


Note: this can take quite some time!

• Configure the boot sector by typing w:\windows\system32\bcdboot w:\windows /f ALL /s b:

Note: if you are attempting to install Windows 7 you may see an error when attempting to run this command -- simply remove the /f ALL portion as it is not required for Windows 7 installations.

You should now have a drive with 3 partitions, one system boot, one with the Windows installation, and one HFS ready for setting up for time machine backups. Note: If the OSX compatible HFS partition is not appearing in MacOS you may need to erase it in Disk Utility.

Step 4: Boot into the Windows installer and install Boot Camp drivers.

The next part is simple. Reboot your Mac, holding the alt key and selecting the new Windows partition from the bootable drives list. Your computer may reboot several times during the install process, if at any stage you find it booting back to OSX you will need to restart holding the alt button and forcing it to boot into Windows.

Once the installation process is complete you will need to install the boot camp drivers, and it's job done!