Web lists-archives.com

Re: Some help with dd backing up into an iso




On Tue 07 Mar 2017 at 10:55:01 (+0200), Teemu Likonen wrote:
> tomas@xxxxxxxxxx [2017-03-07 09:35:06+01] wrote:
> 
> > dd comes in handy whin you know how much to copy. So this idiom makes
> > sense
> >
> >   dd if=/dev/zero of=lotsofnull bs=1024 count=1024 # copy 1M of zeros
> 
> That particular thing can be made faster without transferring any data:
> 
>     $ dd obs=1M count=0 seek=1 of=file
>     0+0 records in
>     0+0 records out
>     0 bytes (0 B) copied, 1,1289e-05 s, 0,0 kB/s
> 
>     $ ls -lh file
>     -rw-r--r-- 1 dtw dtw 1,0M 2017-03-07 10:52:14 file

In which case, why did you write:

"I don't know about you but many people seem to think that dd is some
kind of special tool for reading and writing block device files. But
after all the devices are just files that can be read with normal
commands like cat or cp."

Those clunky parameters you've used explain one of the reasons
for its being special. Here's another: the OP could have ascertained
how long the (reckless) second copy was going to take by typing
kill -USR1 <pid-of-dd>   to see how much had been copied so far.

Cheers,
David.