Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] NFS tutorial for the brain dead sysadmin?
Date: Sat, 26 Jul 2014 13:52:55
Message-Id: 53D3B279.6030906@gmail.com
In Reply to: [gentoo-user] NFS tutorial for the brain dead sysadmin? by walt
1 On 26/07/2014 04:47, walt wrote:
2 > In this case, the brain dead sysadmin would be moi :)
3 >
4 > For years I've been using NFS to share /usr/portage with all of the
5 > gentoo machines on my LAN.
6 >
7 > Problem: occasionally it stops working for no apparent reason.
8 >
9 > Example: two days ago I updated two ~amd64 gentoo machines, both of
10 > which have been mounting /usr/portage as NFS3 shares for at least a
11 > year with no problems.
12 >
13 > One machine worked normally after the update, the other was unable to
14 > mount /usr/portage because rpc.statd wouldn't start correctly.
15 >
16 > After two frustrating days I discovered that I had never enabled the
17 > rpcbind.service on the "broken" machine. So I enabled rpcbind, which
18 > fixed the breakage.
19 >
20 > So, why did the "broken" machine work normally for more than a year
21 > without rpcbind until two days ago? (I suppose because nfs-utils was
22 > updated to 1.3.0 ?)
23 >
24 > The real problem here is that I have no idea how NFS works, and each
25 > new version is more complicated because the devs are solving problems
26 > that I don't understand or even know about.
27 >
28 > So, please, what's the best way to learn and understand NFS?
29
30
31 I think you are asking for the impossible :-)
32
33 NFS is not easy to set up, and even harder to describe. It is easy to
34 *use* once it's set up correctly - you just mount something and the only
35 difference to a local mount is you add an IP address.
36
37 NFS uses RPC to do some heavy lifting - I don't know how familiar you
38 are with this, so here's the quick version:
39
40 When you mount something locally, and need to use the mounted
41 filesystem, kernel calls are used to get at the data. This works easily
42 as the source disk is local and the kernel can get to it. With NFS, the
43 source disk is remote and it's the remote kernel that must do the
44 accessing. RPC is a way to safely ask a remote kernel to do something
45 and get a result that behaves identical to a local kernel call.
46 Obviously, this is rather hard to implement correctly.
47
48 The original RPC was written by Sun and other newer implementations
49 exist, like libtirpc - to support useful features like not being stuck
50 with only UDP. That's what the "ti" means - Transport Independant.
51
52 RPC has been in a state of flux for some time and I too have run into
53 init-script oddities as things change.
54
55 In my case, I have nfs-utils-1.3.0, and rc-update configuredd to start
56 rpc.statd. This works because
57
58 depend() {
59 ...
60 need portmap
61 ...
62 }
63
64 and in the init.d file for rpcbind:
65
66 depend() {
67 ...
68 provide portmap
69 }
70
71 So rpcbind starts at boot time and all my nfs mounts JustWork
72
73 Looks to me like your problem is actually with rpc and more specifically
74 with what things are currently named today (which could be different to
75 yesterday). Unfortunately I don't know of a place where this is all
76 nicely described in a sane manner except inside the init files themselves.
77
78
79
80 --
81 Alan McKinnon
82 alan.mckinnon@×××××.com

Replies

Subject Author
Re: [gentoo-user] NFS tutorial for the brain dead sysadmin? Tom H <tomh0665@×××××.com>