Index | Thread | Search

From:
obsd@mulh.net
Subject:
Re: Mount NFS specific options
To:
tech@openbsd.org
Date:
Sat, 25 Apr 2026 13:52:25 -0400

Download raw body.

Thread
  • obsd@mulh.net:

    Mount NFS specific options

On 2026-04-25 10:47:06, Stuart Henderson wrote:
> I'm not convinced this is needed at all.
>
> But, if it is, the usual way of showing short and long options in a
> manual is like this:
>
> .It Fl b , -bg
>
> Duplicating the descriptions is definitely not the right way

"bg" is a mount option, not a long form of -b.
Mount options being 4th field in /etc/fstab or parameters to -o option.

Using read-only as an example, in the "man mount" manpage you have:

	-r	The file system is to be mounted read-only.  Mount the file
		system read-only (even the superuser may not write it).  The
		same as the "rdonly" argument to the -o option.

and you'll also find within the "-o" option description:

	-o options

		rdonly	The same as -r; mount the file system read-only (even
			the superuser may not write it).

So read-only is described twice, once as its' own option -r
and again as the mount option rdonly.

In "man mount_nfs" we have:

	-i	Make the mount interruptible, which implies that file system
		calls that are delayed due to an unresponsive server will fail
		with EINTR when a termination signal is posted for the process.

	-s	A soft mount, which implies that file system calls will fail
		after retrans round trip timeout intervals have been reached
		(see -x).

and described within -o options we have:

	-o options

		(nothing)

It is not documented that "soft" and "intr" are mount option keywords.
But look at the example used in "man fstab"

	server:/export/ports /usr/ports nfs rw,nodev,nosuid,soft,intr 0 0

Or if you have NFS mounts look at the output of mount:

	server:/export on /nfs type nfs (nodev, noexec, nosuid, v3, udp, soft, intr, timeo=100)

You'll find NFS mount options "soft" and "intr" are very common but
yet these two options and others are not documented in OpenBSD.

My last diff posted adds the mount options supported by mount_nfs to
its' manpage following the style used in both mount and mount_nfs manpages.

	-o options
		Options are specified with a -o flag followed by a comma
		separated string of options.  The prefix "no" may be added to
		invert the behavior of default options that do not take
		arguments.  See the mount(8) man page for possible options and
		their meanings.

		The following NFS specific options are also available:

		ac		Enable attribute caching for both files and
				directories (default).

		acdirmax=num	Cache directory attributes for no more than num
				seconds.  The default is 60 seconds.

		acdirmin=num	Cache directory attributes for at least num
				seconds.  The default is 5 seconds.

		acregmax=num	Cache file attributes for no more than num
				seconds.  The default is 60 seconds.

		acregmin=num	Cache file attributes for at least num seconds.
				The default is 5 seconds.

		bg		The same as -b; Keep trying mount in background.

		conn		The same as -c; For UDP, do not do a connect.

		dumbtimer	The same as -d; Turn off dynamic estimator.

		intr		The same as -i; Make the mount interruptible.

		mntudp		The same as -U; Force mount protocol to use UDP.

		nfsv2		The same as -2; Use NFS version 2 protocol.

		nfsv3		The same as -3; Use NFS version 3 protocol.

		port=portnumber	Use the specified port number for NFS requests.
				The default is to query the portmapper for the
				NFS port.

		rdirplus	The same as -l; Use "readdir plus" RPC.

		resvport	Use a reserved socket port number (default).

		soft		The same as -s; A soft mount.

		tcp		The same as -T; Use TCP instead of UDP.

I don't like duplicating descriptions either but having no description in
the mount options section felt too tacky thus I included a few words, the
full description is of course by the -X option letter referenced.


--- sbin/mount_nfs/mount_nfs.8	Thu Nov  9 13:47:27 2023	1.41
+++ sbin/mount_nfs/mount_nfs.8	Fri Apr 24 13:54:22 2026
@@ -163,9 +163,51 @@
 .Ar num
 seconds.
 The default is 5 seconds.
+.It Cm bg
+The same as
+.Fl b ;
+Keep trying mount in background.
+.It Cm conn
+The same as
+.Fl c ;
+For UDP, do not do a connect.
+.It Cm dumbtimer
+The same as
+.Fl d ;
+Turn off dynamic estimator.
+.It Cm intr
+The same as
+.Fl i ;
+Make the mount interruptible.
+.It Cm mntudp
+The same as
+.Fl U ;
+Force mount protocol to use UDP.
+.It Cm nfsv2
+The same as
+.Fl 2 ;
+Use NFS version 2 protocol.
+.It Cm nfsv3
+The same as
+.Fl 3 ;
+Use NFS version 3 protocol.
 .It Cm port Ns = Ns Ar portnumber
 Use the specified port number for NFS requests.
 The default is to query the portmapper for the NFS port.
+.It Cm rdirplus
+The same as
+.Fl l ;
+Use "readdir plus" RPC.
+.It Cm resvport
+Use a reserved socket port number (default).
+.It Cm soft
+The same as
+.Fl s ;
+A soft mount.
+.It Cm tcp
+The same as
+.Fl T ;
+Use TCP instead of UDP.
 .El
 .It Fl R Ar retrycnt
 Set the retry count for doing the mount to the specified value.


If you're really observant you will notice the disparency between
mount and mount_nfs (it's visible above) but that's another issue.