13

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).

Tompa
  • 233

3 Answers3

10

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.

Ashtray
  • 1,727
5

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.)

Philipili
  • 120
Mobius
  • 293
0

Another way of copying iso on usb stick is worth to mention here. With https://www.ventoy.net/ tool you just copy file(s) to stick to boot/reuse them.

TadejP
  • 126