Skip to content

Set autofs to nfs4 #158

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Set autofs to nfs4 #158

merged 2 commits into from
Mar 5, 2021

Conversation

donald
Copy link
Collaborator

@donald donald commented Mar 4, 2021

Tell automount that our mount.nfs defaults to nfs4 if no version is specified.

This fixes the client-side problem of mariux64/bee-files#2043

Remove comments from this file, as they would not be updated when autofs
is updated. Refer to the man page instead.
From autofs.conf(5):

mount_nfs_default_protocol

   Specify  the default protocol used by mount.nfs(8) (program default 3).
   Since we can't identify this default automatically we need to set it in
   the autofs configuration.

Our mount.fs defaults to nfs4, so configure this correctly.

Background:

autmount tries to avoid to call mount.nfs for a host, when the host or
the nfs service on the host is not available to avoid long timeouts (and
possibly use a alternative ip-address or server).

So it uses rpc calls to the null procedure of the relevant nfs version.
If a map entries specifies a version option for nfs, then it is clear,
what this relevant version is. But if no version is specified in the map
entry, automounts wants to poll the version(s) mount.nfs would use, if
no version is specified. Per default, it is assumed, that mount.nfs
tries nfs3 and 2, so this is what gets polled. As we only offer nfs4, we
get the error `mount(nfs): no hosts available`. We need to tell
automount, that our mount.nfs defaults to nfs4 so that nfs4 is polled.

The above error doesn't occur with our current version of nfs-utils
(which is 2.4.1). In this version, `mount.nfs` is so old, that it
doesn't show its version number when called as `mount.nfs -V`.  In that
case, autofs skips the probing of nfs-versions alltogether.

However, when nfs-utils is upgraded to 2.5.4, autofs will detect that
and we get the error. So the change here is a prerequisite for an update
of nfs-utils.

This new setting is valid for autofs version 5.1.3 and for autofs
version 5.1.7, so there is no issue with the concurrently ongoing update
of autofs.
@donald donald merged commit 9899ad0 into master Mar 5, 2021
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant