OS X - Create Bootable Flash Drive

Easy, peasy....

  1. Download bootable ISO image file such as CentOS, gpartd, etc
  2. Backup flash drive (process will replace all data on it)
  3. Open Terminal
  4. List all devices
    Unknown macro: {newcode}

    $ diskutil list
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *298.1 Gi disk0
    1: EFI 200.0 Mi disk0s1
    2: Apple_HFS MacintoshHD 297.8 Gi disk0s2

  5. Insert flash drive and relist drives (look for difference). The main identifier (i.e., disk0) is what we're looking for, not the slices (e.g. disk0s1):
    Unknown macro: {newcode}

    $ diskutil list
    /dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *298.1 Gi disk0
    1: EFI 200.0 Mi disk0s1
    2: Apple_HFS MacintoshHD 297.8 Gi disk0s2
    /dev/disk2
    #: TYPE NAME SIZE IDENTIFIER
    0: FDisk_partition_scheme *970.0 Mi disk2
    1: DOS_FAT_16 NO NAME 969.7 Mi disk2s1

  6. In this case, we're dealing with disk2. Unmount the disk (watch command, case sensitive) and use the device path:
    Unknown macro: {newcode}

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

  7. Use dd to copy image to drive (be very careful of the device as this could destroy another drive):
    Unknown macro: {newcode}

    $ sudo dd if=gparted-live-0.4.5-2.iso of=/dev/disk2 bs=1m
    Password:
    98+0 records in
    98+0 records out
    102760448 bytes transferred in 37.683191 secs (2726957 bytes/sec)

  8. Eject the disk and verify:
    Unknown macro: {newcode}

    $ diskutil eject /dev/disk2
    Disk /dev/disk2 ejected
    $ diskutil list/dev/disk0
    #: TYPE NAME SIZE IDENTIFIER
    0: GUID_partition_scheme *298.1 Gi disk0
    1: EFI 200.0 Mi disk0s1
    2: Apple_HFS MacintoshHD 297.8 Gi disk0s2

  9. Go on, put the flash drive on a test machine and verify!
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.