HomeContact
Computerz
Showing progress during dd copy
René Dohmen
October 11, 2010
1 min

dd is a popular, generic command-line tool for copying files from 1 location to another. It is often used to copy entire disk images.

Like many Linux command line tools, it operates silently unless something unexpected happens. Its lack of visual progress feedback is a nice feature for scripting. However, it can leave you wondering about its progress if you are interactively dd-copying a large disk.

To illustrate, you run the following (valid, but perhaps not very useful) dd copy:

It will run for a few minutes as it copies (and immediately discards) 100 blocks of randomly generated data, each of size 1 KB.

To get a progress report while dd is running, you need to open another virtual terminal, and then send a special USR1 signal to the dd process.

First, find out the process id of the dd process by running the following in the new virtual terminal.

\$ pgrep -l ’\^dd\$’

To send the USR1 signal to the dd process:

\$ kill -USR1 8789

Note that as soon as the USR1 signal is detected, dd will print out the current statistics to its STDERR.

On OSX this will NOT work, an easy workaround:

\$ killall -INFO dd

After reporting the status, dd will resume copying. You can repeat the above kill command any time you want to see the interim statistics. Alternatively, you can use the watch command to execute kill at a set interval.


Related Posts

Working with git submodules
October 15, 2023
3 min
© 2024, All Rights Reserved.
Powered by formatics

Quick Links

Advertise with usAbout UsContact Us

Social Media