lkml.org 
[lkml]   [2001]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.053 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site