Manual Reference Pages - NFSV4 (4)
- NFS Version 4 Protocol
The NFS client and server provides support for the
Network File System (NFS) Version 4 Protocol RFC 3530.
The protocol is somewhat similar to NFS Version 3, but differs in significant
It uses a single compound RPC that concatenates operations to-gether.
Each of these operations are similar to the RPCs of NFS Version 3.
The operations in the compound are performed in order, until one of
them fails (returns an error) and then the RPC terminates at that point.
integrated locking support, which implies that the server is no longer
As such, the
server remains in recovery mode for a grace period (always greater than the
lease duration the server uses) after a reboot.
During this grace period, clients may recover state but not perform other
open/lock state changing operations.
To provide for correct recovery semantics, a small file described by
is used by the server during the recovery phase.
If this file is missing or empty, there is a backup copy maintained by
that will be used. If either file is missing, they will be
created by the
If both the file and the backup copy are empty,
it will result in the server starting without providing a grace period
Note that recovery only occurs when the server
machine is rebooted, not when the
are just restarted.
It provides several optional features not present in NFS Version 3:
- NFS Version 4 ACLs
- Referrals, which redirect subtrees to other servers
(not yet implemented)
- Delegations, which allow a client to operate on a file locally
protocol does not use a separate mount protocol and assumes that the
server provides a single file system tree structure, rooted at the point
in the local file system tree specified by one or more
V4: <rootdir> [-sec=secflavors] [host(s) or net]
line(s) in the
allows a limited subset of operations to be performed on non-exported subtrees
of the local file system, so that traversal of the tree to the exported
subtrees is possible.
As such, the <rootdir> can be in a non-exported file system.
The exception is ZFS, which checks exports and, as such, all ZFS file systems
below the <rootdir> must be exported.
the entire tree that is rooted at that point must be in local file systems
that are of types that can be NFS exported.
file system is rooted at <rootdir>, setting this to anything other
than / will result in clients being required to use different mount
than for NFS Version 2 or 3.
Unlike NFS Version 2 and 3, Version 4 allows a client mount to span across
multiple server file systems, although not all clients are capable of doing
uses names for users and groups instead of numbers.
On the wire, they
take the form:
where <dns.domain> is not the same as the DNS domain used
for host name lookups, but is usually set to the same string.
Most systems set this <dns.domain>
to the domain name part of the machines
However, this can normally be overridden by a command line
option or configuration file for the daemon used to do the name<->number
Under FreeBSD, the mapping daemon is called
and has a command line option that overrides the domain component of the
For use of
either client or server, this daemon must be running.
If this <dns.domain> is not set correctly or the daemon is not running, ls -l will typically
report a lot of nobody and nogroup ownerships.
Although uid/gid numbers are no longer used in the
protocol, they will still be in the RPC authentication fields when
using AUTH_SYS (sec=sys), which is the default.
As such, in this case both the user/group name and number spaces must
be consistent between the client and server.
However, if you run
with RPCSEC_GSS (sec=krb5, krb5i, krb5p), only names and KerberosV tickets
will go on the wire.
To set up the NFS server that supports
you will need to either set the variables in
without the -o option, which would force use of the old server.
daemon must also be running.
You will also need to add at least one V4: line to the
If the file systems you are exporting are only being accessed via
there are a couple of
variables that you can change, which might improve performance.
when set non-zero, allows the server to issue Open Delegations to
These delegations permit the client to manipulate the file
locally on the client.
Unfortunately, at this time, client use of
delegations is limited, so performance gains may not be observed.
This can only be enabled when the file systems being exported to
clients are not being accessed locally on the server and, if being
accessed via NFS Version 2 or 3 clients, these clients cannot be
using the NLM.
can be set to 0 to disable acquisition of local byte range locks.
Disabling local locking can only be done if neither local accesses
to the exported file systems nor the NLM is operating on them.
Note that Samba server access would be considered local access for the above
To build a kernel with the NFS server that supports
linked into it, the
must be specified in the kernels
To do an
mount, specify the nfsv4 option on the
This will force use of the client that supports
plus set tcp and
must be running, as above.
Also, since an
mount uses the host uuid to identify the client uniquely to the server,
you cannot safely do an
is set in
server that is being mounted on supports delegations, you can start the
daemon to handle client side callbacks.
This will occur if
are set in
Without a functioning callback path, a server will never issue Delegations
to a client.
By default, the callback address will be set to the IP address acquired via
rtalloc() in the kernel and port# 7745.
To override the default port#, a command line option for
can be used.
To get callbacks to work when behind a NAT gateway, a port for the callback
service will need to be set up on the NAT gateway and then the address
of the NAT gateway (host IP plus port#) will need to be set by assigning the
variable vfs.nfs.callback_addr to a string of the form:
where the first 4 Ns are the host IP address and the last two are the
port# in network byte order (all decimal #s in the range 0-255).
To build a kernel with the client that supports
linked into it, the option
must be specified in the kernels
Options can be specified for the
daemons at boot time via the nfsuserd_flags and nfscbd_flags
NFSv4 mount(s) against exported volume(s) on the same host are not recommended,
since this can result in a hung NFS server.
It occurs when an nfsd thread tries to do an NFSv4 VOP_RECLAIM()/Close RPC
as part of acquiring a new vnode.
If all other nfsd threads are blocked waiting for lock(s) held by this nfsd
thread, then there isnt an nfsd thread to service the Close RPC.
NFS V4 stable restart file
backup copy of the file
At this time, there is no recall of delegations for local file system
As such, delegations should only be enabled for file systems
that are being used solely as NFS export volumes and are not being accessed
via local system calls nor services such as Samba.
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.