3

I downloaded a Debian DVD and following the docs mounted a USB and simply did this:

cp /dev/sdb mydebiandvd.iso
sync

After running these commands I ran lsblk and found the sdb thumb drive said it had all space free.

But when I booted to the USB the Debian install screen popped up!

Is cp doing something special when I copied the ISO directly to the device (not just a partition on the device). Does it do something like run the dd command in the background? Really curious about what's actually happening here.

I believe sync just makes sure the USB isn't locked before it can be unmounted?

  • Your first command makes a block-level copy of your sdb disk into your current directory. Most probably it is not the right command to put a downloaded iso into an usb drive, I don't know where you found it but it is probably bad. If you want to write a downloaded iso into an usb drive, then use cat your-downloaded.iso >/dev/sdb, but before that check twice that really that sdb is your pendrive device! (It irrecoverably destroys anything on the sdb.) – peterh Apr 22 '17 at 22:42
  • lol it cant be that bad: debian.org/releases/jessie/amd64/ch04s03.html.en – user1028270 Apr 22 '17 at 23:14
  • Lol, if you switch the parameters of a command and don't notice the fault even for the second check, I can't predict a nice future for you in the command line world. – peterh Apr 22 '17 at 23:39
  • ah well that was a typo, it wouldnt even have worked if that was what i actually ran. I thought your objection was straight copying over piping the output like that- does piping it like that do the same thing? – user1028270 Apr 23 '17 at 0:28
  • 2
    Please edit your question fixing the serious mistake pointed out by peterh. Also, the linked documentation emphasizes that the stick must not be mounted during the copy operation, but you state you mounted it. Please clarify this as well. It isn't clear what your question is, but cp does not do anything special, and neither does dd. Either one would work for this purpose when used correctly. – Ferenc Wágner Apr 23 '17 at 8:10
2

Yes , you can create a bootable USB using the command cp.

There is an answer from the official website (Frequently Asked Questions)

How do I write a CD/DVD/BD image to a USB flash drive?

On a Linux machine, simply use the "cp" command, to copy an image to a USB flash drive:

cp <file> <device>

Alternatively you can also use "dd":

dd if=<file> of=<device> bs=4M; sync

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.