Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [nfs] nfs mount settings
Date: Mon, 27 Jul 2009 07:18:31
Message-Id: 200907270917.02469.alan.mckinnon@gmail.com
In Reply to: [gentoo-user] [nfs] nfs mount settings by Harry Putnam
1 On Monday 27 July 2009 03:18:34 Harry Putnam wrote:
2 > I'm not that familiar with nfs usage ... only used lightly a few
3 > times.
4 >
5 > I have an opensolaris nfs server serving a share to my gentoo box.
6 >
7 > The mount point is set as owner:group of my user (reader).
8 >
9 > Also has the set-gid bit set.
10 >
11 > ls -ld /projects
12 > drwxr-sr-x 2 reader wheel 48 Jun 24 07:08 /projects
13 >
14 > And the mount settings in /etc/fstab
15 > (zfs is the hostname of the opensolaris server)
16 >
17 > zfs:/projects /projects nfs noauto,users,exec,dev 0 0
18 >
19 > With those settings my user or root can mount it.
20 >
21 > When its mounted the permissions change to this:
22 >
23 > ls -ld /projects
24 > drwxr-sr-x+ 13 reader man 14 Jul 25 09:47 /projects
25 >
26 > Whats with the `man' group?
27
28 The way nfs works is that it takes a remote filesystem and *mounts* it
29 locally, exactly as if it were a local filesystem. It is not a share. The
30 inodes are exported over nfs and that directory is owned by a group with gid
31 of say X. On your local machine that gid just happens to be the man group.
32
33 There is nothing much you can do about this except:
34
35 Renumber your gid's locally to match the nfs server,
36 or renumber the nfs share gids to match your local machine
37
38 > Also, when mounted I find when I try to copy somethihng with the -a
39 > option, which tries to maintain any permission settings. It causes an
40 > error warning... (although the copy is done).
41 >
42 > cp -a file file1
43 > cp: preserving permissions for `file1': Operation not supported
44
45 Full paths please. I can't see which way the copy is going.
46
47 I suspect that your user on the nfs server is not a member of the group that
48 has the same gid as your local man group.
49 >
50 > And the files permissions end up:
51 > ls -l file*
52 > -rw-r--r--+ 1 reader man 223962 Jul 26 15:56 file
53 > -rw-r--r--+ 1 reader reader 223962 Jul 26 15:56 file1
54 >
55 > Is there some way to set it up so that permissions can be copied?
56 > Also to alow the set-gid setting to work?
57
58
59 Golden rule with nfs:
60
61 It was designed for the case of a diskless client mounts it's home or root
62 directories over the network, while exporting passwd and shadow files over
63 NIS. That is evident in it's design and there is no facility to change uids
64 and gids on the fly. You do not authenticate with nfs, the server assumes that
65 the request coming from the client is OK and treats it exactly as it would a
66 request from a local user on a local disk. This is the primary reason why nfs
67 performs so well.
68
69 It is up to you to make sure your uids and gids everywhere match and work. nfs
70 cannot and will not help with this.
71
72 --
73 alan dot mckinnon at gmail dot com

Replies

Subject Author
[gentoo-user] Re: [nfs] nfs mount settings Harry Putnam <reader@×××××××.com>
Re: [gentoo-user] [nfs] nfs mount settings Alex Schuster <wonko@×××××××××.org>