Gentoo Archives: gentoo-user

From: Kerin Millar <kerframil@×××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] NFS tutorial for the brain dead sysadmin?
Date: Sun, 27 Jul 2014 19:44:13
Message-Id: 53D55682.2090607@fastmail.co.uk
In Reply to: Re: [gentoo-user] NFS tutorial for the brain dead sysadmin? by "J. Roeleveld"
1 On 27/07/2014 17:55, J. Roeleveld wrote:
2 > On 27 July 2014 18:25:24 CEST, "Stefan G. Weichinger" <lists@×××××.at> wrote:
3 >> Am 26.07.2014 04:47, schrieb walt:
4 >>
5 >>> So, why did the "broken" machine work normally for more than a year
6 >>> without rpcbind until two days ago? (I suppose because nfs-utils was
7 >>> updated to 1.3.0 ?)
8 >>>
9 >>> The real problem here is that I have no idea how NFS works, and each
10 >>> new version is more complicated because the devs are solving problems
11 >>> that I don't understand or even know about.
12 >>
13 >> I double your search for understanding ... my various efforts to set up
14 >> NFSv4 for sharing stuff in my LAN also lead to unstable behavior and
15 >> frustration.
16 >>
17 >> Only last week I re-attacked this topic as I start using puppet here to
18 >> manage my systems ... and one part of this might be sharing
19 >> /usr/portage
20 >> via NFSv4. One client host mounts it without a problem, the thinkpads
21 >> don't do so ... just another example ;-)
22 >>
23 >> Additional in my context: using systemd ... so there are other
24 >> (different?) dependencies at work and services started.
25 >>
26 >> I'd be happy to get that working in a reliable way. I don't remember
27 >> unstable behavior with NFS (v2 back then?) when we used it at a company
28 >> I worked for in the 90s.
29 >>
30 >> Stefan
31 >
32 > I use NFS for filesharing between all wired systems at home.
33 > Samba is only used for MS Windows and laptops.
34 >
35 > Few things I always make sure are valid:
36 > - One partition per NFS share
37 > - No NFS share is mounted below another one
38 > - I set the version to 3 on the clients
39 > - I use LDAP for the user accounts to ensure the UIDs and GIDs are consistent.
40
41 These are generally good recommendations. I'd just like to make a few
42 observations.
43
44 The problems associated with not observing the first constraint (one
45 filesystem per export) can be alleviated by setting an explicit fsid.
46 Doing so can also help to avoid stale handles on the client side if the
47 backing filesystem changes - something that is very useful in a
48 production environment. Therefore, I tend to start at 1 and increment
49 with each newly added export. For example:-
50
51 /export/foo *(async,no_subtree_check,fsid=1)
52 /export/foo/bar *(async,no_subtree_check,fsid=2)
53 /export/baz *(async,no_subtree_check,fsid=3)
54
55 If using NFSv3, I'd recommend using "nolock" as a mount option unless
56 there is a genuine requirement for locks to be co-ordinated. Such locks
57 are only advisory and are of questionable value. Using nolock simplifies
58 the requirements on both server and client side, and is beneficial for
59 performance.
60
61 NFSv3/UDP seems to be limited to a maximum read/write block size of
62 32768 in Linux, which will be negotiated by default. Using TCP, the
63 upper bound will be the value of /proc/fs/nfsd/max_block_size on the
64 server. Its value may be set to 1048576 at the most. NFSv3/TCP is
65 problematic so I would recommend NFSv4 if TCP is desired as a transport
66 protocol.
67
68 NFSv4 provides a useful uid/gid mapping feature that is easier to set up
69 and maintain than nss_ldap.
70
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 >
79 > I haven't had any issues in the past 7+ years with this and in the past 5+ years I had portage, distfiles and packages shared.
80 > /etc/portage is symlinked to a NFS share as well, allowing me to create binary packages on a single host (inside a chroot) which are then used to update the different machines.
81 >
82 > If anyone wants a more detailed description of my setup. Let me know and I will try to write something up.
83 >
84 > Kind regards
85 >
86 > Joost
87 >
88
89 --Kerin

Replies

Subject Author
Re: [gentoo-user] NFS tutorial for the brain dead sysadmin? "J. Roeleveld" <joost@××××××××.org>