0

I am looking for a way to put zeros and burn myiso.iso in parallel.

The command

dd if=/dev/zero of=/dev/sdb && (sleep 1; dd if=myiso.iso of=/dev/sdb)

should be ok since the speed at which zeros are written is inferior to the speed at which the iso is written.

How would you verify that the iso is written only after zeros are written?

  • 2
    "the speed at which zeros are written is inferior to the speed at which the iso is written" - what leads you to this conclusion ? – steve Oct 14 '16 at 21:53
6

If you're trying to ensure the USB key only contains the image and the remaining space is all zeros, you could do this instead:

cat myiso.iso /dev/zero > /dev/sdb

There doesn't seem to be much point in writing all zeros and then the image on top...

0

Your one-liner will execute commands sequentially and only if first dd finishes with return status of 0 (success). If you want to be sure ISO is written only after zeros are written, you have to run the commands sequentially.

dd if=/dev/zero of=/dev/sdb && dd if=myiso.iso of=/dev/sdb
  • 1
    Your command will also only write to /dev/sdb the second time if and only if the dd from /dev/zero terminates with a zero exit code. To run the second command unconditionally, use ; rather than &&. – DopeGhoti Oct 14 '16 at 21:59

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.