Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2021 23:16:24 +0300
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        freebsd-fs <freebsd-fs@freebsd.org>
Subject:   =?UTF-8?Q?autofs_+_default_/net_map_+_NFS4_=e2=80=94_how_to=3f?=
Message-ID:  <36080caf-4aa1-d262-cb93-9df9b72f884d@FreeBSD.org>

next in thread | raw e-mail | index | archive | help


  I have server, named "blob", which exports some shares via NFSv4:

/usr                    -maproot 0:0 -network 192.168.134.0 -mask 255.255.255.0
... <snip 4 more records for /usr for different networks> ...
/usr/ports              -maproot 0:0 -network 192.168.134.0 -mask 255.255.255.0
/usr/ports/distfiles    -maproot 0:0 -network 192.168.134.0 -mask 255.255.255.0
/usr/home               -maproot 0:0 -network 192.168.134.0 -mask 255.255.255.0
/usr/home/lev           -maproot 0:0 -network 192.168.134.0 -mask 255.255.255.0
... <snip all other home directories> ...
V4:     /usr    -sec=sys -network 192.168.134.0 -mask 255.255.255.0
... <snip 4 more records for V4 for different networks> ...

(it is shame, that I need to enumerate all home directories separately, for each my network!)

So, NFSv4 uses "/usr" as export root and exports shares with stripped "/usr" prefix ("/home", /ports" not "/usr/home", "/usr/ports").

I could mount "blob:/home" or "blob:/ports" with mount -t nfs like this:

# mount -t nfs -o nfsv4,tcp blob:/home /mnt
# ls /mnt
.... lev ....
# umount /mnt
# ls /mnt
#

  No problem, it works.

I've added "nfsv4,tcp" options to "/net" map in "/etc/auto_master", run "automount" and try:

# cd /net/blob/home
/net/blob/home: No such file or directory
# ls /net
blob
# ls /net/blob
usr
# cd /net/blob/usr/home
WARNING: autofs_trigger_one: request for /net/blob/usr/ completed with error 5, pid 1519 (csh)
May 13 23:05:15 hamster automountd[2564]: mount failed
... <snip 4 more repitions of the same> ...
/net/blob/usr/home: Input/output error
#

Looks like it is because "autofs" uses "showmount -E" to determine available mount points, and "showmount" shows NFSv3 mounts, which conflicts with NFSv4.

Should it work out-of-the-box? Or I need to custom-fix script in "/etc/autofs" (I don't like this idea!)

-- 
// Lev Serebryakov



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36080caf-4aa1-d262-cb93-9df9b72f884d>