Linux dd Command Show Progress Copy Bar With Status

See all GNU/Linux related FAQ
I am using dd command for block level copy and just found out that there’s no built in way to check the progress. How do I use the Linux or Unix dd command while coping /dev/sda to /deb/sdb and display a progress bar when data goes through a pipe? How do I monitor the progress of dd on Linux?

Tutorial details
Difficulty level Intermediate
Root privileges Yes
Requirements Linux terminal
Category Disk space analyzers
OS compatibility AlmaLinux Alpine Arch BSD CentOS Debian Fedora Linux macOS Mint openSUSE Pop!_OS RHEL Rocky Stream SUSE Ubuntu
Est. reading time 4 minutes
The dd is a free and open source command-line tool for Linux, and Unix-like operating systems. It is mainly used to convert and copy files. Being a program mainly designed as a filter dd usually does not provide any progress indication. This page shows how to show progress copy bar on Linux operating system using GNU version of the dd command.

Linux dd Command Show Progress Copy Bar With Status

WARNING! These examples may crash your computer and may result into data loss if not executed with care. The nixCraft or author is not responsible for data loss.

You need to use gnu dd command from coreutils version 8.24 or above to use the following option. The syntax is as follows to show progress copy bar with dd command:
# dd if=/path/to/input of=/path/to/output status=progress
Let us pass the progress option to see periodic transfer statistics using GNU dd command:
# dd if=/dev/sda of=/dev/sdb bs=1024k status=progress

Linux monitor the progress of dd command

Gif.01: Linux monitor the progress of dd command

No need to use sudo. I used sudo because I was trying to read and clone a USB stick.

How do you monitor the progress of dd?

Here is another example. First, find out your USB device name using the grep command and hwinfo command:
$ grep -Ff <(hwinfo --disk --short) <(hwinfo --usb --short)
Output:

disk:
  /dev/sdc             SanDisk Ultra

You can also try the df command or mount command to identify mounted USB pen and hard drives under Linux. For example:
$ df -hT
$ mount

Next, unmount the device under Linux:
$ sudo umount /dev/sdc
Finally, write an iso image to USB device named /dev/sdc and monitor the progress of dd:
$ sudo dd if=openSUSE-Leap-15.1-DVD-x86_64.iso of=/dev/sdc bs=4M status=progress
Sample outputs:

2684354560 bytes (2.7 GB, 2.5 GiB) copied, 1 s, 2.7 GB/s    
967+1 records in
967+1 records out
4056940544 bytes (4.1 GB, 3.8 GiB) copied, 361.614 s, 11.2 MB/s

dd status=LEVEL options

Apart from the status=progress option, you can pass the following two options to fine tune the dd command outputs:

  1. status=noxfer : Suppresses the final transfer statistic. It will hide the transfer statistics as the last line of status output.
  2. status=none : Do not print the status output except for the error messages.

Use pv command monitor the progress of dd command and see status

Another option is to use pv command which allows you to see the progress of data through a pipeline. You need to install pv command as described here. Once installed, type the following commands to see the status bar. Please note that if standard input is not a file and no size was given with the -s option, the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving. It will also show average MB/s rate. Copy /dev/sda to to /dev/sdb:
# pv -tpreb /dev/sda | dd of=/dev/sdb bs=64M
OR
# pv -tpreb /dev/sda | dd of=/dev/sdb bs=4096 conv=notrunc,noerror

Fig.01: pv and dd in action

Fig.01: pv and dd in action

You can create a progress bar and display using the dialog command as follows:
$ (pv -n /dev/sda | dd of=/dev/sdb bs=128M conv=notrunc,noerror) 2>&1 \
| dialog --gauge "Running dd command (cloning), please wait..." 10 70 0

HowTo: Check The Status of dd Command In Progress under Unix like operating systems

Fig.02: Show the Status of dd Command in progress using pv and dialog command

Examples: Use gnu dd command from coreutils version 8.24 or above only

Here is another example from my Apple Mac OS X/MacOS:
$ sudo gdd if=ZeroShell-3.6.0-USB.img of=/dev/disk5 bs=1024k status=progress

Fig.03: GNU dd displaying progress

Fig.03: GNU dd displaying progress

