1

I'm running Xubuntu and trying to back up my filesystem to an NFS share using rsync using the command:

rsync -vSHPhhaX --numeric-ids --delete --exclude-from=/home/rena/.scripts/exclude-list / /home/rena/video/.backup/>/home/rena/video/.backup.log

(/home/rena/video is the NFS share. The underlying filesystem is ext3.) This invocation doesn't work, because the server has different user IDs and group IDs than the local system, and NFS won't let me change a file's UID/GID to one that doesn't exist on the server.

Not finding any way to disable or bypass that restriction, I tried using the --fake-super option instead, to store the attributes another way. That didn't work either, and I'm not sure why - just lots of these messages instead:

rsync: delete of stat xattr failed for "/home/rena/video/.backup/bin/bzless": Operation not supported (95)
rsync: failed to write xattr user.rsync.%stat for "/home/rena/video/.backup/bin/fusermount": Operation not supported (95)

Does NFS4 not support the extended attributes? It seems like the only way to back up to an NFS share is if the user and group IDs are the same on both machines?

3
  • It is not clear from the question if you have root access to the NFS server or not. Can you get the NFS share exported with no_root_squash? Apr 26, 2012 at 1:51
  • Yes, it's using no_root_squash and I have root on both machines.
    – Rena
    Apr 26, 2012 at 5:25
  • For the second case with (--fake-super) is ext3 on the NFS server mounted with user_xattr option? Apr 26, 2012 at 5:55

2 Answers 2

1

Because of this little hiccup, which seems unavoidable, you might want to consider alternative options... Such as, since you are using rsync, attempt using it as a server for the receiving end. That was it's intended use, after all. For any help, you can look at this site http://a1979shakedown.wordpress.com/2009/01/19/set-up-an-rsync-server-in-ubuntu-for-file-syncing-between-machines/ ; Or as another option, you can try sshfs instead of nfs for the across-network transfer. Just a couple of options.

2
  • Thanks for the tip! I had no idea rsync had a daemon mode. However, after setting it up, it doesn't seem to be keeping the UID/GID, just resetting them all to my own.
    – Rena
    Apr 26, 2012 at 8:40
  • K, got it working. Had to set uid/gid in rsyncd.conf to a user allowed to change the ownership of the copied files.
    – Rena
    Apr 26, 2012 at 9:45
0

I don't understand why you are having troubles with this. You have two options:

  1. Preserve the ownership of files. So, you can use options like -a and -o. You can see manual for more details.
  2. Don't preserve the ownership. So, just do rsync without such an option as root. The new owner will be root.

When preserving owner information, rsync can do this by storing the names (default) or the ids (use the option --numeric-ids). If you want to preserve the owner, it should be normal to have the same user on the other machine.

1
  • The trouble is, rsync stores the ownership information by setting the owner/group of the stored file, and NFS won't let it because the owner it's trying to set doesn't exist on the server. This is with or without --numeric-ids. And I need to preserve that information.
    – Rena
    Apr 25, 2012 at 11:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .