Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 May 2021 20:59:59 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        freebsd-fs <freebsd-fs@freebsd.org>, "lev@FreeBSD.org" <lev@FreeBSD.org>
Subject:   =?Windows-1252?Q?Re:_autofs_+_default_/net_map_+_NFS4_=97_how_to=3F?=
Message-ID:  <YQXPR0101MB096828A9397C565DF5ADC89CDD519@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <36080caf-4aa1-d262-cb93-9df9b72f884d@FreeBSD.org>
References:  <36080caf-4aa1-d262-cb93-9df9b72f884d@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
lev wrote:=0A=
>  I have server, named "blob", which exports some shares via NFSv4:=0A=
>=0A=
>/usr                    -maproot 0:0 -network 192.168.134.0 -mask 255.255.=
255.0=0A=
>... <snip 4 more records for /usr for different networks> ...=0A=
>/usr/ports              -maproot 0:0 -network 192.168.134.0 -mask 255.255.=
255.0=0A=
>/usr/ports/distfiles    -maproot 0:0 -network 192.168.134.0 -mask 255.255.=
255.0=0A=
>/usr/home               -maproot 0:0 -network 192.168.134.0 -mask 255.255.=
255.0=0A=
>/usr/home/lev           -maproot 0:0 -network 192.168.134.0 -mask 255.255.=
255.0=0A=
>... <snip all other home directories> ...=0A=
>V4:     /usr    -sec=3Dsys -network 192.168.134.0 -mask 255.255.255.0=0A=
>... <snip 4 more records for V4 for different networks> ...=0A=
>=0A=
>(it is shame, that I need to enumerate all home directories separately, fo=
r each my network!)=0A=
You can do the exports lines without "-network..." and then they apply to a=
ll subnets.=0A=
Not recommended unless you have an external firewall/nat gateway that is bl=
ocking=0A=
incoming traffic to port#2049.=0A=
=0A=
>So, NFSv4 uses "/usr" as export root and exports shares with stripped "/us=
r" prefix ("/home", /ports" not "/usr/home", >"/usr/ports").=0A=
>=0A=
>I could mount "blob:/home" or "blob:/ports" with mount -t nfs like this:=
=0A=
>=0A=
># mount -t nfs -o nfsv4,tcp blob:/home /mnt=0A=
># ls /mnt=0A=
>.... lev ....=0A=
># umount /mnt=0A=
># ls /mnt=0A=
>#=0A=
>=0A=
> No problem, it works.=0A=
>=0A=
>I've added "nfsv4,tcp" options to "/net" map in "/etc/auto_master", run "a=
utomount" and try:=0A=
>=0A=
># cd /net/blob/home=0A=
>/net/blob/home: No such file or directory=0A=
># ls /net=0A=
>blob=0A=
># ls /net/blob=0A=
>usr=0A=
># cd /net/blob/usr/home=0A=
>WARNING: autofs_trigger_one: request for /net/blob/usr/ completed with err=
or 5, pid 1519 (csh)=0A=
>May 13 23:05:15 hamster automountd[2564]: mount failed=0A=
>... <snip 4 more repitions of the same> ...=0A=
>/net/blob/usr/home: Input/output error=0A=
>#=0A=
>=0A=
>Looks like it is because "autofs" uses "showmount -E" to determine availab=
le mount points, and "showmount" shows >NFSv3 mounts, which conflicts with =
NFSv4.=0A=
I know nothing about autofs and never use it. (/etc/fstab is your friend;-)=
=0A=
However, if it is using "showmount -E" (an RPC for the Mount protocol that =
is an auxiliary=0A=
to NFSv3) for NFSv4 then, yes, it is broken.=0A=
--> It should either "just try the mount" or do the following NFSv4 compoun=
d RPC:=0A=
      PutRootFH=0A=
      Lookup <dir>=0A=
      ... for each directory in mount path=0A=
      Getattr=0A=
     - If the above succeeds (NFS_OK) and the getattr reply shows the type =
as DIR,=0A=
       then that is roughly the same as above (although it might work even =
when the=0A=
       directory is not exported, so it probably is not worth the effort an=
d just trying=0A=
       the mount would be better, I think?=0A=
=0A=
>Should it work out-of-the-box? Or I need to custom-fix script in "/etc/aut=
ofs" (I don't like this idea!)=0A=
I suspect changing your V4: lines to specify "/" may work around this, sinc=
e the=0A=
mount paths then look the same as for NFSv3.=0A=
=0A=
rick=0A=
=0A=
--=0A=
// Lev Serebryakov=0A=
_______________________________________________=0A=
freebsd-fs@freebsd.org mailing list=0A=
https://lists.freebsd.org/mailman/listinfo/freebsd-fs=0A=
To unsubscribe, send any mail to "freebsd-fs-unsubscribe@freebsd.org"=0A=
=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQXPR0101MB096828A9397C565DF5ADC89CDD519>