I needed to reinstall one of my Windows PCs at home recently, and realised that I only have Windows 7 DVDs, but no Windows 10s.
Since it’s possible to boot and install Windows 10 from USB, that’s what I decided to do: download Window 10 ISO and burn it one of the USB sticks I have. This approach will be simpler for any other ISO image like Ubuntu or CentOS, so there’s a separate Steps 3-5 for them at the end of the post.
Here are the steps I had to take on my MacBook, originally procedure was written in macOS High Sierra, but I tested it in MacOS Mojave 10.14.2 as well. All of these need to be done in the Terminal app.
Windows 10 bootable USB vs Linux ISO USB
Windows 10 is a very specific bootable media, so the process is a bit involved. For generic Linux installation ISOs this procedure would be simpler. So the first two steps are the same, then Windows and Linux have separate procedure.
Here’s what we will do for Windows ISO:
erase USB stick and create MBR (master boot record)
format USB stick with FAT-32 filesystem
mount Windows 10 ISO image as a folder
copy all the files from that folder onto the USB stick
Here’s what we would do for Linux ISO:
use dd command to burn Linux installation ISO onto USB stick
Step 1: Confirm partitions before inserting USB
Use the diskutil command to list all disks and partitions on your Mac. This is simply so that you can run the same command again after inserting USB and easily spot the USB device.
Step 2: Insert USB stick an re-run diskutil list
This time I can see there’s a disk9 showing up, with 64GB of size which matches my USB stick size:
Chances are, your USB stick has a PC standard FAT16/FAT32 filesytem, and will be mounted automatically. Let’s check:
Sure enough, it’s mounted as /Volumes/NONAME!
Creating Windows bootable USB
IMPORTANT: these steps are only needed for Windows ISOs. If you’re burning a Linux ISO, skip this and go to the Creating Linux bootable USB section below, it has its own steps.
Step 3: format USB stick for Windows boot
This single command will erase the USB stick, make it bootable by adding a Master Boot Record (MBR) and create a Windows-friendly filesystem (FAT) on it:
You’ll have the new filesystem mounted automatically, as you can see it’s empty (1.1MB used of 14GB):
Great stuff, now we’re moving to the next phase: we need to mount the Windows ISO image as a folder and then copy all the files onto the freshly formatted /Volumes/WIN10 USB stick.
Step 4: Mount Windows ISO
Simply go to the directory where you have the ISO image and run the open command for it:
You’ll have the MacOS Finder window with Windows ISO content pop-up, just ignore it and go back to the terminal.
You should now have it mounted under folder like this:
Go into that folder and do ls to make sure you can see Windows DVD files there:
Step 5: Copy Windows files onto USB stick
Right, now we have to copy all the files from DVD ISO image onto our new USB stick.
IMPORANT: you should be in the /Volumes/CCSA_X64FRE_EN-US_DV5 directory when running this command below. That’s exactly where you are if you just completed Step 4.
The copy will take good 10-15min:
There should be no errors returned.
If you remember, in Step 3 we did the df command and the USB filesystem /Volumes/WIN10 was empty.
Just to get an idea that the copy was successful, let’s run the df command again to make sure the USB stick has roughly the same amount taken up now – 4.1GB as per output fragments in previous step.
Looks good! What’s left now is to eject the USB stick:
and to boot it on the PC as shown below.
Step 6: Boot USB stick on your PC
IMPORTANT: recent enough PCs will likely offer you both legacy boot and UEFI boot. The rule of thumb is to boot UEFI if it’s available, especially if you’re booting Windows USB stick:
Creating Linux bootable USB
As I said earlier, non-Windows ISOs are much easier to deal with! So after the first 2 generic steps at the start of this post, we’ll be taking separate steps for Linux as shown below.
We need to unmount the USB disk we found in Step 2. It’s /dev/disk9 in our case:
Step 3: convert ISO into bootable DMG
WARNING: this is an important step, without it your USB stick won’t boot.
So I have this DVD ISO of the CentOS 7.4, let’s convert it before burning onto the USB stick.
Step 4: write DMG image onto USB stick with dd
Exellent, now we are ready to burn the ISO image. Let’s cd into the directory with all the ISOs that you have and burn it using the dd command.
dd command runs with the help of 3 command line parameters:
if – specifying source data, that’s our ISO image file
of – specifying the destination file or device, /dev/disk9 in our case
bs – block size, just needs to be something big enough like 1m (meaning 1 megabyte)
Depending on the ISO size and the USB stick speed, you’ll have to wait 10-20min for this to complete.
Useful tip (cheers Jim!): if you want to confirm your current process, press Ctrl+t in the Terminal app and it should update output with dd progress (I highlighted the output below every tipe I pressed Ctrl+t):
finally, dd will complete a message like this:
Step 5: Boot USB stick on your PC
That’s it, we’re done! Eject the USB stick (no need to run any diskutil commands as it wasn’t mounted automaticaly) and boot on your PC.
IMPORTANT: recent enough PCs will likely offer you both legacy boot and UEFI boot. The rule of thumb is to boot UEFI if it’s available: