-
Star
(119)
You must be signed in to star a gist -
Fork
(34)
You must be signed in to fork a gist
-
-
Save bmatcuk/fda5ab0fb127e9fd62eaf43e845a51c3 to your computer and use it in GitHub Desktop.
| # First, we need to find our device. BEFORE inserting your USB drive, run the | |
| # following: | |
| diskutil list | |
| # This will output a bunch of info about all of the disk drives connected to | |
| # your Mac. Each entry will have a header in the form "/dev/diskX", where X is | |
| # some number starting at 0. Now, insert your USB drive and run the command | |
| # again. You should see a new entry. Make note of the name (ie, /dev/diskX). | |
| diskutil list | |
| # Now we need to format the drive for MS-DOS and include a Master Boot Record. | |
| # In the command below, replace "diskX" with the identifier of your USB drive. | |
| # WARNING: this will delete everything on the USB!! | |
| diskutil eraseDisk MS-DOS WIN10 MBR diskX | |
| # In the command above, MS-DOS is the format of the partition that will be | |
| # created on the USB. WIN10 is the name of that partition (it'll appear in | |
| # Finder as the name of your USB). MBR tells diskutil to create a Master Boot | |
| # Record, which is necessary for the USB to be bootable. | |
| # | |
| # Now, "open" the Windows ISO: | |
| open Win10xxxx.iso | |
| # Your Mac will "mount" the ISO as if it was a drive. A Finder window will open | |
| # to show the contents of the ISO. Close the Finder window; you don't need it. | |
| # Back in the terminal, let's find the mounted ISO: | |
| diskutil list | |
| # You should see a new entry. This time, we're looking for what's in the NAME | |
| # column. You should see something funny like CCCOMA_X64FRE_EN-US_DV9. The name | |
| # will differ depending on which ISO you downloaded. Make note of the diskX | |
| # identifier as well. Now, let's cd to the ISO: | |
| cd /Volumes/CCCOMA_X64FRE_EN-US_DV9 | |
| # And copy all the files over to our USB: | |
| sudo cp -r . /Volumes/WIN10/ | |
| # This will take a while; there's a lot of data (4+ GB). Grab a drink; relax. | |
| # | |
| # Once it's done, you can eject both the USB and the ISO. First, cd to another | |
| # directory otherwise OSX will not allow you to unmount the ISO (since being in | |
| # the directory means the ISO is "in use"): | |
| cd ~ | |
| # Eject the USB using the diskX identifier from the second step above: | |
| diskutil eject diskX | |
| # Eject the ISO using the diskX identifier from the fifth step above: | |
| diskutil eject diskX | |
| # Now insert the USB into your computer, (re)boot, and select the USB from the | |
| # boot device menu (you may need to press some key to show the boot device menu | |
| # - on my machine it's F12). | |
| # | |
| #Depending on how new your computer is, you may see the USB twice: once with | |
| # UEFI in front of the name, and the other without. If you see the UEFI option, | |
| # select that. |
Oops. This unfortunately no longer works for the later versions of Windows 10 ISOs. Due to the file size limit of FAT, we need to split the
install.wimfile.When copying, exclude
install.wim:rsync -avh --progress --exclude=sources/install.wim /Volumes/CCCOMA_X64FRE_EN-US_DV9/ /Volumes/WIN10Then
brew install wimlib wimlib-imagex split /Volumes/CCCOMA_X64FRE_EN-US_DV9/sources/install.wim /Volumes/WIN10/sources/install.swm 4000
This worked for me. FWIW that UUByte thing is a scam (apparently even if you pay it doesn't produce a working USB), and WinDiskWriter was extremely slow for me (took about an hour, using the commands in this guide only took about 15-20 minutes).
Also, if you get the Windows error saying files are missing or whatever, just start over from the top. Not sure if I messed something up the first time or what, but I got an error in Windows installation the first time, but starting over (erasing USB and starting again) worked for me.
I used to also resent the fact that the Windows installer is so problematic to write to a USB flash drive.
For this reason, I have developed software that solves this problem and saves users from suffering with Terminal.
WinDiskWriter
Free & Open-Source Windows bootable disk creator for Mac[You can download WinDiskWriter from its GitHub Repo]
Windows Versions Support:
Boot Mode Support:
Additional Features:
Important Message to Hackintosh users with bad USB mapping: