syncoid | SOURCE Debian - REMOTE Truenas

Howdy!

Having issues figuring out how to get syncoid to replicate my local encrypted source_dataset inside my subdataset on the truenas remote.

SSH is working, the SSH user on remote does not have root but should nonetheless have the appropriate permissions.

The debug output seems to indicate that “cannot receive: invalid name” is the issue, but I’m not sure what that means exactly.

I suppose it might have something to do with /tmp not existing on the remote, but root (/) is read-only on Truenas so there is not much i can do about that.
I’ve also considered that there might be a typo in the remote name but I’ve double checked and also tried to remove the slash after subdataset/ (syncoid command) but then syncoid cowardly rejects me proposal with the explanation that is does not want to destroy the subdataset.

Any idea on how to move forward is appreciated.

remote user zfs permissions


zfs allow rootdataset/subdataset
---- Permissions on rootdataset/subdataset ----------------------
Local+Descendent permissions:
        user user compression,create,destroy,mount,mountpoint,receive,rollback,sync

Source user zfs permissions


zfs allow root_dataset
---- Permissions on root_dataset --------------------------------------------
Local+Descendent permissions:
        user user destroy,hold,mount,send,snapshot,sync

syncoid source_dataset remote_hostname:rootdataset/subdataset/ --no-privilege-elevation --debug

syncoid source_dataset remote_hostname:rootdataset/subdataset/ --no-privilege-elevation --debug
DEBUG: SSHCMD: ssh     
DEBUG: checking availability of lzop on source...
DEBUG: checking availability of lzop on target...
DEBUG: checking availability of lzop on local machine...
WARN: lzop not available on target ssh:-S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname - sync will continue without compression.
DEBUG: checking availability of mbuffer on source...
DEBUG: checking availability of mbuffer on target...
DEBUG: checking availability of pv on local machine...
DEBUG: checking availability of zfs resume feature on source...
DEBUG: checking availability of zfs resume feature on target...
DEBUG: syncing source source_dataset to target rootdataset/subdataset/.
DEBUG: getting current value of syncoid:sync on source_dataset...
  zfs get -H syncoid:sync 'source_dataset'
DEBUG: checking to see if rootdataset/subdataset/ on ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname is already in zfs receive using ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname ps -Ao args= ...
DEBUG: checking to see if target filesystem exists using "ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname  zfs get -H name ''"'"'rootdataset/subdataset/'"'"'' 2>&1 |"...
DEBUG: getting list of snapshots on source_dataset using   zfs get -Hpd 1 -t snapshot guid,creation 'source_dataset' |...
DEBUG: creating sync snapshot using "  zfs snapshot 'source_dataset'@syncoid_hostname_2026-02-10:13:55:50-GMT01:00
"...
DEBUG: target rootdataset/subdataset/ does not exist.  Finding oldest available snapshot on source source_dataset ...
DEBUG: getting estimated transfer size from source  using "  zfs send  -nvP 'source_dataset@syncoid_hostname_2026-02-09:19:00:26-GMT01:00' 2>&1 |"...
DEBUG: sendsize = 71280
INFO: Sending oldest full snapshot source_dataset@syncoid_hostname_2026-02-09:19:00:26-GMT01:00 (~ 69 KB) to new target filesystem:
DEBUG:  zfs send  'source_dataset'@'syncoid_hostname_2026-02-09:19:00:26-GMT01:00' | pv -p -t -e -r -b -s 71280 | mbuffer  -q -s 128k -m 16M | ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname ' mbuffer  -q -s 128k -m 16M |  zfs receive  -s -F '"'"'rootdataset/subdataset/'"'"''
DEBUG: checking to see if rootdataset/subdataset/ on ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname is already in zfs receive using ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname ps -Ao args= ...
44.2KiB 0:00:00 [5.24MiB/s] [===============================================================================================>                                                        ]  63%            
cannot receive: invalid name
CRITICAL ERROR:  zfs send  'source_dataset'@'syncoid_hostname_2026-02-09:19:00:26-GMT01:00' | pv -p -t -e -r -b -s 71280 | mbuffer  -q -s 128k -m 16M | ssh      -S /tmp/syncoid-remote_hostname-1770728150-6251 remote_hostname ' mbuffer  -q -s 128k -m 16M |  zfs receive  -s -F '"'"'rootdataset/subdataset/'"'"'' failed: 256 at /usr/sbin/syncoid line 549.
~

Try removing the trailing / in the remote dataset.

syncoid source_dataset remote_hostname:rootdataset/subdataset --no-privilege-elevation --debug

@ikabir

I’ve actually tried that, it resulted in a cowardly refusal from syncoid as it does not want to destroy my existing dataset.

Something that i forgot to highlight is the fact that truenas (remote) does not have syncoid installed, I hope this does not matter as it’s zfs send that does the heavy lifting.

Ah, sorry. Normally, syncoid should complain with the following, not sure why it didn’t in your case. Maybe it only happens on newer versions of syncoid.

did you mistakenly run zfs create remote_hostname:rootdataset/subdataset on the target? ZFS initial replication must be to a NON EXISTENT DATASET, which will then be CREATED BY the initial replication process.

If it fits your use case, you can try deleting subdataset and letting syncoid create it. Or you can replicate to a child of subdataset.


The remote not having syncoid doesn’t matter. In fact, you can have the source and target both be remote machines without syncoid installed.

1 Like

I have tested this with my truenas server and it works just fine.

I used your commandline:

syncoid mydatatset truenas:zdata/test9 --no-privilege-elevation --debug

The important difference: No trailing slash on any dataset name. In your example you call it
remote_hostname:rootdataset/subdataset/. That is certainly wrong. zfs does not allow trailing slashes. You should try again with remote_hostname:rootdataset/subdataset and show the output.

The receiving dataset in my example: truenas:zdata/test9 did not exist. If it exists, I had to allow syncoid to overwrite it with --force-delete

1 Like

@ikabir
Ahh, that must be the problem as the dataset does exist on the remote.
So I suppose i will just do syncoid source_dataset remote_hostname:rootdataset/subdataset/another_subdata-set --no-privilege-elevation --debug and see if that works

yes, this was the issue all along!
I knew it was something dumb just like this!

Working command
syncoid source_dataset remote_hostname:rootdataset/subdataset/source_dataset --no-privilege-elevation -r --debug --sendoptions=w

I have set syncoid to create a new sub/child dataset as zfs allow only applies on remote_hostname:rootdataset/subdataset so delting this dataset would interfere with this.

  • added --sendoptions=w in order to keep my dataset encrypted on the remote
  • -r in order to send my local subdataset which the root for root ( /) and home ( /home )

Thank you @mabod and @ikabir, you’ve both provided indispensable help in resolving my issue!

Next I’m going to figure out how to best approach scheduling my syncoid backup.
The source is a Debian box so I’m considering weather i should go with systemd (systemd.timer) think it’s called) or a cron job.
but that’s another topic.

Thanks yet again for all your help guys!

We recently had a discussion on systemd vs cron job, etc.

I’m also building some tooling for running and managing chithi/syncoid, and one of the scripts allows managing using systemd. You can see how it’s supposed to work from the docs in here and here. The v0.2.0 release with those features will probably happen sometime end of this month :crossed_fingers:.

1 Like