nfsd (7) Linux Manual Page
nfsd – special filesystem for controlling Linux NFS server
Synposis
mount -t nfsd nfsd /proc/fs/nfsd
Description
The nfsd filesystem is a special filesystem which provides access to the Linux NFS server. The filesystem consists of a single directory which contains a number of files. These files are actually gateways into the NFS server. Writing to them can affect the server. Reading from them can provide information about the server.
This file system is only available in Linux 2.6 and later series kernels (and in the later parts of the 2.5 development series leading up to 2.6). This man page does not apply to 2.4 and earlier.
As well as this filesystem, there are a collection of files in the procfs filesystem (normally mounted at /proc) which are used to control the NFS server. This manual page describes all of these files.
The exportfs and mountd programs (part of the nfs-utils package) expect to find this filesystem mounted at /proc/fs/nfsd or /proc/fs/nfs. If it is not mounted, they will fall-back on 2.4 style functionality. This involves accessing the NFS server via a systemcall. This systemcall is scheduled to be removed after the 2.6 kernel series.
Details
The three files in the nfsd filesystem are:
exports- This file contains a list of filesystems that are currently exported and clients that each filesystem is exported to, together with a list of export options for that client/filesystem pair. This is similar to the
/proc/fs/nfs/exportsfile in 2.4. One difference is that a client doesn’t necessarily correspond to just one host. It can respond to a large collection of hosts that are being treated identically.Each line of the file contains a path name, a client name, and a number of options in parentheses. Any space, tab, newline or back-slash character in the path name or client name will be replaced by a backslash followed by the octal ASCII code for that character.
threads- This file represents the number of
nfsdthread currently running. Reading it will show the number of threads. Writing an ASCII decimal number will cause the number of threads to be changed (increased or decreased as necessary) to achieve that number. filehandle- This is a somewhat unusual file in that what is read from it depends on what was just written to it. It provides a transactional interface where a program can open the file, write a request, and read a response. If two separate programs open, write, and read at the same time, their requests will not be mixed up.
The request written to
filehandleshould be a client name, a path name, and a number of bytes. This should be followed by a newline, with white-space separating the fields, and octal quoting of special characters.On writing this, the program will be able to read back a filehandle for that path as exported to the given client. The filehandle’s length will be at most the number of bytes given.
The filehandle will be represented in hex with a leading ‘
