public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: L A Walsh <no-one@nowhere.com>
To: Pete Zaitcev <zaitcev@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 'dd' local works, but not over net, help as to why?
Date: Tue, 02 Oct 2001 11:18:40 -0700	[thread overview]
Message-ID: <3BBA0500.9135C05E@nowhere.com> (raw)
In-Reply-To: <mailman.1002009301.30795.linux-kernel2news@redhat.com> <200110021722.f92HMmt29193@devserv.devel.redhat.com>

Hmmm....well both are linux machines with kernels 2.4.10 and 2.4.9.
So I'm not specifying the count -- if the dd on the receiving machine gets
a short read for an 8M block, does that imply that it would write the
short data and pad with 0's?  If that's the case, I can see why it would
run out of space. I know Solaris had the known bug of non-integrity
of binary data transfer over rsh, but I know IRIX doesn't have that and
I've never run into it with linux using 'tar' (w/o the B option).  It
may be the first time I've tried this with 'dd' over the net and with 
such a large dataset.  Is the below output from linux2linux?  I thought
of compress/zcat, but it's a 100Mps local LAN w/little to no traffic, so
I know that almost any compression was going to slow down the xfer...

Y'd think that 'dd' would do what it is told and read the correct block
size rather than returning a 'short'.  Would one consider this a
possible "undesired feature" [bug] in 'dd', if that proves to be the
problem?  Seems like there should at least be a way to say for it to wait
for short blocks.  Hmph.

oh well.
thanks for all the pointers.
Linda



Pete Zaitcev wrote:
> 
> > dd if=/dev/hda2 bs=1M|rsh other-system of=/dev/sda2 bs=1M
> 
> That does not work on all unixes. Perhaps it does on IRIX,
> but certainly not on Solaris. The remote dd is going to
> get short reads from the socket. The telltale sign is the
> number to short records:
> 
> itcev@niphredil /boot]$ dd if=vmlinux-2.4.7-niph bs=8k | ssh pentabug dd of=xxx bs=8k
> 333+1 records in
> 333+1 records out
> 7+653 records in                <------- almost all are shorts
> 7+653 records out
> [zaitcev@niphredil /boot]$
> 
> There is no good way to deal with it, unless you use some external
> filter (perhaps netcat?). tar has a flag -B to deal with this.
> An oldtimer's trick is to use compress, which works because
> zcat uses stdio for output and its blocksize is fixed.
> 
> [zaitcev@niphredil /boot]$ dd if=vmlinux-2.4.7-niph bs=8k | compress | ssh pentabug "zcat |dd of=xxx bs=8k"
> 333+1 records in
> 333+1 records out
> 333+1 records in
> 333+1 records out
> [zaitcev@niphredil /boot]$
> 
> This behaviour of sockets on Linux is entirely normal, so deal with it.
> My pet peeve is how DaveM insists that WRITES to a socket may return
> short. That stupidity just makes me furious each time. A socket has
> a posix-schmozix "right" to return short, I agree.  But it is extremely
> rude and in the right implementation, it should not. It breaks just
> about _every_ application that uses printk.
> 
> -- Pete

--  -    _    -    _    -    _    -    _    -    _    -    _    -    _    -
L A Walsh, law at sgi dot com     | Senior Engineer
01-650-933-5338                   | Trust Technology, Core Linux, SGI

  reply	other threads:[~2001-10-02 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1002009301.30795.linux-kernel2news@redhat.com>
2001-10-02 17:22 ` 'dd' local works, but not over net, help as to why? Pete Zaitcev
2001-10-02 18:18   ` L A Walsh [this message]
2001-10-02  7:52 LA Walsh
2001-10-02  8:20 ` Matti Aarnio
2001-10-02  8:35   ` LA Walsh
2001-10-02  8:53     ` Matti Aarnio
2001-10-02  9:21 ` Alistair Riddell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BBA0500.9135C05E@nowhere.com \
    --to=no-one@nowhere.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zaitcev@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox