1

I have a home server that is sharing folders on the network using NFS.

I have mounted these folders on my computer, for example:

192.168.1.20:/mnt/raiddisk/john  /mnt/john        nfs     auto,defaults   0       0

I am trying to run the following rsync command in order to copy my home folder to the remote machine:

sudo rsync -azv -h --progress /home/john/ /mnt/john/backups/manual/20150806/ --log-file=/home/john/manual_backup.log

But I get errors like this one and nothing is copied over:

rsync: failed to set times on "/mnt/john/backups/manual/20150806/.":
Permission denied (13) rsync: recv_generator: mkdir
"/mnt/john/backups/manual/20150806/.Skype" failed: Permission denied
(13)
* Skipping any contents from this failed directory *

The permissions for my mounted folders are as follows:

drwxr-xr-x  10 root root  4096 Aug  2 21:32 mnt
drwxrwxr-x  4 john  john  4096 Dez 24  2014 john
drwxrwxr-x  4 john  john  4096 Dez 14  2014 backups
drwxrwxr-x 6 john john 4096 Aug  6 20:41 manual
drwxrwxr-x  2 john john 4096 Aug  6 20:41 20150806

I thought that by using sudo I would be running rsync with root permissions and that it should not have problems copying the files, but evidently there is something I have misunderstood, any help appreciated.

2

One of the "security" measures in NFS is rootsquash being a default option. With rootsquash, root on a client system has the same privileges as the nobody user (or some other assigned, impotent, account depending on the exact configuration). Accordingly, using sudo on NFS actually weakens your access privileges. So, don't use sudo on NFS. Set your permissions properly.

  • Interesting, thanks very much for the info. So I simply omitted "sudo" on the client system and now rsync is happily copying the contents of my /home/john folder to my mounted NFS folders. – BrokenCode Aug 7 '15 at 7:46

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.