Writing an ISO image to USB on a Mac

Convert your ISO image into a Mac native disk image:

hdiutil convert -format UDRW -o my-file my-file.iso

Insert a USB stick into your Mac and get the device path by running:

diskutil  list

In my case it’s /dev/disk2. Please take extra care when identifying the USB disk, as you might otherwise delete your entire harddrive!

Unmount the USB disk (do not eject):

diskutil  unmountDisk /dev/disk2

Write the converted ISO file to the USB disk:

sudo dd if=my-file.dmg of=/dev/rdisk2 bs=1m

We use /dev/rdisk2 here, as opposed to /dev/disk2 when we unmounted, because it gives access the the raw device and makes the writing faster.

Now eject the USB disk:

diskutil eject /dev/disk2