Skip to content

Instantly share code, notes, and snippets.

@tian-im
Last active October 26, 2015 17:25
Show Gist options
  • Save tian-im/a1cc3558dced6ac7d571 to your computer and use it in GitHub Desktop.
Save tian-im/a1cc3558dced6ac7d571 to your computer and use it in GitHub Desktop.
Burn ISO to external volume in Mac
burn_iso () {
if [[ -z $1 ]] || [[ -z $2 ]]; then
echo 'usage: burn_iso IDENTIFIER PATH_TO_ISO'
echo 'hint: you could use `diskutil list` to find out the desired identifier.'
return
fi
# @see http://osxdaily.com/2015/06/05/copy-iso-to-usb-drive-mac-os-x-command/
# 1. find out the identifier using `diskutil list`
# 2. unmount the drive
sudo diskutil umount /dev/$1
# 3. burn iso
sudo dd if=$2 of=/dev/r$1 bs=1m
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment