0

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.

  • This QA on ServerFault might be helpful: serverfault.com/q/213647/349846 – Haxiel Jan 24 at 3:25
  • Using any sort of network file system is going to be slow, using a rsync server or over ssh is 2nd best to a btrfs Incremental Backup. – user1133275 Jan 24 at 4:05
  • I'd recommend decoupling rsync from your NFS questions. Properly set up, root on a client can create/chown a file on the server to any other user. If this isn't happening, you need to solve that first. v3 or v4? – BowlOfRed Jan 24 at 8:44
  • @Haxiel The answer to the question is to drop ownership of the files which is a bad idea for a backup. – Karl Richter Jan 24 at 9:17
  • @user1133275 Target is a Synology box which handles all network filesystem and file protocol transfer very close to maximum speed. – Karl Richter Jan 24 at 9:19
0

Working with the Synology limitation your options are to not backup ownership, or use --fake-super, or use duplicity etc.

Getting a Linix server (optional lxc/kvm security) you can backup ownership, and reduce bandwidth by using a server side rsync for your client rsync to talk to.

Or remove diff cpu and IO time completely with btrfs Incremental Backup (auto rename tracking to).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.