View previous topic :: View next topic |
Author |
Message |
lalebarde Guru


Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Thu Dec 29, 2011 10:19 pm Post subject: rsync via nfs looses ownership for nobody:nobody |
|
|
Hi,
I want to perform backups via nfs. On the server, I set the /etc/exports like this : Code: | /home/lalebarde PCLALEBARDE(rw,sync,no_subtree_check,no_root_squash) |
On the client, /etc/fstab : Code: | PC2:/home/lalebarde /PC2/backup/home/lalebarde nfs rw,auto,sync |
Then I do the rsync from root in the client : Code: | # rsync -a --delete /home/lalebarde/ /PC2/backup/home/lalebarde/ |
As the result, all files in the backup are set user=nobody, group=nobody.
I thought from what I read on the web that no_root_squash was the key, but no. Of course, I reloaded the nfs server when I changed the exports. I also have the same users and groups, UIDs & GIDs.
Any clue ? |
|
Back to top |
|
 |
Jaglover Watchman


Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Fri Dec 30, 2011 12:08 am Post subject: |
|
|
Methinks everything falls into place when you have user lalebarde in remote machine with same UID as in your local machine. And no_root_squash is really not a feasible option, I use portage on NFS for instance and it is owned by user portage:portage in remote box which is even not running Linux. Just do your backups as user and everything will be fine. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
 |
lalebarde Guru


Joined: 03 Sep 2006 Posts: 464 Location: France, Haute-Garonne
|
Posted: Fri Dec 30, 2011 9:17 am Post subject: |
|
|
Thanks for your answer Jaglover.
Jaglover wrote: | Methinks everything falls into place when you have user lalebarde in remote machine with same UID as in your local machine. | That's what I do have.
Jaglover wrote: | Just do your backups as user and everything will be fine. | It is not a solution for me since my directories belong to several groups, depending on what I want to share with whom. |
|
Back to top |
|
 |
Jaglover Watchman


Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
 |
krinn Watchman


Joined: 02 May 2003 Posts: 7471
|
Posted: Fri Dec 30, 2011 3:51 pm Post subject: |
|
|
if your user is root and you end with uid:gid of nobody, it's exactly what the root_squash should do.
your export is then not understood as you think.
you might try exportfs -v on server to see what options are set the way you think they should.
and you might check your server for which version of nfs you are using on server and client to mount the share, for a nfsv4 server this is not a valid export directive, as you should have a root directory with fsid=0 and subdirectories directives.
for some obscure reasons i really don't know why, let's say compatibilities, they accept nfsv3 style of exports and the server try to use that for both v3 and v4, this cause more troubles then help, as a v3 client will mount it right, but a v4 will find it totally wreck as non-standard to v4.
what you could try, is forcing the client to use v3, i think it's with -o nfsver=3 parameter, this "should" gave you a more permissive nfs server.
you could lower your security too by passing the group uid you wish to your export filesystem with anongid=guidyouwish to let your root_squashing setting the guid you wish instead of the default nobody guid
or switch to full nfsv4 with your clients and server configure to use idmapd with the same domain. |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|