4 ms·
> Unfortunately, there is no command-line option to have `dd` print progress How difficult could it be to write a dd command from scratch that does include pro
by amelius 11y ago
> Unfortunately, there is no command-line option to have `dd` print progress
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.
- itchyouch 11y ago`pv` (pipeviewer) is usually very useful for tracking progress. 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>
- jeffcox 11y agoThe aptly named "Progress" also works on dd. https://github.com/Xfennec/progress https://github.com/Xfennec/progress
- malcolmputer 11y ago> 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.
- deleted 11y ago[deleted]
- mvo 11y agoPretty easy: https://github.com/mvo5/godd https://github.com/mvo5/godd
- dmytrish 11y agoActually, you can send signal USR1 to a GNU `dd` process to see the progress: $ pgrep dd 22230 $ kill -USR1 22230 - and `dd` prints its progress.
- stewbrew 11y agoI guess you could pkill directly. Anyway, this "trick" is mentioned on the man page, which isn't that long. No additional tool required.
- kenko 11y agoHuh, on my laptop (running OSX) it's SIGINFO. Read the man pages!
- TazeTSchnitzel 11y agoIf you're on OS X, it's SIGINFO instead. SIGUSR1 will kill it D: (This has caught me out before. Oh how I wish these things were standardised...)
- dmytrish 11y agoIt seems to be a difference between GNU and BSD variants of `dd`.
- TazeTSchnitzel 11y agoYeah, OS X doesn't use the GNU one. It's irritating that there's a difference.
- rca 11y agothe dd on my machine (from the gnu coreutils 8.24) does just that with the 'status=progress' option. 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.
- BuildTheRobots 11y agoI tend to run `watch kill -USR1 $(pidof dd)` in a second terminal. Watch executes your command repeatidly (by default every two seconds) so you then get regular dd status updates.
- relaxitup 11y agoddrescue has built in progress reporting, plus you don't have to be bothered with if= and of= https://www.gnu.org/software/ddrescue/ https://www.gnu.org/software/ddrescue/