rsync tasks to backup linux boxes

alexr

Explorer
Joined
Apr 14, 2016
Messages
59
I'd like to have FreeNAS handle backups of a bunch of linux boxes. (Mostly Raspberry Pis that exist for their physical properties, e.g. being able to drive a USB/ModBus adapter in proximity to our boiler, which is nowhere near our rack.)

Is there a walkthrough somewhere I'm not finding for this? (I've read the rsync man page and the FN guide. They're not helpful for the whole solution.)

Where I'm stuck now is on user management on the FN side. Each server to be backed up should have it's own SSH keypair for its root user.

I can only paste one SSH public key into the root user on FN. I also really really really don't want to do anything to the FN root user.

I can make one FN user per server to be backed up. Even if I give it a home directory, if it's nologin, I can't paste a public key in.

Even then, I'd have to use the --fake-super option to rsync and the man page on FN says that xattr isn't supported on FreeBSD.

So, what to do?
 
Joined
Jan 7, 2015
Messages
1,155
You can have multiple keypairs, ive done this from several machines as I dont always use the same machine to do MGMT SSH things. You just append the next key below using a line break (enter). Should work as long as each user is in fact root.
 

alexr

Explorer
Joined
Apr 14, 2016
Messages
59
Using the built-in rsync (11.3-U3.1), I get:
Code:
receiving incremental file list
Invalid xattr name received (missing trailing \0).
rsync error: error in file IO (code 11) at xattrs.c(829) [Receiver=3.1.3]
but if I build rsync from ports in a fresh jail, it works. (Using --fake-super --progress -aAXSvzhe ssh.)

FreeNAS has a /usr/local/etc/rsyncd.conf, but I don't see anything in there that would alter xattr behavior.
 

CmdrDeLiver

Cadet
Joined
Mar 25, 2021
Messages
3
Thank you Alex. I've been digging on this as rsync is my go to for Linux backups. Appreciate you taking the time to work out the actual issue.

For those didn't follow the link:

Invalid xattr name received (missing trailing \0).

IX has built a modified version of rsync to enable nsf4 acls instead of exposing those acls and using the standard rsync method of transferring them. This breaks rsync Linux acls due to corruption in transit. Andrew Walker stated this is not likely to get fixed in the short term.

tl;dr: Build a standard copy of rsync in a jail. Don't use that to transfer nfs4 acls.
 

Spearfoot

He of the long foot
Moderator
Joined
May 13, 2015
Messages
2,478
I'd like to have FreeNAS handle backups of a bunch of linux boxes. (Mostly Raspberry Pis that exist for their physical properties, e.g. being able to drive a USB/ModBus adapter in proximity to our boiler, which is nowhere near our rack.)

Is there a walkthrough somewhere I'm not finding for this? (I've read the rsync man page and the FN guide. They're not helpful for the whole solution.)

Where I'm stuck now is on user management on the FN side. Each server to be backed up should have it's own SSH keypair for its root user.

I can only paste one SSH public key into the root user on FN. I also really really really don't want to do anything to the FN root user.

I can make one FN user per server to be backed up. Even if I give it a home directory, if it's nologin, I can't paste a public key in.

Even then, I'd have to use the --fake-super option to rsync and the man page on FN says that xattr isn't supported on FreeBSD.

So, what to do?
I've created a GitHub repository with discussion and scripts for using rsync:


Hope this helps.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
IX has built a modified version of rsync to enable nsf4 acls instead of exposing those acls and using the standard rsync method of transferring them. This breaks rsync Linux acls due to corruption in transit. Andrew Walker stated this is not likely to get fixed in the short term.
The standard method of transferring ACLs is not compatible with FreeBSD's NFSv4 ACLs. Linux ACLs are implemented as POSIX1e ACLs and are fundamentally incompatible with native ZFS ACLs (hence the inability to rsync them). It would result in stripping permissions. This is a standard port option in FreeBSD and has been available for many years.
 
Top