Check the Status of ‘dd’ Command

By | 2010/07/11

The other day I was copying the entire contents of one USB drive to another. To use this I used the dd command, as I needed the images to be identical. Once the copy started I started wondering about its progress, and was reminded that dd does not have any kind of progress bar or other status output. In this article I’ll outline how to output the status / progress of dd during a large copy.

A note about speed

Before I outline how to output the status of the dd command, I wanted to comment briefly on the speed of the dd reads/writes. The dd command allows you to specify the input file, output file, block size and count. I have found that not specifying the block size can have detrimental effects on the speed of your transfer. Currently I find the best performance specifying a 4k block size, the same as the default block size on ext file systems.

To specify this block size, use:

dd if=/source/file of=/dest/file bs=4k

Status of dd command

The quickest and easiest way I’ve found to check the status of the dd command is to run the following:

watch -n 10 killall -USR1 dd

There are, of course, other ways to find the result, but this is what I use. This command will report the status on any running dd process every 10 seconds. When the transfer is finished you can kill this reporting via ctrl-c.

3 thoughts on “Check the Status of ‘dd’ Command

  1. kris

    Really useful tip. Saved me a lot of guess-work for sure. It’s too bad that dd doesn’t have this functionality built it….

    Reply

Leave a Reply