Updated 28 Feb 2014
Don't use UNetbootin! * dd * Using dd on Linux * Using dd on Mac OSX * Restore the USB drive * More dd commands that might come in handy
UNetbootin can be used on any Linux distribution or Windows to copy an ISO image to a USB device. However, Unetbootin overwrites syslinux.cfg, creating a USB device that does not boot properly. For this reason, Unetbootin is not the recommended way to create a bootable image.
dd is a Unix command whose primary purpose is to convert and copy a file. The GNU/Linux implementation of dd seems unfriendly, but it is a very powerful command able to do many different things.
On Unix-based systems, everything is a file, as the saying goes. Device drivers for hardware (such as hard disks) and special device files (such as /dev/zero and /dev/random) appear in the file system just like normal files; dd can read and/or write from/to these files, provided that function is implemented in their respective driver. As a result, dd can be used for tasks such as backing up the boot sector of a hard drive. dd can duplicate data across files, devices, partitions and volumes and also perform conversions on the data as it is copied.
Using dd is a fairly simple way to create a bootable USB drive. But be careful when using it. A small mistake such as reversing the input file and output file parameters or specifying the wrong path could result in the loss of some or all data on a disk.
Before proceeding, make sure the USB drive you will be using has no data on it that you need. Any data will be irrevocably destroyed.
Once the USB drive has completed its purpose it can be restored to full capacity and repartitioned.
Check the name of your USB drive using lsblk. If necessary, figure it out using dmesg | tail after mounting it. Then unmount it using umount. Run dd as follows, but replace sdx with the name of the device e.g. sdb. Make sure you get the name right!
Also, don't use sdx1, rather sdx. (An integer refers to an existing partition on the drive and not the drive itself.)
It may take a few minutes to complete depending on the size of the iso. And that's it!
When you insert your USB drive, OSX will automount it. Find its name using the diskutil command:
Be careful identifying the USB drive. You don't want to end up dd-ing the wrong device. One way to be sure is to mount the drive using mount and then dmesg | tail to check kernel info regarding what just happened. When you're ready, unmount the drive. Here we'll assume the USB drive is called disk2:
Here's the dd command:
Wait for the operation to complete and you're good to go. Eject the drive just to be sure before you physically remove it:
After you install Linux and you are done with the USB drive, you should zero out its first 512 bytes (meaning the boot code from the MBR and, in this case, the non-standard partition table) if you want to restore it to full capacity:
(Where sdx is a substitute for the device's real name.) Then use cfdisk or parted to create a new partition table and filesystem.
Backup the boot code and partition table record:
Restore just the partition table:
Zero the boot code, but not the partition table: