Skip to content

Instantly share code, notes, and snippets.

@chriha
Created March 24, 2014 23:10
Show Gist options
  • Save chriha/9751320 to your computer and use it in GitHub Desktop.
Save chriha/9751320 to your computer and use it in GitHub Desktop.
Create a bootable USB stick on OS X
# Convert .iso to .img. OS X will create a ".img.dmg", don't rename it
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/os.iso
# Remove your USB device and run
diskutil list
# Insert USB device and run diskutil again
diskutil list
# Determine the device node assigned to your flash media (e.g. /dev/disk2)
# and unmount your USB device. Replace "diskN" with the disk number from
# your last command
diskutil unmountDisk /dev/diskN
# Convert and copy the file to your USB device
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
# - Using /dev/rdisk instead of /dev/disk may be faster
# - If you see the error dd: Invalid number '1m', you are using GNU dd. Use the
# same command but replace bs=1m with bs=1M
# - If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the 'Disk Utility.app' and unmount (don't eject) the drive
# Remove your USB device, when command is complete
diskutil eject /dev/diskN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment