Is there any difference between doing i.e.
dd bs=4M if=archlinux.iso of=/dev/sdx status=progress oflag=sync or doing
cp archlinux.iso /dev/sdx && sync, and reason to use one over the other? (aside from the pretty progress bar in dd)
One difference is efficiency, and thus speed. For example, you could get the bytes one by one and copy them to the device, with
cat if it had the idealized implementation or in older systems, for example BSD4:
cat archlinux.iso > /dev/sdx
In these implementations
cat will move each byte independently. That is a slow process, although in practice there will be buffers involved. Note that modern
cat implementations will read blocks (see below).
dd and a good block size it will be faster.
cp it depends on the buffer size used by
cp (not under your control) and other buffers on the way. The efficiency lies between the idealized implementation of
dd with the optimum block size.
An analogy: it is like pouring the contents of a glass into another glass.
catwould do it one drop at a time.
ddwill use a spoon, and you define exactly how big the spoon is (system limits apply)
catwill use its own spoon (
stat -f -c %s filenamewill tell you how big it is).
I use it mainly because of the
status=progress you mentioned; what can I say, I am impatient and need to know :-)
Even if you forgot to add that and started the job, you can send it a SIGUSR1 signal and it will print the current I/O statistics to stderr (which, unless you redirected it, is your terminal).