How to store an rsync backup of my system on a NFS mount?
I'd like to use rsync to make a backup of my complete system including files owned by root and myself as well as other system and non-system users. I'd like to be able to restore the source directory structure and files from the backup target with rsync including ownership and permissions.
After experiencing trouble with pathes longer then 260 characters on cifs (yes, this is ridiculous), I'm trying out NFS 4.1 which seems to have a difficult to control mapping of user and group ids. My understanding is that root_squash, no_root_squash and all_squash all to control the mapping to the user anonymous. However, specifying no_root_squash in /etc/exports still causes the mounted directory to be owned by nobody:nobody on the client side. The same applies to all files transferred on the mount with rsync -a (rsync transfers the files, but each change of the ownership to root fails due to chown "[path] failed: Invalid argument (22)).
I'm using other forms of versioning backups as well, so there's no need to discuss the suitability of rsync for backups. Creating an image on the NFS or CIFS mount and giving it a filesystem is a solution (resulting in one very large and thus hard to manage file) as is creating tars which are hard to update on a daily basis. I'm looking for a solution for the specific use case.