Subject: NFS /etc/exports, and -alldirs
To: None <netbsd-help@netbsd.org>
From: Richard Rauch <rkr@olib.org>
List: netbsd-help
Date: 04/17/2003 05:22:01
hermes: NetBSD/i386, 1.6 with vanilla sources & custom kernel config.


I have been fiddling with NFS again, in my long slow arc of setting
up my home network.  (NFS is not been a high priority, but it's
close to the top again.)


My first question is fairly brief: Is -alldirs actually disabled?

I know that it is discouraged, and I don't intend on using it for
long, but for a short period it looked beneficial.  The docs claim
that it is supported, mountd parses it, and yet I can't get it to
work.  When I try, e.g.,

/usr/home -maproot=nobody:nogroup -network 192.168.0/16

... mountd gives:

Apr 17 04:09:09 hermes mountd[142]: "/usr/home -alldirs -maproot", line 4: Could not remount /usr/home: Invalid argument


What particularly confuses me is the "remount" reference.  While
/usr is mounted on hermes, this is the *local* /usr/home of hermes.
(The one that I'm trying to export!)  Why does "-alldirs" try to
unmount/remount?  If it's not trying to remount the local directory
for export, then I have no idea why the /etc/exports -alldirs option
is causing mountd to complain about "remounting".

This error occurs even during boot, and even if there is only one
entry in /etc/exports that contains the /usr/home entry.  (Though
it is possible that there are symbolic links somewhere that cross
link /usr/home in some way if you walk the tree.  I assume that
mountd isn't walking the full directory tree, but instead only
visits the required entries on-demand (i.e., on-mount).)


(What I wanted to do was (auto-?)mount hermes:/usr/home/<user> to
/usr/home/<user>/share to aid in migrating to a centralized
file-server.  It's not a biggie, but just seems like the least
painful way to centralize stuff.  Once the shared directories were
set up, that would facilitate copying/moving the few important
files.  Then a slight sleight-of-hand (legerdemain, if you will;
(^&) and /usr/home would be exported en masse.

Given the small number of affected directories, it might even be
more trouble to go through the /usr/home/<user>/share indirection.
But one learns by doing, so I was setting out to do.  (^&)

 ===

I also, with some subnetted "-network" lines, get messages about
"non-unique normal route".  The "non-unique route" is prefixed by
"/netbsd", so I assume that that's an in-kernel message not a mountd
message.  I'm not entirely sure what causes those, and the last
time I HUP'ed mountd, the route-related messages didn't happen (I
think).  Should I fret about these?  What causes them?

(The error is: "/netbsd: Non-unique normal route, mask not entered."
I assume that the "mask" refers to the /29 subnet mask.  Is the
netmask incorrect, above?  Should I be using a -mask separate
parameter?)

Should I worry?  Am I not getting the subnet masking that I asked
for?

(I would like to have my /29 subnet exported, even though it slightly
increases my system's vulnerability (I think that I can lock down
access adequately by built-in TCP wrappers and ipf rules).  The
desirability is really just for *one* IP at present, so I could
change the /29 subnet export to just a single machine.  The one
machine is my laptop, which I usually use as a bedroom terminal,
but sometimes bring out where the DSL's hub is more convenient.)

 ===

On a related note, the "-webnfs" and a couple of others are not
really well-documented.  They get mentioned in the exports(5)
man-page in the paragraph starting "WebNFS", but are not documented
with the same directness as are "-kerb", "-ro", etc.  If the intent
is only to list them to remind users who already know about them
(but to avoid needlessly encouraging them, as deprecated/undesirable,
for more "casual" users), perhaps a simple sentence: "-webnfs,
-public, -iso, and -index are all supported for compatibility, but
are not recommended." Along with a citation for relevant standards/docs
for those who *do* need them, that would serve better than the 2
or 3 paragraphs presently in the man-page.  (The paragraphs don't
tell me how/why to use them anyway, so nothing practical is lost
by reducing to a single sentence + citation, IMHO.)

(Actually, "-iso" appears in the sources, but is completely
undocumented, that I can see.)

I don't think that I particularly need these options, but the
un[der]-documentation strikes me as sub-par for NetBSD.


Okay, that's enough for one message.  Thanks in advance for input.
Mostly, the above issues boil down to curiosity and possibly obsolete
docs.  I'm sure I can plod ahead to a satisfactory configuration,
but would like to understand (and, where appropriate, hear that
the man-pages have been fixed; (^&).


-- 
  "I probably don't know what I'm talking about."  --rkr@olib.org