Gentoo Archives: gentoo-user

From: "J. Roeleveld" <joost@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] NFS tutorial for the brain dead sysadmin?
Date: Mon, 28 Jul 2014 13:58:55
Message-Id: 5173457.q3mQ4aYvLc@andromeda
In Reply to: Re: [gentoo-user] NFS tutorial for the brain dead sysadmin? by Kerin Millar
1 On Sunday, July 27, 2014 08:44:02 PM Kerin Millar wrote:
2 > On 27/07/2014 17:55, J. Roeleveld wrote:
3 > > On 27 July 2014 18:25:24 CEST, "Stefan G. Weichinger" <lists@×××××.at>
4 wrote:
5 > >> Am 26.07.2014 04:47, schrieb walt:
6 > >>> So, why did the "broken" machine work normally for more than a year
7 > >>> without rpcbind until two days ago? (I suppose because nfs-utils was
8 > >>> updated to 1.3.0 ?)
9 > >>>
10 > >>> The real problem here is that I have no idea how NFS works, and each
11 > >>> new version is more complicated because the devs are solving problems
12 > >>> that I don't understand or even know about.
13 > >>
14 > >> I double your search for understanding ... my various efforts to set up
15 > >> NFSv4 for sharing stuff in my LAN also lead to unstable behavior and
16 > >> frustration.
17 > >>
18 > >> Only last week I re-attacked this topic as I start using puppet here to
19 > >> manage my systems ... and one part of this might be sharing
20 > >> /usr/portage
21 > >> via NFSv4. One client host mounts it without a problem, the thinkpads
22 > >> don't do so ... just another example ;-)
23 > >>
24 > >> Additional in my context: using systemd ... so there are other
25 > >> (different?) dependencies at work and services started.
26 > >>
27 > >> I'd be happy to get that working in a reliable way. I don't remember
28 > >> unstable behavior with NFS (v2 back then?) when we used it at a company
29 > >> I worked for in the 90s.
30 > >>
31 > >> Stefan
32 > >
33 > > I use NFS for filesharing between all wired systems at home.
34 > > Samba is only used for MS Windows and laptops.
35 > >
36 > > Few things I always make sure are valid:
37 > > - One partition per NFS share
38 > > - No NFS share is mounted below another one
39 > > - I set the version to 3 on the clients
40 > > - I use LDAP for the user accounts to ensure the UIDs and GIDs are
41 > > consistent.
42 > These are generally good recommendations. I'd just like to make a few
43 > observations.
44 >
45 > The problems associated with not observing the first constraint (one
46 > filesystem per export) can be alleviated by setting an explicit fsid.
47 > Doing so can also help to avoid stale handles on the client side if the
48 > backing filesystem changes - something that is very useful in a
49 > production environment. Therefore, I tend to start at 1 and increment
50 > with each newly added export. For example:-
51 >
52 > /export/foo *(async,no_subtree_check,fsid=1)
53 > /export/foo/bar *(async,no_subtree_check,fsid=2)
54 > /export/baz *(async,no_subtree_check,fsid=3)
55 >
56 > If using NFSv3, I'd recommend using "nolock" as a mount option unless
57 > there is a genuine requirement for locks to be co-ordinated. Such locks
58 > are only advisory and are of questionable value. Using nolock simplifies
59 > the requirements on both server and client side, and is beneficial for
60 > performance.
61 >
62 > NFSv3/UDP seems to be limited to a maximum read/write block size of
63 > 32768 in Linux, which will be negotiated by default. Using TCP, the
64 > upper bound will be the value of /proc/fs/nfsd/max_block_size on the
65 > server. Its value may be set to 1048576 at the most. NFSv3/TCP is
66 > problematic so I would recommend NFSv4 if TCP is desired as a transport
67 > protocol.
68 >
69 > NFSv4 provides a useful uid/gid mapping feature that is easier to set up
70 > and maintain than nss_ldap.
71 >
72 > > NFS4 requires all the exports to be under a single foldertree.
73 >
74 > This is a myth:
75 > http://linuxcostablanca.blogspot.co.uk/2012/02/nfsv4-myths-and-legends.html.
76 > Exports can be defined and consumed in the same manner as with NFSv3.
77
78 When I originally tried NFSv4, it refused to work unless they were all under
79 the same directory.
80 As I dislike that, I decided against using it.
81
82 That was a long time ago, will revisit that part again later.
83
84 Interesting link, I wonder how difficult it will be to combine that with Samba
85 4 and use the Samba AD structure for NFSv4 with either ZFS or BTRFS
86 underneath.
87
88 --
89 Joost

Replies

Subject Author
Re: [gentoo-user] NFS tutorial for the brain dead sysadmin? behrouz khosravi <bz.khosravi@×××××.com>