Create bootable USB drive using the OS X terminal

Thursday, May 28, 2009 ·

This is a TIP supported post. If you found this post useful consider leaving Doc a tip. The suggested Tip amount for this post is 25¢ to 75¢. Use the button below to tip Doc.




I frequently hack around with live images of other OSs and install them on my Acer Aspire One netbook (I still haven't located a distro that I like). Instead of burning CD images, I have found that bootable USB drives are faster and more reliable. Here's how to create a bootable USB drive using OS X and a couple of terminal commands (WARNING: Performing these steps will completely erase the contents of your USB drive). Remember, you need a USB drive large enough to hold the image contents. Let's burn an image using the following steps found after the click:



Download an image to your Desktop
:: Locate an a disk image you want boot from USB
:: If you're experimenting, Google these distros: Moblin, Fedora 10, Ubuntu, CentOS, Mandriva - remember, you are looking for live bootable images usually in the .img format

Partition the USB drive
Note: Not all USB drives are created equally. Some will function as bootable drives and some will not. You may have to experiment with different brands before you find one that works. I have found that often cheaper, no-brand drives work the best. My trusty Kodak 2Gb USB Drive works for most applications, but I make no guarantees for your application.

:: Fire up the Disk Utility application
:: Select the options in order and as shown in the image below (click for larger view)
Create a bootable USB drive
:: Click the Apply button (READ WARNING AGAIN!!!) - the disk will be partitioned as free space and with no file format

Determine the USB drive device name

:: Insert the USB drive into one of the USB slots
:: Fire up the Terminal (I prefer the free iTerm)
:: In ther Terminal type:
diskutil list
:: A list of all devices will be displayed as shown in the image below
:: Locate the USB drive inserted and jot this info to paper or brain - in this example, highlighted below, the USB drive inserted is /dev/disk2 and was identified by the USB drive name

Write an Image file to a USB drive using Mac OS X

Unmount the USB drive

:: In the Terminal, type the following command
sudo umount /dev/disk2
:: Enter the system password and press Return
:: DO NOT PHYSICALLY REMOVE THE DRIVE!

Burn the image to the USB drive
:: In the Terminal, use the dd command using the following format:
sudo dd if=location/name.img  of=/dev/disk2
:: In this example the command was formatted as follows:
sudo dd if=/Users/stevencombs/Desktop/karmic-netbook-remix-i386.img  of=/dev/disk2
:: OS X will begin burning the image to the USB drive (as indicated by the flashing USB drive light) - this operation can take several minutes depending on the .img size and the write speed of the USB drive - once complete, the light will stop flashing the the terminal prompt will reappear
:: Remove the USB drive

The USB drive is now ready for booting on a laptop or desktop using the USB boot option. This same process can be used for most linux distributions. What I have not determined is how to easily do this with an .iso file on a Mac. So if you have a tip for me regarding this process, drop me a comment and add to these notes.

Technorati Tags: , , , , , , , , , ,

6 additional notes:

chadafentress said...
Sunday, June 7, 2009 10:21:00 PM CDT  

you don't need to choose GUID from the options menu first?

Anonymous said...
Friday, October 16, 2009 5:39:00 PM CDT  

This is the best explanation of the process I've seen, thanks

Steven "Doc" Combs, Ph.D. said...
Saturday, October 17, 2009 9:30:00 AM CDT  

Thanks Anonymous. That's what I try and do...make sense out of all of this so anyone can figure it out.

----------
:: Steven "Doc" Combs, Ph.D.
:: http://www.docstechnotes.com
:: http://feeds2.feedburner.com/DocsTechNotes
:: steven@docstechnotes.com

Ivan Storck said...
Wednesday, November 4, 2009 12:16:00 AM CST  

What it it's in .iso format instead of .img ?

Anonymous said...
Thursday, December 31, 2009 12:30:00 AM CST  

I agree with the above poster: this is the best article on this topic that I have found.
Thanks, Steve!

Anonymous said...
Friday, March 12, 2010 1:23:00 PM CST  

http://www.youtube.com/watch?v=yet-7pmdwUQ

Post a Comment

Follow Doc

Subscribe via Email Subscribe via RSS

Follow Doc on FriendFeed

Learn Something? Tip Doc.

Recommended