migrate to new zfs pool

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Let me step back a bit.
You need to use the IP address of the remote system. In your post I am confused:
ssh -i /data/ssh/replication root@IP_OF_REMOTE
 

Mlovelace

Guru
Joined
Aug 19, 2014
Messages
1,111
If both pools are on the same host, which it appears to be based on the OP, there is no reason to use SSH. In fact it will reduce the transfer rate substantially.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
If both pools are on the same host, which it appears to be based on the OP, there is no reason to use SSH. In fact it will reduce the transfer rate substantially.
You can't have two pools with the same name on the same system. This implies the remote pool has to be on a different physical system.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
I am using same pool name in different system, the old system ip is 192.168.10.180, the new one is 192.168.10.179
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
if I run
ssh -i /data/ssh/replication root@192.168.10.179, it will ask me the password. If I run cmd below, it didn't ask me the password, but the send/receive didn't work(didn't stop and no data was reflected in new pool)
Code:
zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2


you mentioned add it automatically, do you mean I should copy /data/ssh/replication the one in old system to new system?
The file containing the fingerprint is located on he remote system:
/root/.ssh/known_hosts
Comment the line with the corresponding source IP.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
I comment the line with the source ip. Same
root@freenas[~]# zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2 full send of zfsrz2@a estimated size is 12.1K full send of zfsrz2/share@a estimated size is 12.1K full send of zfsrz2/.system@a estimated size is 13.1K full send of zfsrz2/.system/configs-1e6cbdfb415748b98d868947a6e14a88@a estimated size is 12.1K full send of zfsrz2/.system/rrd-1e6cbdfb415748b98d868947a6e14a88@a estimated size is 97.1M full send of zfsrz2/.system/syslog-1e6cbdfb415748b98d868947a6e14a88@a estimated size is 123K full send of zfsrz2/.system/webui@a estimated size is 12.1K full send of zfsrz2/.system/cores@a estimated size is 12.1K full send of zfsrz2/.system/samba4@a estimated size is 1.18M full send of zfsrz2/bak@a estimated size is 12.1K full send of zfsrz2/pdata@a estimated size is 12.1K full send of zfsrz2/pdata/seafile@a estimated size is 12.1K total estimated size is 98.5M The authenticity of host '192.168.10.179 (192.168.10.179)' can't be established. ECDSA key fingerprint is SHA256:b7m0xo26eqsIAEnCbw79B/eLjInmlU1DFmg5eAamL3Q. No matching host key fingerprint found in DNS. Are you sure you want to continue connecting (yes/no)? TIME SENT SNAPSHOT TIME SENT SNAPSHOT 10:57:52 57.4K zfsrz2/share@a 10:57:53 57.4K zfsrz2/share@a 10:57:55 57.4K zfsrz2/share@a 10:57:56 57.4K zfsrz2/share@a 10:57:57 57.4K zfsrz2/share@a ^C
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I comment the line with the source IP. Same
root@freenas[~]# zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2 full send of zfsrz2/pdata/seafile@a estimated size is 12.1K total estimated size is 98.5M The authenticity of host '192.168.10.179 (192.168.10.179)' can't be established. ECDSA key fingerprint is SHA256:b7m0xo26eqsIAEnCbw79B/eLjInmlU1DFmg5eAamL3Q. No matching host key fingerprint found in DNS. Are you sure you want to continue connecting (yes/no)? TIME SENT SNAPSHOT
This is why you need to only run the ssh command alone. Not zfs send and receive, yet.
Because you didn't, the remote system which is asking about the authenticity as listed above on your output doesn't allow you to interract and accept the it, it fails.

RUN THIS AS IS:
ssh -i /data/ssh/replication root@192.168.10.179
You will get the following:

The authenticity of host '192.168.10.179 (192.168.10.179)' can't be established.
ECDSA key fingerprint is SHA256:b7m0xo26eqsIAEnCbw79B/eLjInmlU1DFmg5eAamL3Q.
No matching host key fingerprint found in DNS.
Are you sure you want to continue connecting (yes/no)?

enter "yes" and press enter.
Next time you enter the ssh commad, it should allow to get in without prompt.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
Thanks for your patient, Apollo. I ran the command ssh -i /data/ssh/replication root@192.168.10.179
And press "yes", input password, now I am in 192.168.10.179 shell.

I suppose I should go back to my old system(192.168.10.180), then run zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2 , is that correct ?
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
correct
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
still same, very strange
Connection to 192.168.10.179 closed. root@freenas[~]# zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2 full send of zfsrz2@a estimated size is 12.1K full send of zfsrz2/share@a estimated size is 12.1K full send of zfsrz2/.system@a estimated size is 13.1K full send of zfsrz2/.system/configs-1e6cbdfb415748b98d868947a6e14a88@a estimated size is 12.1K full send of zfsrz2/.system/rrd-1e6cbdfb415748b98d868947a6e14a88@a estimated size is 97.1M full send of zfsrz2/.system/syslog-1e6cbdfb415748b98d868947a6e14a88@a estimated size is 123K full send of zfsrz2/.system/webui@a estimated size is 12.1K full send of zfsrz2/.system/cores@a estimated size is 12.1K full send of zfsrz2/.system/samba4@a estimated size is 1.18M full send of zfsrz2/bak@a estimated size is 12.1K full send of zfsrz2/pdata@a estimated size is 12.1K full send of zfsrz2/pdata/seafile@a estimated size is 12.1K total estimated size is 98.5M TIME SENT SNAPSHOT TIME SENT SNAPSHOT root@192.168.10.179's password: 11:11:05 57.4K zfsrz2/share@a 11:11:06 57.4K zfsrz2/share@a 11:11:08 57.4K zfsrz2/share@a 11:11:09 57.4K zfsrz2/share@a 11:11:10 57.4K zfsrz2/share@a
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Thanks for your patient, Apollo. I ran the command ssh -i /data/ssh/replication root@192.168.10.179
And press "yes", input password, now I am in 192.168.10.179 shell.

I suppose I should go back to my old system(192.168.10.180), then run zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2 , is that correct ?
Did you run the command from the source which seems to be the old system at 192.168.10.180?

If not you need to do it from there.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
yes, I ran the command from 192.168.10.180. Frist for ssh -i /data/ssh/replication root@192.168.10.179
press "yes", then password, it let me into the 192.168.10.179 shell.

then I Ctrl+D to go back to 192.168.10.180's shell, and run zfs send -vv -R zfsrz2@a | ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
If that doesn't solve the issue, you may want to disable password for ssh in the ssh service option on the remote.
It is also possible you missed configuring both systems with the keys.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
I am installing another new freenas system to try it again. I will keep you updated when I make progress. Thanks again for your suggestion and helps.

---update
I made another freenas ENV, I ran the same cmds in sequence and got the same result. I guess I have to send/receive datasets one by one then.
 
Last edited:

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I am installing another new freenas system to try it again. I will keep you updated when I make progress. Thanks again for your suggestion and helps.
It is not necessary to install a new system.
You can follow the guide for ssh connection which will take you to generating the private and public key and you will have to copy the releevant keys into your source root account ssh location and the public key on the root account on the remote.
Clean the known_hosts on the remote and start the ssh connection.
If all is done properly, it will accept fingeprint and you will be able to run the zfs send commands.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
I am installing another new freenas system to try it again. I will keep you updated when I make progress. Thanks again for your suggestion and helps.

---update
I made another freenas ENV, I ran the same cmds in sequence and got the same result. I guess I have to send/receive datasets one by one then.
The issue is not related to zfs send and zfs receive command.
For some reason it is not accepting the ssh conenction due to authentication issue.
This is my understanding the authentication is the root cause of your problem.
 

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
The issue is not related to zfs send and zfs receive command.
For some reason it is not accepting the ssh conenction due to authentication issue.
This is my understanding the authentication is the root cause of your problem.
I you run the ssh command agin, if the authenticaion has been successflu, then it shouldn't ask you about the password until fingerprint has been accepted.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
The 2nd cmd didn't ask password , just keep running for the 1st dataset snapshot but never stops. I will try to ssh with key to see if that will help.
 

lilarcor

Dabbler
Joined
May 19, 2019
Messages
24
update: I use key auth to logon the new freenas which needn't a password. Run the send/receive, same result.
 
Last edited:

Apollo

Wizard
Joined
Jun 13, 2013
Messages
1,458
Stepping a bit, we must acknwoledge the zfs send | zfs receive is a bi=directional transaction.
Therefore, we tried from the source and got fingerprint on destination.
The "ssh -i /data/ssh/replication root@192.168.10.179 zfs receive -vv -F zfsrz2 " command is actually run remotely to access the source.
So it would make sense to also execute the follwoing command from the remote to the source:
ssh -i /data/ssh/replication root@192.168.10.180
Going through the same step to loggin and accept fingerprint.
 
Top