Hacking Freenas – zfs replication

If you are trying to replicate your zfs volume to a remote system that doesn’t have port 22 forwarded to it…you can hack Freenas to use a different port.

Cliff notes version for myself is as follows:
ssh into freenas…su to root
“mount -uw /”
“vi /usr/local/www/freenasUI/tools/autorepl.py”
search for sshcmd using “/sshcmd”
After sshcmd = ‘/usr/bin/ssh insert -p and the port needed. Use i to insert in vi. then type -p 2020 or some port that works for you. hit esc then “:wq” to save and quit.

OK…that’s more than the cliff notes for myself. If you have any questions…feel free to ask.    Any hack changes like this will get squashed next time you upgrade freenas.  That said, I’ve heard from a reliable source that this is an option that is headed for a future release.

Also discovered that when you are setting the remote zfs filesystem…that if the filesystem is an existing zfs filesystem, you only need to use the name of the filesystem and not the path.

Advertisement

2 thoughts on “Hacking Freenas – zfs replication

  1. Thanks for the notes. I’ve been wondering how to do this as I need to send my replication tasks through an ssh tunnel that listens on a port other than 22.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s