dd is a wonder. It lets you 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 its progress. It just sits there at the cursor until the command finally finishes. So how does one monitor dd's progress?
|
|
||||
|
Update 2016: If you use GNU coreutils >= 8.24 (default in Ubuntu Xenial 16.04 upwards), see method 2 below for an alternate way to display the progress. Method 1: By using
|
|
|||
|
Note that the parameters for "dd" are appropriate in the first half (the input part of the pipe):
dd if=/dev/zero bs=1M count=35000 | pv | dd of=VirtualDisk.raw.
– Sopalajo de Arrierez
Mar 28 '14 at 0:05
|
||
|
pv bigfile.iso | dd of=VirtualDisk.raw bs=1M count=35000 works, verified. @SopalajodeArrierez, parameters can be given in the second dd.
– SiddharthaRT
Oct 20 '14 at 12:17
|
||
|
using
pv < /dev/sda > /dev/sdb seems to get better speed (source)
– Nicola Feltrin
Feb 20 '15 at 13:30
|
||
|
FYI on speed. Tests on my computer with Samsung 840 PRO SSD:
dd if=/dev/urandom | pv | of=/dev/sdb gives ~18MB/s write, dd if=/dev/zero | pv | of=/dev/sdb gives ~80MB/s, and plain old dd if=/dev/zero of=/dev/sdb gives ~550MB/s (close to SSD max write speed). All with bs=4096000.
– Tedd Hansen
May 7 '16 at 21:18
|
|
From HowTo: Monitor the progress of dd You can monitor the progress of dd without halting it by using the To see the progress of
This will display If you would like to get regular updates of the
Note the proper single quotes in the commands above. |
|||||||||||||||||||||
|
|
A few handy sample usages with First you will need to install
Then some examples are:
Note: the first sample is 5 characters less typing then And my favorite for cloning a disk drive:
source: http://www.cyberciti.biz/faq/linux-unix-dd-command-show-progress-while-coping/ Also for archiving myself. |
|||||||||||||||||||||
|
|
Use Ctrl+Shift+T while
|
|||||||||||||||||||||
|
|
For the sake of completeness: Version 8.24 of the GNU coreutils includes a patch for dd introducing a parameter to print the progress. The commit introducing this change has the comment:
Many distributions, including Ubuntu 16.04.2 LTS use this version. |
|||||||||||||||||
|
|
The best is using http://dcfldd.sourceforge.net/ it is easy to install through apt-get |
|||||||||||||
|
|
Native progress status was added to dd!!! The new version of Coreutils (8.24) adds a progress status to the Usage on Xubuntu 15.10: Open a terminal and type these commands:
Run
You will see: Bytes, seconds and speed (Bytes/second). To check the versions of Native:
New:
|
||||
|
|
|
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.
To see only file size (h-human view):
|
|||||||||
|
|
The I would avoid pv on anything large, and (if using Bash): Control-Z the dd process
where process_id is the process id you observed. Hit Control-C when you see something like:
You are done. Edit: Silly Systems Administrator! Automate your life, don't work! If I have a long dd process that I want to monitor, here's a one-liner that will take care of the whole enchilada for you; put this all on one line:
You can, of course, script it, perhaps make $1 your input file and $2 your output file. This is left as an exercise for the reader. Note that you need that little sleep before the kill or the kill may die trying to send a signal to dd when it's not ready yet. Adjust your sleeps as desired (maybe even remove the second sleep altogether). Bash- FTW! :-) |
|||||||||||||||||||||
|
|
http://linuxcommando.blogspot.com/2008/06/show-progress-during-dd-copy.html Basically:
|
|||||
|
On Ubuntu 16.04Ubuntu 16.04 comes with dd (coreutils) Version 8.25 . Hence the option To use it, just add Example :
Gives the status as
|
|||
|
|
|
I have created bash wrapper over
Source:
|
|||||||||
|
Easiest is:
|
|||||
|
|
So today I got a little frustrated with trying to run
Now just use The only downside is that the command doesn't return immediately when dd completes; so it's possible that this command can keep you waiting an extra 5s after dd returns before it notices and exits. |
|||
|
|
|
As mentioned above, at least with the 'dd' from GNU coreutils, or busybox, it will respond to a USR1 signal by printing progress info to stderr. I wrote a little wrapper script for dd that shows a nice percent-complete indicator, and tries to not interfere with dd's process or way of functioning in any way. You can find it on github: http://github.com/delt01/dd_printpercent Unfortunately, this SIGUSR1 trick only works with either GNU dd (from the coreutils package) or busybox's 'dd' mode with that specific feature enabled at compile time. It doesn't work with the stock 'dd' included with most BSD systems, including FreeBSD and OS X ... :( |
|||
|
|
|
I really like ddrescue, it works as dd but gives output and doesn't fail on errors, on the contrary it has a very advanced algorithm an tries really hard to do a successful copy... There are also many GUIs for it Project: https://www.gnu.org/software/ddrescue Wikipedia: https://en.wikipedia.org/wiki/Ddrescue |
|||
|
|
protected by Community♦ Mar 13 '17 at 5:43
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?



status=progress, not the other way around. – Ryan Pendleton Jul 20 '16 at 13:36status=progressparameter, as described in phoibos's answer below. – mwfearnley Jul 20 '16 at 13:57