Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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? –  Dmitri Chubarov Apr 26 '12 at 1:51
    
Yes, it's using no_root_squash and I have root on both machines. –  Rena Apr 26 '12 at 5:25
    
For the second case with (--fake-super) is ext3 on the NFS server mounted with user_xattr option? –  Dmitri Chubarov Apr 26 '12 at 5:55
add comment

2 Answers

up vote 1 down vote accepted

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.

share|improve this answer
    
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 '12 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 '12 at 9:45
add comment

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.

share|improve this answer
    
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 '12 at 11:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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