How to create a linux bootable USB drive in Mac OSX using dd command

When you want to create a USB bootable drive, for booting a Linux distro for example. You will quickly learn that it is impossible to do in the disk utility tool. Especialy if you have an *.iso file, instead of a *.dmg file.

Luckily there is a commandline tool called "dd" u can use for this. This article discribes how to use this command for creating a bootable USB drive from a *.iso file.

Note: Maybe this is a bit redundant, but you need a USB drive that is at least equal to the size of your imagefile but preferably a little larger.

Lets get started. First insert your USB drive, it should automount the drive so you can see it in finder. Run the following command in terminal (Applications >> Utilities >> Terminal):

diskutil list

Your terminal output will look something like this:

/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            499.8 GB   disk0s2
/dev/disk1
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *8.0 GB     disk1
   1:                 DOS_FAT_32 USB                     8.0 GB     disk1s1

"disk0" being your machines harddrive and "disk1" being your USB drive. (in this example a 8gig USBdrive)

Note: Be sure you know what disk is the right one! If your not sure, eject the disk properly, run the command again, and see what disk is not showing now, but was showing earlier. The missing one is your USB drive. Insert your USB drive again and start over.

Now unmount the USB with the following command:
diskutil unmountDisk /dev/disk1

So we now have an inserted disk, which is unmounted in the filesystem. It shouldn't be visible in finder anymore, but it should still show in the "diskutil list" command.

The command that we are going to run next is pretty simple, but you have to watch out for typo's to prevent from overwriting something wrong.
dd if=/pathtoimagefile/imagefile.iso of=/dev/disk1 bs=1m

The command will run for a couple of minutes (around 5-10 minutes for a less than 1 gig imagefile).
Thats it! You are done.

Let me explain the command in more detail:

dd is the command itself and it needs some operands to specify what it must do.
if operand stands for input file, and need the absolute path to your imagefile. Example: "if=/pathtoimagefile/imagefile.iso"
of operand stands for output file, and needs the absolute path to your output file. In this case our output file is a device know by the system as "disk1" and it is in the "/dev" directory. Our example becomes: "of=/dev/disk1"
bs operand stands for block size, and needs the block size it uses to copy the image. Be sure to note, the smaller the block size, the longer it will take. It defaults to 512 bytes, but we use 1 megabyte to speed it up a little. Our example: "bs=1m"

Note: For some (corporate) reason Mac's wont boot these devices unless it contains OSX, so you will have to try it out on another kind of machine.

Tags
USB, OSX, Linux, bootable drive, dd, dd command, making a bootable drive on mac os x, mac, os x

Type: 
Operating System: