Write an ISO to USB on mac

Convert the ISO to UDRW format

hdiutil convert -format UDRW -o destination_file.img source_file.iso

You will notice that the destinationfile.img from the command will create the file destinationfile.img.dmg.

Prepare the USB stick

diskutil list

You will see a list of disks and partitions. The goal is to identify the USB stick in this output. Depending on your system configuration your output might look different from this one.

/dev/disk0 (internal):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                         251.0 GB   disk0
   1:                        EFI EFI                     314.6 MB   disk0s1
   2:          Apple_CoreStorage Macintosh HD            250.0 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3

/dev/disk1 (internal, virtual):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                  Apple_HFS Macintosh HD           +249.7 GB   disk1
                                 Logical Volume on disk0s2

/dev/disk2 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *8.0 GB     disk2
   1:                       0xEF                         4.0 MB     disk2s1
   2:                       0x17                         4.3 GB     disk2s2

Delete data from USB

With the following command the data on the disk (your USB stick) will be deleted!

diskutil partitionDisk /dev/disk2 1 "Free Space" "unused" "100%"

Copy the image to the USB stick

sudo dd if=destination_file.img.dmg of=/dev/disk2 bs=1m

The dd command does not show any output before it has finished the copy process, so be patient and wait for it to complete.

Safely eject USB

To eject the USB stick, use the following command

diskutil eject /dev/disk2