|
NAMENFSv4 —
NFS Version 4 Protocol
DESCRIPTIONThe NFS client and server provides support for the NFSv4 specification; see Network File System (NFS) Version 4 Protocol RFC 7530, Network File System (NFS) Version 4 Minor Version 1 Protocol RFC 5661, Network File System (NFS) Version 4 Minor Version 2 Protocol RFC 7862, File System Extended Attributes in NFSv4 RFC 8276 and Parallel NFS (pNFS) Flexible File Layout RFC 8435. The protocol is somewhat similar to NFS Version 3, but differs in significant ways. 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.It has integrated locking support, which implies that the server
is no longer stateless. As such, the 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 - pNFS, where I/O operations are separated from Metadata operations And for NFSv4.2 only - User namespace extended attributes - lseek(SEEK_DATA/SEEK_HOLE) - File copying done locally on the server for copy_file_range(2) - posix_fallocate(2) - posix_fadvise(POSIX_FADV_WILLNEED/POSIX_FADV_DONTNEED) The V4: <rootdir> [-sec=secflavors] [host(s) or net] line(s) in the
exports(5)
file. (See
exports(5)
for details.) The
nfsd(8)
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.
However, the entire tree that is rooted at that point must be in local file
systems that are of types that can be NFS exported. Since the
<user>@<dns.domain> 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
machine's
hostname(1)
by default. However, this can normally be overridden by a command line
option or configuration file for the daemon used to do the
name<->number mapping. Under FreeBSD, the
mapping daemon is called
nfsuserd(8)
and has a command line option that overrides the domain component of the
machine's hostname. For use of this form of string on
The form where the numbers are in the strings can only be used for AUTH_SYS. To configure your systems this way, the nfsuserd(8) daemon does not need to be running on the server, but the following sysctls need to be set to 1 on the server. vfs.nfs.enable_uidtostring vfs.nfsd.enable_stringtouid On the client, the sysctl vfs.nfs.enable_uidtostring must be set to 1 and the nfsuserd(8) daemon does not need to be running. If these strings are not configured correctly, ``ls -l'' will typically report a lot of ``nobody'' and ``nogroup'' ownerships. Although uid/gid numbers are no longer used in the
However, if you run SERVER SETUPTo set up the NFS server that supportsNFSv4 , you will
need to set the variables in
rc.conf(5)
as follows:
nfs_server_enable="YES" nfsv4_server_enable="YES" plus nfsuserd_enable="YES" if the server is using the ``<user>@<domain>'' form of user/group strings or is using the ``-manage-gids'' option for nfsuserd(8). You will also need to add at least one ``V4:'' line to the
exports(5)
file for If the file systems you are exporting are only being accessed via
Note that Samba server access would be considered ``local access'' for the above discussion. To build a kernel with the NFS server that supports
options NFSD must be specified in the kernel's config(5) file. CLIENT MOUNTSTo do anNFSv4 mount, specify the ``nfsv4'' option on
the
mount_nfs(8)
command line. This will force use of the client that supports
NFSv4 plus set ``tcp'' and
NFSv4 .
The
nfsuserd(8)
must be running if name<->uid/gid mapping is being used, as above.
Also, since an hostid_enable="NO" is set in rc.conf(5). If the nfsuserd_enable="YES" <-- If name<->uid/gid mapping is being used. nfscbd_enable="YES" are set in rc.conf(5). Without a functioning callback path, a server will never issue Delegations to a client. For NFSv4.0, by default, the callback address will be set to the
IP address acquired via 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 sysctl(8) variable vfs.nfs.callback_addr to a string of the form: N.N.N.N.N.N 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). For NFSv4.1 and NFSv4.2, the callback path (called a backchannel) uses the same TCP connection as the mount, so none of the above applies and should work through gateways without any issues. To build a kernel with the client that supports
options NFSCL must be specified in the kernel's config(5) file. Options can be specified for the nfsuserd(8) and nfscbd(8) daemons at boot time via the ``nfsuserd_flags'' and ``nfscbd_flags'' rc.conf(5) variables. 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 FILES
SEE ALSOstablerestart(5), mountd(8), nfscbd(8), nfsd(8), nfsdumpstate(8), nfsrevoke(8), nfsuserd(8)BUGSAt this time, there is no recall of delegations for local file system operations. 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. |