How difficult could it be to write a dd command from scratch that does include progress-reporting? I mean, dd is simply reading blocks of data from one file descriptor and writing them to another.
How difficult could it be to write a dd command from scratch that does include progress-reporting? I mean, dd is simply reading blocks of data from one file descriptor and writing them to another.
dd if=/dev/zero count=10 bs=1M | pv > file.bin
The other way to see progress on `dd` is to issue a signal 3 (USR1, iirc) to the dd process. kill -3 <dd pid>
Be careful with this on some distributions and compilations of DD. Purely anecdotal evidence, but in college I had a friend imaging a very large (5400RPM) drive and about 10 hours into the process he lamented that he wished he could see how far along it was.
I popped open a terminal, ps -A |grep dd, kill -USR1 $PID, and it just exited.
He was rather pissed that I lost him 10 hours.
$ pgrep dd
22230
$ kill -USR1 22230
- and `dd` prints its progress.Anyway, this "trick" is mentioned on the man page, which isn't that long. No additional tool required.
(This has caught me out before. Oh how I wish these things were standardised...)
dd if=/dev/zero of=/dev/null status=progress 4814691328 bytes (4,8 GB) copied, 4,000000 s, 1,2 GB
It's only the size copied and the speed but it's usually enough.