How do you monitor the progress of dd on Linux?

If you are using an older version of dd or cannot install the pv command, try the following simple one-liner bash shell while loop/command:

## 1. first start dd as usual ##
sudo dd if=/dev/sdc of=/tmp/demo.img bs=4M
 
## 2. Open another terminal or tab ##
## 3. find pid of dd command ##
pidof dd              ### &lt;--- say pid is 21145
ps aux | grep -w dd
 
## 4. Run bash/sh while loop as follows ##
while sudo kill -USR1 21145 ; do sleep 10 ; done
 
## 5. Switch back to terminal where dd was started ##
Linux dd Command Show Progress Copy Bar With Status

Conclusion

The dd command is wonderful, and there are various ways to display a progress indicator with dd. You learned how to monitor the progress of dd using the inbuilt status=progress option to the dd command. Another option is to use the pv tool. Finally, you learned that how to show dd progress in Linux without using pv or status= progress option. See GNU dd man page documentation for more info using the man command on your local workstation:
$ man dd
$ man pv

🥺 Was this helpful? Please add a comment to show your appreciation or feedback.

nixCrat Tux Pixel Penguin
Hi! 🤠
I'm Vivek Gite, and I write about Linux, macOS, Unix, IT, programming, infosec, and open source. Subscribe to my RSS feed or email newsletter for updates.

19 comments… add one
  • Raymond Day Nov 29, 2017 @ 15:34

    It be nice to have something that says what the numbers mean wile copying. I am copying a 6TB to a 6TB and it’s been over a day and I guess it only about 4th way because it shows like this:
    $ dd if=/dev/sdc1 of=/dev/sdh1 bs=64k conv=noerror,sync status=progress
    2211815555072 bytes (2.2 TB, 2.0 TiB) copied, 93833 s, 23.6 MB/s

    So I guess the 2.2TB means it copy that much so fair and maybe the 2.0 TiB is how much it has to go? Not sure. Been looking to find this answer and have not found it yet.

    -Raymond Day

    • Mike Hodson Dec 14, 2020 @ 0:39

      2.2TB ‘Tera’bytes = 2.0 TiB, ‘Tebi’bytes.
      The difference is bits are by definition binary. Since computers came to be everything was measured in effectively multiples of powers of 2.

      Then marketing came in and said ‘well, metric is multiples of powers of 10, and we’ve been using these metric names forever to roughly approximate the order of magnitude for a given power-of-2 binary size. let’s keep using the metric names but instead properly count with 10s and make the drives sound the same size but in effect be physically able to to contain less 1s and 0s than the equivalent binary size’

      So the geeks said ‘this is wrong, we’ll make new terms that indicate the binary powers and not the metric terms.

      Thus became why we now have both the metric, 10^x sizes of ‘kilo’, ‘mega’, ‘giga’, ‘tera’, etc, along with the new binary 2^x sizes of ‘kibi’, ‘mebi’, ‘tebi’, ‘gibi’, etc ..
      The ‘bi’ means a binary size.
      1 ‘kilo’ byte is 1000 bytes. 1 ‘kibi’ byte is 1024.

  • Anonymous Feb 11, 2022 @ 20:46

    Thanks for this!!

  • Louise Salvage Sep 21, 2022 @ 4:33

    Useful command. I thought it was only meant for the GNU Coreutils, but it worked on macOS too (M1 version). <3

  • steve Nov 14, 2022 @ 6:33

    Start dd in a screen session and then you can come and go from the session using “ctl-a-d” to detach from it and then “screen -x” to reattach and monitor progress. I used ” pv -treb /dev/sdx | dd of=/dev/sdz” to create a progress bar in the screen session.

  • Anonymous Jul 27, 2023 @ 17:15

    sudo dd if=/dev/sda of=/dev/sdb bs=64K conv=noerror,sync status=progress

    You don’t need anything more than dd

  • linux 4 ever Nov 25, 2023 @ 2:39

    God Bless the Linux community and all the good people out there who made dd so us mortals could clone hard drives the easy way 🌤✞

  • Anonymous Apr 25, 2024 @ 14:05

    thank you. useful.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Your comment will appear only after approval by the site admin.