Could FreeNAS Replicate to a Mac running OpenZFS?

Status
Not open for further replies.

SwisherSweet

Contributor
Joined
May 13, 2017
Messages
139
I'm thinking through my options for a low-cost ZFS replication target for off-site backups. One option I am considering is using cheap MacMini servers, capable of holding two 2.5" 5TB drives. I could boot macOS from a thumbdrive running OpenZFS, mirror the two internal disks, and use those as ZFS targets for replication.

Is it possible to use the built-in replication features (via the GUI) to send snapshots a remote Mac running OpenZFS? Or does the target machine have to be running FreeNAS for this to work? I assume the fancy replication GUI in FreeNAS is just a wrapper for the zfs send and zfs receive commands.
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
I think the only issue you might run into is if you try to import the volumes if the OpenZFS version and FreeNAS don't support the same feature flags. You should still be able to send and receive regardless.
 

SwisherSweet

Contributor
Joined
May 13, 2017
Messages
139
I think the only issue you might run into is if you try to import the volumes if the OpenZFS version and FreeNAS don't support the same feature flags. You should still be able to send and receive regardless.

Thanks. I have been able to replicate a FreeNAS dataset to a Mac running OpenZFS using the terminal. I did this using SSH password authentication. I'd like to setup a FreeNAS replication task for this, but I'm getting permission denied errors since I don't have an SSH key setup.

Do you know what steps I would need to take to use an SSH key between my FreeNAS server and my remote Mac running OpenZFS? I found information on the web on how to generate an SSH key on FreeNAS but I don't want to screw up my existing replication tasks. Perhaps it won't, but I don't want to risk bringing down all my existing replications while I attempt things I've never done.

I have tried setting up a Replication task in the FreeNAS GUI, pointing to the IP of my remote Mac, then pressing the SSH Key Scan button, and it did populate a key. I tried saving that key text to a file, and using the ssh-add command on the remote Mac to add it, but ti keeps asking for a password, which I don't know. If I leave blank, it just end the command (or maybe adds it?).
 

fracai

Guru
Joined
Aug 22, 2012
Messages
1,212
ssh key scan is likely giving you the public key reported by your Mac. Copying that to a file and using ssh-add would add the key to the FreeNAS ssh agent for caching the key password. You could do this, but you're trying with the wrong key file and I'm not sure how the ssh agent integrates with FreeNAS. ssh-copy-id with this file would try to authorize your Mac to log in to itself. Also, the password you're being asked for is most likely the password for logging in to your Mac.

You need to use ssh-keygen to create a new public/private key pair (you probably want to not specify a password if you're automating this replication). You'll then authorize the public key for logging in to your Mac using ssh-copy-id.

Basically:
ssh-keygen -t rsa -b 4096 -C "freenas-user@freenas-host-name" -f ssh-key
ssh-copy-id -i ssh-key.pub "mac-user@mac-host-name"

The first command will prompt for a key password (feel free to leave it empty) and perhaps some other identity info.
The second command will prompt for the password of the remote Mac.
Now you can specify the ssh-key as part of your SSH command.

Note, that ssh key will allow access to your Mac without requiring a password. Protect that file from prying eyes. If the ssh-agent on FreeNAS is usable, that may be an option for protecting the file, but I don't have any experience there.
 
Last edited by a moderator:
Status
Not open for further replies.
Top