27 May 2004

Show progress of dd

Posted by Jacob Emcken

Here is a perl code example which shows progress of dd made by my friend Thor Dreier:

sdd if=/boot.img.gz of=/dev/sda -pg bs=1M 2>&1 | perl -e 'print $i++." MB\n" while(read(STDIN,$c,3));'

4 Comments to Show progress of dd

wdef
May 13, 2009

Doesn’t work. Is there a typo?

bash: syntax error near unexpected token `&’

wdef
May 13, 2009

Hang on – this is sdd, not dd.

However I still can’t see what 2&gt is supposed to be doing from man sdd

Can someone explain this?

Jacob Emcken
May 27, 2009

@wdef

After migrating my blog from Serenditpity to WordPress it messed with some of my examples… I’ve corrected the code now. Please try again

fantomas
August 7, 2011

it causes redirect stderr to the same file handle as stdout.

Leave a comment