[OpenIndiana-discuss] Problems with netcat zfs receive

Florian florian at acw.at
Mon Sep 10 19:55:21 UTC 2012


Hello,

I want to switch from zfs send and receive with ssh todo it with netcat.

The send and receive process works without problems, but netcat won't work.

Server A is oi151a6-1
Server B is oi151a5-2

I use netcat with these commands:
Server A:
/root at oi151a6-1:~# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
...
tank/raid1-2 at replication_09-09-12-19:40:00 0 - 16K -
tank/raid1-2 at nc_test05 0 - 16K -/

Snapshot /tank/raid1-2 at replication_09-09-12-19:40:00/ exists already on 
Server B (received over ssh)

/root at oi151a6-1:~# ssh -n -f 192.168.10.201 "/usr/bin/nc -l -p 1337 | 
/usr/sbin/zfs receive -F tank/raid1-2"/

With the previous command, I can see the netcat process on Server B:
/root at oi151a5-2:~# ps auxww | grep nc
root 838 0.0 0.1 2052 1380 pts/1 S 21:14:42 0:00 grep nc
root 805 0.0 0.2 3664 2384 ? S 21:14:14 0:00 bash -c /usr/bin/nc -l -p 
1337 | /usr/sbin/zfs receive -F tank/raid1-2
root 806 0.0 0.1 2124 1144 ? S 21:14:14 0:00 /usr/bin/nc -l -p 1337/

On Server A:
/root at oi151a6-1:~# zfs send -I 
tank/raid1-2 at replication_09-09-12-19:40:00 tank/raid1-2 at nc_test05 | nc 
192.168.10.201 1337/

This exits with the following error:
cannot receive: failed to read from stream

This is only a testing server, so I enabled the user root and enabled 
root login for sshd.

Can someone please help me with my problem? I never used netcat, so I am 
a real beginner.

The funny thing is, when I issue the commands on the local servers, it 
works without problems!
Server B:
/root at oi151a5-2:~# ///usr/bin/nc -l -p 1337 | /usr/sbin/zfs receive -F 
tank/raid1-2

Server A:
//root at oi151a6-1:~# //zfs send -I 
tank/raid1-2 at replication_09-09-12-19:40:00 tank/raid1-2 at nc_test05 | nc 
192.168.10.201 1337

/Result on Server B:
/root at oi151a5-2:~# zfs list -t snapshot
NAME USED AVAIL REFER MOUNTPOINT
...
tank/raid1-2 at replication_09-09-12-19:40:00 0 - 16K -
tank/raid1-2 at nc_test05 0 - 16K -/


Best regards
Florian



More information about the OpenIndiana-discuss mailing list