View previous topic :: View next topic |
Author |
Message |
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Wed May 15, 2013 11:28 am Post subject: dd with progress?? |
|
|
hi,
it's unbelieveable that a program for such an important task has NO formal way of showing progress of the operation. Progress piece of code is widely used everywhere, should not be something hard to implement. Why dd doesn't have progress? dd's attitude is like 'it'll get done when it's done.", that doesn't help a lot. Everyone wants to know progress of a task completing.
How to use dd with a sane way of showing progress?
thanks. |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8711 Location: ~Brussels - Belgique
|
|
Back to top |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Wed May 15, 2013 12:07 pm Post subject: |
|
|
Quote: | Sending a USR1 signal to a running 'dd' process makes it print I/O statistics to standard error and then resume copying.
$ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid
18335302+0 records in
18335302+0 records out
9387674624 bytes (9.4 GB) copied, 34.6279 seconds, 271 MB/s |
awfull!! |
|
Back to top |
|
|
xaviermiller Bodhisattva
Joined: 23 Jul 2004 Posts: 8711 Location: ~Brussels - Belgique
|
Posted: Wed May 15, 2013 12:19 pm Post subject: |
|
|
dd is not a GUI tool. _________________ Kind regards,
Xavier Miller |
|
Back to top |
|
|
John R. Graham Administrator
Joined: 08 Mar 2005 Posts: 10591 Location: Somewhere over Atlanta, Georgia
|
Posted: Wed May 15, 2013 1:04 pm Post subject: |
|
|
From your perspective, perhaps, but it's highly consistent with the Unix philosophy. Almost all basic tools are silent when nothing bad is happening.
- John _________________ I can confirm that I have received between 0 and 499 National Security Letters. |
|
Back to top |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Wed May 15, 2013 1:07 pm Post subject: |
|
|
I wasn't asking for GUI tool. dd progress implementation is bizarre and mighty dangerous.
Why not something like rsync? Every music player on earth has progress, torrents have progress, sites have progress. How hard could it be to include a sane, built-in, option to show progress?
I don't get dd's way. I am supposed to KILL the process and then RESUME just to see the progress?? That looks ass backwards. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6053 Location: Removed by Neddy
|
Posted: Wed May 15, 2013 1:18 pm Post subject: |
|
|
the command "kill" just sends a signal to a process, it doesn't actually mean it kills it.
You are not killing dd and then resuming it when you send -USR1 to the dd process, you are informing dd to indicate its progress
kill by default send signal 7 SIGHUP, there is then kill 1 and kill 2 and the nasty nasty kill 9 ( SIGKILL)
the dd method is quite good. it doesn't have to sit there servicing any term I/O, it just has to deal with disk I/O ONLY when it is request will it then inform of its proces _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
yzh n00b
Joined: 25 Feb 2011 Posts: 53
|
Posted: Wed May 15, 2013 1:53 pm Post subject: |
|
|
use pipeviewer/pv:
Code: |
# pv test.bzImage | dd of=/tmp/test.img
12.9MiB 0:00:00 [ 106MiB/s] [============================================================================================================>] 100%
26434+1 records in
26434+1 records out
13534560 bytes (14 MB) copied, 0.130814 s, 103 MB/s
|
|
|
Back to top |
|
|
_______0 Guru
Joined: 15 Oct 2012 Posts: 521
|
Posted: Mon Oct 21, 2013 8:13 pm Post subject: |
|
|
yzh wrote: | use pipeviewer/pv:
Code: |
# pv test.bzImage | dd of=/tmp/test.img
12.9MiB 0:00:00 [ 106MiB/s] [============================================================================================================>] 100%
26434+1 records in
26434+1 records out
13534560 bytes (14 MB) copied, 0.130814 s, 103 MB/s
|
|
this one somehow did random chopping to the copy.
I've found one that takes the crown:
Code: | watch -n 60 killall -USR1 dd |
much user-friendly that dd's own man pages suggestion:
Code: | $ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid |
|
|
Back to top |
|
|
kurly Apprentice
Joined: 02 Apr 2012 Posts: 260
|
Posted: Mon Oct 21, 2013 8:56 pm Post subject: |
|
|
Inadvisable to use killall here. Linux is a multi-user OS, and there may be multiple instances of 'dd'. Saving off the PID (like in the man page) is the better way to handle this. |
|
Back to top |
|
|
Logicien Veteran
Joined: 16 Sep 2005 Posts: 1555 Location: Montréal
|
Posted: Tue Oct 22, 2013 4:13 am Post subject: |
|
|
I am surprise that the command dcfldd have not been mention here. It show a basic progress status by default.
Code: | eix -sv dcfldd
* sys-apps/dcfldd
Available versions: 1.3.4.1
Best versions/slot: 1.3.4.1
Homepage: http://dcfldd.sourceforge.net/
Find open bugs: http://bugs.gentoo.org/buglist.cgi?quicksearch=sys-apps%2Fdcfldd
Description: enhanced dd with features for forensics and security
License: GPL-2 |
A lot of pipe utilities are available in portage too.
Code: | eix -cs pipe
[N] app-arch/zpipe (~2.01): Pipe compressor/decompressor for ZPAQ
[N] app-benchmarks/pipebench (0.40): Measures the speed of stdin/stdout communication
[N] app-crypt/aespipe (2.3e): Encrypts data from stdin to stdout
[N] app-misc/pipeworks (0.4): a small utility that measures throughput between stdin and stdout
[N] app-misc/tpipe (1.6): Command to duplicate standard input to more than one program
[I] dev-libs/libpipeline (1.2.3@22/09/2013): a pipeline manipulation library
[N] dev-ml/pipebang (~109.28.00(0/109.28.00)): Syntax extension to transform x |! f into f x
[N] dev-perl/IO-Pipely (~0.005.0): Portably create pipe() or pipe-like handles, one way or another.
[N] dev-python/django-pipeline (1.2.9): An asset packaging library for Django
[N] games-puzzle/pipepanic (0.1.3): A simple pipe connecting game
[N] games-puzzle/pipewalker (0.9.4): Rotating pieces puzzle game
[N] net-misc/datapipe (~1.0-r1): bind a local port and connect it to a remote socket
[N] net-misc/netpipe (~1.0.0_beta2-r1): tool to reliably distribute binary data using UDP broadcasting techniques
[N] net-misc/netpipes (4.2-r1): netpipes - a package to manipulate BSD TCP/IP stream sockets
[N] net-misc/pipes (~1.16.1): Very versatile TCP pipes
[N] net-proxy/piper (~1.14): Piper (a tool for manipulating SOCKS5 servers)
[N] sci-chemistry/xyza2pipe (~20101129): Cross conversion environment of NMR spectra
Found 17 matches. |
_________________ Paul |
|
Back to top |
|
|
|