Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #181566

Re: Trying to understand man page for dd

From "Thomas Schmitt" <scdbackup@gmx.net>
Newsgroups linux.debian.user
Subject Re: Trying to understand man page for dd
Date 2017-05-29 17:20 +0200
Message-ID <tMuCB-1GC-15@gated-at.bofh.it> (permalink)
References <tMtGx-13B-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

Richard Owlett wrote:
> Am I correct that there is a problem with the man page?

Not with that example. It works as to be expected from the description.
The example in the coreutils manual gives a better motivation why one
would want to send USR1 signals to the running dd process.


> The [example] script copies bytes until the second line is encountered.
> It outputs data and *STOPS DEAD*

That's because the second kill command sent the default signal TERM,
which other than USR1 causes dd to end.
Without the final
  kill $pid
the dd process would run in background until you shut down your computer.

If you send more USR1 by

  kill -USR1 $pid

before the TERM signal then you get more output lines with increasing
byte counts:

  106330856+0 records in
  106330856+0 records out
  54441398272 bytes (54 GB) copied, 21.859 s, 2.5 GB/s
  113139254+0 records in
  113139254+0 records out
  57927298048 bytes (58 GB) copied, 23.2586 s, 2.5 GB/s
  121925708+0 records in
  121925707+0 records out
  62425961984 bytes (62 GB) copied, 25.0622 s, 2.5 GB/s

That you get
  richard@stretch-2nd:~$
from the kill command line does not actually mean that the dd process
has ended (although it has in this special case). This is because of
the ampersand at the end of the dd command.

But the next shell command line after the end of the dd process should
report its demise before the commands in that line get executed:

  [1]+  Terminated              dd if=/dev/zero of=/dev/null


Further you may check by

  ps -ef | fgrep 'dd if=/dev/zero'

whether the process is still running. If so, you will see an output
line like

  thomas   12084  1716 99 17:06 pts/8    00:00:03 dd if=/dev/zero of=/dev/null

where 12084 is the process id number of the dd run.


Have a nice day :)

Thomas

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


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