Create bootable USB in OSX

  29 Feb 2016

In Mac OS X, we’ll use diskutil and dd command to create a bootable usb.

First, list your disks to find out what your USB device is called:

$ diskutil list

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *4.0 GB     disk2
   1:                        EFI EFI                     209.7 MB   disk2s1
   2:                  Apple_HFS                         3.7 GB     disk2s2

We have /dev/disk2 for our usb device in this case.

And then, try to unmountDisk with diskutil:

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

Download image file, for example,

$ curl -O

And now, start copying the image into raw disk (the prefix r means raw disk which faster):

$ sudo dd if=CentOS-6.8-x86_64-LiveCD.iso of=/dev/rdisk2 bs=1m

  702+0 records in
  702+0 records out
  736100352 bytes transferred in 154.338170 secs (4769399 bytes/sec)

Also, eject the drive before physical removal:

$ diskutil eject /dev/disk2

  Disk /dev/disk2 ejected

So, now you have a usb that is ready to boot!

comments powered by Disqus