| MOUNT_NFS(8) | System Manager's Manual | MOUNT_NFS(8) | 
mount_nfs —
| mount_nfs | [ -23bCcdilPpqsTUuX] [-amaxreadahead] [-Ddeadthresh] [-gmaxgroups] [-Ireaddirsize] [-Lleaseterm] [-ooptions] [-Rretrycnt] [-rreadsize] [-ttimeout] [-wwritesize] [-xretrans] rhost:path node | 
mount_nfs command calls the
  mount(2) system call to prepare
  and graft a remote NFS file system (rhost:path) on to the file system tree at
  the mount point node. The directory specified by
  node is converted to an absolute path before use. This
  command is normally executed by
  mount(8). It implements the mount
  protocol as described in RFC 1094, Appendix A and NFS:
  Network File System Version 3 Protocol Specification, Appendix I.
The options are:
-2-3-a
    maxreadahead-b-C-c-D
    deadthresh-d-g
    maxgroups-I
    readdirsizeDIRBLKSIZ that is
      ≤ the read size for the mount.-iEINTR when a termination signal is posted for the
      process.-L
    leaseterm-lReaddirPlus() RPC should be used. This option
      reduces RPC traffic for cases such as ls -l, but
      tends to flood the attribute and name caches with prefetched entries. Try
      this option and see whether performance improves or degrades. Probably
      most useful for client to server network interconnects with a large
      bandwidth times delay product.-o
    options-o flag followed by a
      comma separated string of options. See the
      mount(8) man page for
      possible options and their meanings.
    The following NFS specific options are also available:
bg-b.conn-C.deadthresh=⟨deadthresh⟩-D
        deadthresh.dumbtimer-d.intr-i.leaseterm=⟨leaseterm⟩-L
        leaseterm.maxgrps=⟨maxgroups⟩-g
        maxgroups.mntudp-U.nfsv2-2.nfsv3-3.noresport-p.nqnfs-q.port=⟨portnumber⟩rdirplus-l.readahead=⟨maxreadahead⟩-a
        maxreadahead.rsize=⟨readsize⟩--r
        readsize.soft-s.tcp-T.udp-u.timeo=⟨timeout⟩-t timeout.wsize=⟨writesize⟩-w
        writesize.-P-p-q-3. It used to specify NQNFS.-R
    retrycnt-r
    readsizeThis should be used for UDP mounts when the “fragments
        dropped after timeout” value is getting large while actively
        using a mount point. Use
        netstat(1) with the
        -s option to see what the “fragments
        dropped after timeout” value is. See the
        mount_nfs -w option
        also.
-s-T-t
    timeout-U-u-w
    writesizeThe same logic applies for use of this option as with the
        mount_nfs -r option, but
        using the “fragments dropped after timeout” value on the
        NFS server instead of the client. Note that both the
        -r and -w options should
        only be used as a last ditch effort at improving performance when
        mounting servers that do not support TCP mounts.
-X-x
    retransmount_nfs is with a command
  like:
mount -t nfs remotehost:/filesystem
  /localmountpointIt is also possible to automatically mount filesystems at boot from your /etc/fstab by using a line like:
remotehost:/home /home nfs rw 0
  0-r and
      -w options respectively will increase throughput
      if the network interface can handle the larger packet sizes.
    The default size for NFS version 2 is 8K when using UDP, 64K when using TCP.
The default size for NFS version 3 is platform dependent: on NetBSD/amd64 and NetBSD/i386, the default is 32K, for other platforms it is 8K. Values over 32K are only supported for TCP, where 64K is the maximum.
Any value over 32K is unlikely to get you more performance, unless you have a very fast network.
This can especially happen with older Ethernet network interfaces. What happens is that either the receive buffer on the network interface on the client side is overflowing, or that similar events occur on the server, leading to a lot of dropped packets.
In this case, decreasing the read and write size, using TCP, or a combination of both will usually lead to better throughput. Should you need to decrease the read and write size for all your NFS mounts because of a slow Ethernet network interface (e.g. a USB 1.1 to 10/100 Ethernet network interface), you can use
options NFS_RSIZE=valueoptions NFS_WSIZE=valuein your kernel config(1) file to avoid having do specify the sizes for all mounts.
mount_nfs can be difficult for
  first time users to understand.
mount_nfs: can't access /foo:
  Permission deniedThis message means that the remote host is either not exporting the filesystem you requested, or is not exporting it to your host. If you believe the remote host is indeed exporting a filesystem to you, make sure the exports(5) file is exporting the proper directories.
A common mistake is that
    mountd(8) will not export a
    filesystem with the -alldirs option, unless it is a
    mount point on the exporting host. It is not possible to remotely mount a
    subdirectory of an exported mount, unless it is exported with the
    -alldirs option.
The following error:
NFS Portmap: RPC: Program not
  registeredmeans that the remote host is not running mountd(8). The program rpcinfo(8) can be used to determine if the remote host is running nfsd, and mountd by issuing the command:
rpcinfo -p
  remotehostnameIf the remote host is running nfsd, and mountd, it would display:
100005 3 udp 719 mountd100005 1 tcp 720 mountd100005 3 tcp 720 mountd100003 2 udp 2049 nfs100003 3 udp 2049 nfs100003 2 tcp 2049 nfs100003 3 tcp 2049 nfsThe error:
mount_nfs: can't get net id for
  hostindicates that mount_nfs cannot resolve
    the name of the remote host.
NFS: Network File System Protocol specification, RFC 1094, March 1989.
NFS Version 2 and Version 3 Security Issues and the NFS Protocol's Use of RPCSEC_GCC and Kerberos V5, RFC 2623, June 1999.
NFS Version 4 Design Considerations, RFC 2624, June 1999.
Authentication Mechanisms for ONC RPC, RFC 2695, September 1999.
mount_nfs utility appeared in
  4.4BSD.
| September 12, 2016 | NetBSD 9.4 |