nfsd(7) | Miscellaneous Information Manual | nfsd(7) |
nfsd - special filesystem for controlling Linux NFS server
mount -t nfsd nfsd /proc/fs/nfsd
The nfsd filesystem is a special filesystem which provides access to the Linux NFS server. Writing to files in this filesystem can affect the server. Reading from them can provide information about the server.
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.
Files in the nfsd filesystem include:
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.
The request written to filehandle should 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 '\x'.
The directory /proc/net/rpc in the procfs filesystem contains a number of files and directories. The files contain statistics that can be display using the nfsstat program. The directories contain information about various caches that the NFS server maintains to keep track of access permissions that different clients have for different filesystems. The caches are:
Each directory representing a cache can hold from 1 to 3 files. They are:
When the kernel needs some information which isn't in the
cache, it makes a line appear in the channel file giving the key
for the information. A user-space program should read this, find the
answer, and write a line containing the key, an expiry time, and the
content. For example the kernel might make nfsd 127.0.0.1
appear in the auth.unix.ip/content file. The user-space program
might then write nfsd 127.0.0.1 1057206953 localhost
to indicate that 127.0.0.1 should map to localhost, at least for now.
If the program uses select(2) or poll(2) to discover if it can read from the channel then it will never see and end-of-file but when all requests have been answered, it will block until another request appears.
In the /proc filesystem there are 4 files that can be used
to enabled extra tracing of nfsd and related code. They are:
/proc/sys/sunrpc/nfs_debug
/proc/sys/sunrpc/nfsd_debug
/proc/sys/sunrpc/nlm_debug
/proc/sys/sunrpc/rpc_debug
They control tracing for the NFS client, the NFS server, the Network Lock
Manager (lockd) and the underlying RPC layer respectively. Decimal numbers
can be read from or written to these files. Each number represents a
bit-pattern where bits that are set cause certain classes of tracing to be
enabled. Consult the kernel header files to find out what number correspond
to what tracing.
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.
Previously the nfsctl systemcall was used for communication between nfsd and user utilities. That systemcall was removed in kernel version 3.1. Older nfs-utils versions were able to fall back to nfsctl if necessary; that was removed from nfs-utils 1.3.5.
nfsd(8), rpc.nfsd(8), exports(5), nfsstat(8), mountd(8) exportfs(8).
NeilBrown
3 July 2003 |