Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

dd is a wonder allowing you to duplicate a hard drive to another, completely zero a hard drive, etc. But once you launch a dd command, there's nothing to tell you of it's progress. It just sits there at the cursor until the command finally finishes. So how does one monitor dd's progress?

share|improve this question

5 Answers

The best is using http://dcfldd.sourceforge.net/ it is easy to install through apt-get

share|improve this answer
up vote 14 down vote accepted

from HowTo: Monitor the progress of dd

You can monitor the progress of dd without halting it by using the kill command.

To see the progress of dd once it's running, open another terminal and enter:

sudo kill -USR1 \`pgrep ^dd\`

This will display dd progress in the dd terminal window without halting the process. If you would like to get regular updates of the dd progress, then enter:

watch -n5 'sudo kill -USR1 \`pgrep ^dd\`'

watch will probe the dd process every -n seconds (-n5 = 5 seconds) and report without halting it.

Note the proper backticks and single quotes in the commands above.

share|improve this answer

If you have already started dd, and if you are writing a file such as when creating a copy of a pendrive to disk, you can use the watch command to constantly observe the size of the output file to see changes and estimate completion.

watch ls -l /pathtofile/filename
share|improve this answer
Also a viable method... – ObsessiveSSOℲ Dec 7 '12 at 21:59

Install pv and put it between input / output only dd commands.

Note: you cannot use it when you already started dd.

From the package description:

pv - Pipe Viewer - is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.

Installation

sudo apt-get install pv

Example

dd if=/dev/urandom | pv | dd of=/dev/null

Output

1,74MB 0:00:09 [ 198kB/s] [      <=>                               ]

You could specify the approximate size with the --size if you want a time estimation.

Other uses

You can also use it to output to stdout:

pv /home/user/bigfile.iso | md5sum

Output

50,2MB 0:00:06 [8,66MB/s] [=======>         ] 49% ETA 0:00:06

Note that in this case, pv recognizes the size automatically.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.