A lot of discussions exist here on making a bootable USB stick. Debian manual on installing Wheezy suggest the following:

# cp debian.iso /dev/sdX
# sync

Making sure the USB device is first unmounted.

Debian manual page.

I have done this in preparation to install wheezy. It seem to work, because the ISO image is all that is seen on the USB and usable size is that of the image. Remains to see if it will boot and so on.

Now, can somebody elaborate why this work. I thought a cp command like this is similar to a drag and drop, (apart from the USB being unmounted).


Devices in Linux are files. /dev/sda or /dev/sdb are files as well. So what you do is replace the /dev/sdX file with the dot-ISO file, which you can then mount and use as a device.

What sync does, is it forces the changed blocks on the virtual device (/dev/sda file) to be updated on the actual disk.

| improve this answer | |
  • 2
    So the magic part of this is to perform the cp command on an unmounted device (file). It's like it was common knowledge when reading debian manual, and maybe it is? Anyway, it did work, my new machine booted the USB and wheezy installed, thanks. – Tompa Jul 18 '13 at 10:09

A possibly better way of doing it is with dd. which does byte copy. the syntax would be

dd if=debian.iso of=/dev/sdX

and the command will need to be run as root. dd allows you to have more control if you want it. Check out it's man page here or Debian instructions on how to create a bootable USB stick here.

(Where sdX maybe the full name of the drive, with the number, for instance /dev/sdc1.)

| improve this answer | |
  • And this command I guess is to be performed with a mounted device? – Tompa Jul 18 '13 at 10:09
  • @Tompa, actually it doesn't matter. It would probably be better to use an unmounted device because you are overwriting the entire partition structure that is formatted in say fat or ext3 or ntfs and replacing it with the cdrom or dvd format (usually UDF). If the operating system is writing to the filesystem while it gets overwritten it could be a bad thing. the block device /dev/sdx basically is a virtual file allowing binary access to the entire harddrive. – Mobius Jul 18 '13 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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