Skip to content

Instantly share code, notes, and snippets.

@jyap808
Created February 19, 2014 00:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jyap808/9083330 to your computer and use it in GitHub Desktop.
Save jyap808/9083330 to your computer and use it in GitHub Desktop.
Create a bootable USB stick on OS X

##Create a bootable USB stick on OS X

Convert the .iso file to .img using hdiutil

Note: OS X tends to put the .dmg ending on the output file automatically.

$ hdiutil convert -format UDRW -o target.img source.iso
Reading Master Boot Record (MBR : 0)…
Reading Ubuntu 13.10 i386                (Apple_ISO : 1)…
Reading  (Windows_NTFS_Hidden : 2)…
................................................................................................................................................................................
Elapsed Time:  8.877s
Speed: 100.8Mbytes/sec
Savings: 0.0%
created: target.img.dmg

Run diskutil again and determine the device node assigned to your flash media (e.g. /dev/disk2).

$ diskutil list
…
/dev/disk2
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *8.0 GB     disk2
   1:                 DOS_FAT_32 UNTITLED 1              8.0 GB     disk2s1

Unmount

$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful

Use dd to copy over the image.

  • 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
$ sudo dd if=target.img.dmg of=/dev/rdisk2 bs=1m
895+0 records in
895+0 records out
938475520 bytes transferred in 221.171442 secs (4243204 bytes/sec)

Modified via: http://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment