Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get messed up on step #3, how do I turn it into a .img file? Also would like help with rest of instructions pls

share|improve this question
Can you please provide us with a link to the instructions you are following? We have no way of knowing what "step #3" is. – Nathan Osman Feb 15 '13 at 5:23
@GeorgeEdison It's almost certainly this procedure. So while an an edit clarifying this would be helpful, we don't need to close this. – Eliah Kagan Feb 15 '13 at 6:11

I presume you're having trouble with step 3 of How to create a bootable USB stick on OS X, which says you should run

hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso

with appropriate substitutions for filenames. It also notes:

OS X tends to put the .dmg ending on the output file automatically.

You opened the Terminal (sometimes called, and located in the Utilities subfolder of the Applications folder), so you can enter commands. Suppose you downloaded the ISO image to your Downloads folder. Suppose further (for this example) that it is the 64-bit Mac image of Ubuntu 12.10. That file is called ubuntu-12.10-desktop-amd64+mac.iso. (If it's not that, just get its name by looking at it in the Finder.)

You want to create ubuntu-12.10-desktop-amd64+mac.dmg from it, also in the Downloads folder.

~ represents your home folder (which on OS X is /Users/your-username). The / character is the directory delimiter--that means that an expression of the form X/Y means the folder called Y, which is a subfolder of the folder called X.

So, you will run:

hdiutil convert -format UDRW -o ~/Downloads/ubuntu-12.10-desktop-amd64+mac ~/Downloads/ubuntu-12.10-desktop-amd64+mac.iso

Alternatively, you could use the cd command to go into the Downloads folder, and then the hdiutil command you'd run would be shorter:

cd ~/Downloads
hdiutil convert -format UDRW -o ubuntu-12.10-desktop-amd64+mac ubuntu-12.10-desktop-amd64+mac.iso

But being able to specify the full paths is especially helpful if you want to create the DMG image somewhere other than where you downloaded the ISO image. For example, if you downloaded the ISO image to your Downloads folder but you want to make the ISO image on your desktop:

hdiutil convert -format UDRW -o ~/Desktop/ubuntu-12.10-desktop-amd64+mac ~/Downloads/ubuntu-12.10-desktop-amd64+mac.iso

The newly created file will probably have a .dmg suffix--if it does not, you can give it one. (You can just rename it in the Finder.) You can also move it wherever you like, so it doesn't much matter where you create it, so long as you know where you're creating it.

Subsequent Steps

In case you have any trouble with the later steps too, here's a bit of explanation.

The diskutil list command lists disks that are attached, but the output is pretty technical. You won't necessarily know what names, like disk1, disk2, ..., correspond to what disks. So you run diskutil list, then plug in your USB flash drive, then run diskutil list again. Whatever item is new in the list is your USB flash drive.

To write the newly created .dmg image to it properly, it's necessary that it be attached but unmounted. To achieve this, unmount it:

diskutil unmountDisk /dev/disk2

Unless the USB flash drive's name in the list really was disk2, make sure to replace the 2 with whatever other number is correct!

To write the .dmg file to the USB flash drive, assuming the file is called ubuntu-12.10-desktop-amd64+mac.dmg and located in your Downloads folder, I recommend running:

cd ~/Downloads
sudo dd if=ubuntu-12.10-desktop-amd64+mac.dmg of=/dev/rdisk2 bs=1m

Just make sure to replace the 2 with the correct number! If you put in the wrong number, you can write the image to the wrong drive, and it would overwrite whatever files are already there, destroying them!

Writing the image to the flash drive with dd is step 8 in the procedure. If problems occur, please refer to the procedure itself, which explains them. (If you get this far, you may well be able to follow along; but if you do have any more difficulty, please feel free to ask!)

The procedure explains how to properly eject the USB flash drive (it's not mounted, so there's no icon on the desktop to drag to the trash/eject icon in the dock), and how to boot your computer from it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.