Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #181567
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: Trying to understand man page for dd |
| Date | 2017-05-29 17:20 +0200 |
| Message-ID | <tMuCC-1GC-31@gated-at.bofh.it> (permalink) |
| References | <tMh2F-MD-5@gated-at.bofh.it> <tMmlH-4pd-3@gated-at.bofh.it> <tMrEK-865-39@gated-at.bofh.it> <tMt3P-vP-9@gated-at.bofh.it> <tMtGx-13B-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon 29 May 2017 at 09:13:21 (-0500), Richard Owlett wrote:
> On 05/29/2017 08:36 AM, David Wright wrote:
> >On Mon 29 May 2017 at 06:59:23 (-0500), Richard Owlett wrote:
> >
> >>I think the is a subtle bug in the man page.
> >>I introduces the two lines of code saying:
> >> > Sending a USR1 signal to a running 'dd' process makes it print
> >> > I/O statistics to standard error and then resume copying.
> >>I believe that to accurately describe the code at
> >>
> >>https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html#dd-invocation
> >>*NOT* the code on the man page.
> >
> >The two lines you quote don't "introduce" anything. They describe
> >the action of dd when you send a USR1 signal to it, a primary
> >purpose of the man page.
> >
> >>I realize now that was the discrepancy that prompted my question.
> >>I had gone to the man page to double check syntax. Spotted the code
> >>a thought "a way to display progress information when copying".
> >>
> >>I can "sort of" understand syntactically correct code. The less said
> >>of my programming skills the better ;/ How I "read" the code just
> >>didn't jibe with the description.
> >>
> >>Am I correct that there is a problem with the man page?
> >
> >Not that I can see. A terse illustration of program output might
> >be seen as an infrequent but welcome addition to a man page.
> >However, others might prefer not to lengthen the man page (which
> >is a one chunk affair) with tutorials, or even examples,
> >preferring to leave that for info nodes or other more extensive
> >documentation.
> >
> >Cheers,
> >David.
> >
> >
>
> Not quite. It says "...and then resume copying."
> The script copies bytes until the second line is encountered.
> It outputs data and *STOPS DEAD*
> richard@stretch-2nd:~$ dd if=/dev/zero of=/dev/null& pid=$!
> [1] 3600
> richard@stretch-2nd:~$ kill -USR1 $pid; sleep 1; kill $pid
> 53590611+0 records in
> 53590610+0 records out
> 27438392320 bytes (27 GB, 26 GiB) copied, 21.6988 s, 1.3 GB/s
> richard@stretch-2nd:~$
With respect, dd does not stop after printing out the statistics.
It carries on running exactly as the man page specifies.
You can demonstrate this for yourself by a small modification
of the final command: send the signal INT instead of TERM:
$ dd if=/dev/zero of=/dev/null& pid=$!
[1] 12121
$ kill -USR1 $pid; sleep 1; kill -INT $pid
8113119+0 records in
8113118+0 records out
4153916416 bytes (4.2 GB) copied, 10.6885 s, 389 MB/s
$ 8895227+0 records in
8895226+0 records out
4554355712 bytes (4.6 GB) copied, 11.714 s, 389 MB/s
← I pressed <RETURN>
[1]+ Interrupt dd if=/dev/zero of=/dev/null
$
So 0.4GB was copied during the one-second sleep because dd resumed
copying.
Alternatively, because there's no cost associated with typing
extra lines on your terminal, type the following, slowly:
$ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid
$ kill -USR1 $pid
$ kill -USR1 $pid # until you are convinced
$ kill -USR1 $pid
$ kill $pid
Once again, you've tried to overinterpret this:
Sending a USR1 signal to a running 'dd' process makes it print
I/O statistics to standard error and then resume copying.
as a description of this:
$ dd if=/dev/zero of=/dev/null& pid=$!
$ kill -USR1 $pid; sleep 1; kill $pid
It isn't. It's a description of the behaviour of dd.
Cheers,
David.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Trying to understand man page for dd Richard Owlett <rowlett@cloud85.net> - 2017-05-28 14:00 +0200
Re: Trying to understand man page for dd JPlews <jw@plews.org.uk> - 2017-05-28 14:10 +0200
Re: Trying to understand man page for dd Richard Owlett <rowlett@cloud85.net> - 2017-05-28 14:30 +0200
Re: Trying to understand man page for dd Ulf Volmer <u.volmer@u-v.de> - 2017-06-02 00:00 +0200
Re: Trying to understand man page for dd Curt <curty@free.fr> - 2017-06-03 14:00 +0200
Re: Trying to understand man page for dd The Wanderer <wanderer@fastmail.fm> - 2017-05-28 14:10 +0200
Re: Trying to understand man page for dd Richard Owlett <rowlett@cloud85.net> - 2017-05-28 14:30 +0200
Re: Trying to understand man page for dd "Thomas Schmitt" <scdbackup@gmx.net> - 2017-05-28 14:50 +0200
Re: Trying to understand man page for dd Richard Owlett <rowlett@cloud85.net> - 2017-05-28 15:00 +0200
Re: Trying to understand man page for dd David <bouncingcats@gmail.com> - 2017-05-29 02:50 +0200
Re: Trying to understand man page for dd "Thomas Schmitt" <scdbackup@gmx.net> - 2017-05-29 08:30 +0200
Re: Trying to understand man page for dd Richard Owlett <rowlett@cloud85.net> - 2017-05-29 14:10 +0200
Re: Trying to understand man page for dd David Wright <deblis@lionunicorn.co.uk> - 2017-05-29 15:40 +0200
Re: Trying to understand man page for dd Richard Owlett <rowlett@cloud85.net> - 2017-05-29 16:20 +0200
Re: Trying to understand man page for dd "Thomas Schmitt" <scdbackup@gmx.net> - 2017-05-29 17:20 +0200
Re: Trying to understand man page for dd David Wright <deblis@lionunicorn.co.uk> - 2017-05-29 17:20 +0200
Re: Trying to understand man page for dd David <bouncingcats@gmail.com> - 2017-05-30 04:30 +0200
Re: Trying to understand man page for dd mbroe@oakland.edu - 2017-05-31 15:20 +0200
csiph-web