Creating a bootable USB disk

If you have something like a Linux image to put on an USB disk, do the following:

diskutil list # to determine the device you'll be copying to
diskutil unmountDisk /dev/diskN
sudo dd if=image.img of=/dev/diskN bs=1m
diskutil eject /dev/diskN

This does not work for all cases – only for those where the image contains a suitable bootloader, which is not the case for most Linux ISO images – but is also the basic technique way for doing full device images/backups (just pipe the I/O via gzip to save some space).

See Also: