Server Fault is a question and answer site for system and network administrators. 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'm having trouble figuring out how I would write an ISO disk image to a USB flash memory device from the command line in Ubuntu. I have the Startup Disk Creator utility, but I need to be able to script this job.

I found the usb-creator package, but there doesn't seem to be any documentation and python -m usbcreator gives usbcreator is a package and cannot be directly executed.

I looked at unetbootin, but it seems like another GUI-only utility.

Is there some obvious solution which I'm overlooking?

share|improve this question
up vote 12 down vote accepted

I know you can do this in UNetbootin gui. I haven't tried it myself, but it looks like you can do it by command-line, as well:

unetbootin method=diskimage isofile="my.iso" installtype=USB targetdrive=/dev/sdc1

share|improve this answer
^ the answer I was going to give. unetbootin automagically handles the necessary steps for moving most ISO files to USB media. – MikeyB Jul 27 '11 at 1:19
For me on Fedora Core 23 it launches unetbootin gui but with the settings provided on the command line. – Yaroslav Nikitenko Jan 18 at 17:23

Are you even sure if the ISO image will work on a USB device? Some ISOs which will boot if they are on a CD/DVD will not actually boot from a USB device.

Assuming the ISO you want has has a bootloader that will work, then it should be as simple as dd if=filename.iso of=/dev/usbdevice but this will replace anything that is currently on the USB disk.

If you wanted to place the ISO onto an existing filesystem on the USB drive and boot it, then setting it up may be a lot more complicated.

share|improve this answer
Nope, this is perfect; exactly what I needed. Thanks! – mikepurvis Jul 27 '11 at 19:23
Ack... not quite. This method loads the filesystem, but it doesn't seem to make the drive bootable the Startup Disk Creator tool does (with the same ISO). – mikepurvis Aug 1 '11 at 17:21
As I mentioned it does somewhat depend on what boot-loader is present on the ISO and how it is configured. Some images will work just by doing a dd, others will not. For example a Debian Live will work fine by using the dd method. To be sure you can try it, or read the docs for whatever iso you are talking about to see if it is supported. – Zoredache Aug 1 '11 at 17:26
@Zoredache to check if iso is bootable you can use file. If bootable, it will print bootable at the end of the output line. – Yaroslav Nikitenko Jan 18 at 17:28

From Linux there's a very easy way to create a bootable memory stick from an ISO image -- and this should work for any OS. Assuming the memory stick is /dev/sdb and the image is /home/username/Downloads/system.iso.

Just do this (as root):

dd if=/home/username/Downloads/system.iso of=/dev/sdb

Much easer than unetbootin or any other method I've heard of.

share|improve this answer
This assumes the bootloader is included in the iso, which is not generally the case. – mikepurvis Mar 25 '13 at 16:56
Only important step is to write of / outputfile to device, not a partition. I.e. of=/dev/sdb and NOT of=/dev/sdb1. (Just wanted to comment on this problem, nothing is wrong with your post :o)) – sjas Nov 26 '14 at 14:06

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.