Create Windows 10 Bootable USB from FreeBSD


Install pre-requisites

sudo pkg install 7-zip wimlib

Create partitions on target USB. In this case /dev/da0

sudo gpart destroy -F /dev/da0
sudo gpart create -s GPT /dev/da0
sudo gpart add -a 4k -t ms-basic-data /dev/da0
sudo newfs_msdos -F 32 -L Windows10 /dev/da0p1
sudo mount -t msdosfs /dev/da0p1 /mnt/windows10/

Extract windows ISO

Note: the final command will max out your machine. On my p1 with a core i7 it maxed out all 12 cores for more than 30 minutes.

mkdir ~/windows
cd ~/windows
7z x ~/Downloads/Win10_20H2_English_x64.iso
cd sources
sudo wimlib-imagex optimize install.wim --solid

Copy file to target usb

sudo cp -R ~/windows/ /mnt/
sudo umount /mnt
sudo sync

You should now be good to boot via the USB drive.

Copyright © 2020 | Ben Hutton