I'm 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?
You need to use the pv command which allows you to see the progress of data through a pipeline. You need to install pv command as described here.
| Tutorial details | |
|---|---|
| Difficulty | Intermediate (rss) |
| Root privileges | Yes |
| Requirements | dd and pv |
| Estimated completion time | N/A |
Examples
WARNING! These examples may crash your computer and may result into data loss if not executed with care.Copy /dev/sda to to /deb/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
Sample outputs:
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
Sample outputs:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop













{ 4 comments… read them below or add one }
$ tmux
$ dd if=/dev/urandom of=/dev/null bs=16k count=100000
+
$ ps aux | grep dd
(show pid)
$ kill -SIGUSR1 (pid)
$ tmux attach
65260+0 enregistrements lus
65259+0 enregistrements écrits
267300864 octets (267 MB) copiés, 16,5587 s, 16,1 MB/s
OR you could use dcfldd, if your distro/OS has it (Debian does). The awkward acronym stems from it being the Department of Defense Computer Forensics Lab’s version of dd.
or try dcfldd, the Department of Defense Computer Forensics Lab’s dd.
killall -USR1 dd