Skip to content

Instantly share code, notes, and snippets.

@michaeljoy
Created October 10, 2020 16:47
Show Gist options
  • Save michaeljoy/cbd4d38294ee33c34dd6bfa4200d83e0 to your computer and use it in GitHub Desktop.
Save michaeljoy/cbd4d38294ee33c34dd6bfa4200d83e0 to your computer and use it in GitHub Desktop.
Windows 10 Bootable USB Flashdrive from ISO on OSX - Windows Version 2004
## install homebrew first if not available
brew install wimlib
## list disks to find flashdrive disk number
diskutil list
## confirm flashdrive disk number and match to commands before proceeding
diskutil eraseDisk MS-DOS "W10" MBRFormat /dev/disk2
## download Windows 10 iso - https://www.microsoft.com/en-us/software-download/windows10ISO
## mount downloaded Windows 10 iso
hdiutil mount ~/Downloads/Win10_2004_English_x64.iso
## confirm volume is mounted and flash volume available
ls -lah /Volumes/CCCOMA_X64FRE_EN-US_DV9
ls -lah /Volumes/WIN10
## rsync files from mounted iso volume to flash volume - excludes over 4GB install.wim which must be split on Fat32 FS
rsync -vha --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/ /Volumes/WIN10
## split >4GB install.wim into 1GB chunks and write to flash volume
wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WIN10/sources/install.swm 1024
## unmount flash volume and mounted iso volume
diskutil list
diskutil unmount /dev/disk2
diskutil unmount /dev/disk3
## install media complete!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment