How to Display dd Progress and dd.sh Script

Upgrading software on Linux / Android boards or devices often involves copying images to an SD card or microSD. In Linux, you’d usually do that with dd, a utility that provides binary copy of data to files or block devices. A typical command would be:


However, during the copy, dd does not show a progress bar by default. But dd actually supports progress report, as indicated in the manpage: you can run dd, and send USR1 signal to display the current progress once, and resume copying. Linux commando explains how to continuously return the progress. First run the dd command:


Open another terminal window to find out the process id:


And use the watch command to send USR1 at regular interval.


You should see dd progress in the first window every 10 seconds. It works, but the output is not very nice because dd will just output 3 lines at a time, and you’ll see something like:


I’ve recently come across a script (dd.sh) that handles all those steps for you, and display the progress nicely. First download it, and install it in your path:


Then use it just as you would with dd:

The last line is updated regularly, and shows transfer rate, as well as the estimated time to completion.

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
6 Comments
oldest
newest
LieDanG
LieDanG
11 years ago

Or you can just use dcfldd instead dd

Alex
Alex
11 years ago

Useful!! Thx

zoobab
11 years ago

With pv:

zoobab@buzek /home/zoobab [11]$ dd if=/dev/zero |pv|dd of=/dev/null bs=1M count=1000000
dd: warning: partial read (60416 bytes); suggest iflag=fullblock
^C2419864+0 records iniB/s] [ ]

Jason Kridner
11 years ago

@zoobab: +1 I just pipe through ‘pv’.

R
R
8 years ago

New version of coreutils (8.24) adding a status progress to dd tool:

Usage on Xubuntu 15.10:

Open terminal shell and type these commands:

wget ftp://ftp.gnu.org/pub/gnu/coreutils/coreutils-8.24.tar.xz
tar -xf coreutils-8.24.tar.xz
cd coreutils-8.24
./configure && make -j $(nproc)

Run dd as root:

sudo ./dd if=/dev/sdc of=/dev/sda conv=noerror status=progress

You will see: Bytes, Seconds and Velocity (Bytes/seconds)

To check versions of dd:

Native:

dd –version

New (cd coreutils-8.24/src):

./dd –version

Boardcon Rockchip and Allwinner SoM and SBC products