Remote replication to a non TrueNAS system, initial local setup + remote considerations

xnor

Cadet
Joined
Oct 9, 2023
Messages
2
I'm rather new to TrueNAS so I might not get all the terminology correct here.

I have a couple of datasets, roughly 1TB, that I'd like to replicate to a remote location. A friend has offered to host a drive of mine and give me ssh access, and my hope is to give him a drive with my initial data and then set up a remote replication task to receive updates.

So, there are a few things I'm kind of unclear on here.

First, I see how to set up a remote replication task, but is there some information about how to setup a drive locally so that I can minimize the transfer for the initial remote sync? I'm hoping I only have to send the deltas to him.

Second, is the ssh based remote replication dependent on the remote also running TrueNAS? My friend runs Linux with his own custom NAS setup, not a TrueScale system. Are there any additional details to consider for the remote machine? I figure I'd need to format my drive with ZFS, and I'll need read/write/execute on the drive, anything else?
 

bluonek

Dabbler
Joined
Oct 27, 2014
Messages
34
While what you're trying to do isn't overly complex and is certainly possible, you're potentially asking a lot if you haven't yet learned some of the basics of operating systems, file systems, and SSH.

Just to get the ball rolling:
- What OS is your friend running?
- Are you familiar with keypair concepts and using them with SSH? (trying to gauge what kind of help you need here - to answer your question, no - SSH is not dependent on TrueNAS, even the SSH used in the TrueNAS replication interface)
- You can setup your initial full replication all on your local machine, once you send the prepared drive to your friend you would then update the replication task details to replicate remotely (it will likely take you some trial and error since some of the options are not necessarily straightforward

Good luck, feel free to ask more questions.
 

xnor

Cadet
Joined
Oct 9, 2023
Messages
2
My friend is running a debian based linux, IIRC plain old debian.

I'm familiar with ssh keypair concepts, use keys quite a bit. I didn't assume ssh was part of truenas, i was mostly wondering if the truenas replication service via the GUI, via ssh, required any sort of truenas on the other end.

I've been running Linux for quite some time and am pretty comfortable with it, I'm relatively new to BSD but I get around okay, so I feel pretty capable.

Thanks a ton @bluonek , this is helpful. I see how I can create a local replication task, I'll see how that goes and then see how I can set up the remote once that is done. I have 3 more questions.

  1. I want to replicate 3 of 4 directories in my pool. My pool is encrypted, I guess I'll see once I do the replication, but will the replication of just a subset of the datasets be encrypted without needing to add additional encryption? I don't want my friend to have access to my data at all.
  2. I intend to use an entire drive for this replication. Should I simply target the root directory when I setup my intial local replication or is there any benefit of using a directory?
  3. Say my friend mounts my drive at /mnt/foo/bar, do I simply target that directory once I get access to the remote?
 

bluonek

Dabbler
Joined
Oct 27, 2014
Messages
34
If your friend is running linux, you just need to have ZoL installed.

You'll be good with the use of SSH, since you can export the public key from your source via TrueNAS GUI and add it to the ~/.ssh/authorized_sources file on the target instance (or you can add it via the target TrueNAS interface, either way should work).

1. Yep. Be sure *not* to check the encryption box in the replication setup. This will send the raw encrypted blocks to your friends server. Snapshots and incremental replication will work even while the target datasets are encypted.

2. You will need to create the pool, but not the dataset in the pool (you can create the dataset in the target, but in this scenario probably not beneficial since your replicated dataset would then be a child of the created dataset in the target). Be sure the source looks like "tank/enc_dataset" and the target looks like "tank/enc_dataset". You can name them whatever you want on both sides, and they can be different, but in your initial replication run "enc_dataset" will not exist yet on the target, it's OK, ZFS will create it for you, but you have to specify it in the TrueNAS replication GUI.

3. Once you're all connected via the TrueNAS GUI, you should be able to find the pool and dataset in the interface.
 
Top