Header Ads Widget

[MAN] nfsd

Content-type: text/html; charset=UTF-8 Man page of nfsd


Section: Environments, Tables, and Troff Macros (7)
Updated: 3 July 2003
Index Return to Main Contents


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. 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.  


The three files in the nfsd filesystem are:
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/exports file 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.

This file represents the number of nfsd thread 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.

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 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:

This cache maps the name of a client (or domain) to an internal data structure. The only access that is possible is to flush the cache.

This cache contains a mapping from IP address to the name of the authentication domain that the ipaddress should be treated as part of.

This cache contains a mapping from directory and domain to export options.

This cache contains a mapping from domain and a filesystem identifier to a directory. The filesystem identifier is stored in the filehandles and consists of a number indicating the type of identifier and a number of hex bytes indicating the content of the identifier.

Each directory representing a cache can hold from 1 to 3 files. They are:

When a number of seconds since epoch (1 Jan 1970) is written to this file, all entries in the cache that were last updated before that file become invalidated and will be flushed out. Writing 1 will flush everything. This is the only file that will always be present.

This file, if present, contains a textual representation of ever entry in the cache, one per line. If an entry is still in the cache (because it is actively being used) but has expired or is otherwise invalid, it will be presented as a comment (with a leading hash character).

This file, if present, acts a channel for request from the kernel-based nfs server to be passed to a user-space program for handling.

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
appear in the auth.unix.ip/content file. The user-space program might then write
      nfsd 1057206953 localhost
to indicate that 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
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.



nfsd(8), rpc.nfsd(8), exports(5), nfsstat(8), mountd(8) exportfs(8).







This document was created by man2html, using the manual pages.
Time: 04:45:57 GMT, September 16, 2022 Content-type: text/html; charset=UTF-8 Man page of rpc.nfsd


Section: Maintenance Commands (8)
Updated: 20 Feb 2014
Index Return to Main Contents


rpc.nfsd - NFS server process  


/usr/sbin/rpc.nfsd [options] nproc  


The rpc.nfsd program implements the user level part of the NFS service. The main functionality is handled by the nfsd kernel module. The user space program merely specifies what sort of sockets the kernel service should listen on, what NFS versions it should support, and how many kernel threads it should use.

The rpc.mountd server provides an ancillary service needed to satisfy mount requests by NFS clients.  


-d or --debug
enable logging of debugging messages
-H or --host hostname
specify a particular hostname (or address) that NFS requests will be accepted on. By default, rpc.nfsd will accept NFS requests on all known network addresses. Note that lockd (which performs file locking services for NFS) may still accept request on all known network addresses. This may change in future releases of the Linux Kernel. This option can be used multiple time to listen to more than one interface.
-p or --port port
specify a different port to listen on for NFS requests. By default, rpc.nfsd will listen on port 2049.
-r or --rdma
specify that NFS requests on the standard RDMA port ("nfsrdma", port 20049) should be honored.
Listen for RDMA requests on an alternate port - may be a number or a name listed in /etc/services.
-N or --no-nfs-version vers
This option can be used to request that rpc.nfsd does not offer certain versions of NFS. The current version of rpc.nfsd can support NFS versions 2,3,4 and the newer version 4.1.
-s or --syslog
By default, rpc.nfsd logs error messages (and debug messages, if enabled) to stderr. This option makes rpc.nfsd log these messages to syslog instead. Note that errors encountered during option processing will still be logged to stderr regardless of this option.
-T or --no-tcp
Disable rpc.nfsd from accepting TCP connections from clients.
-U or --no-udp
Disable rpc.nfsd from accepting UDP connections from clients.
-V or --nfs-version vers
This option can be used to request that rpc.nfsd offer certain versions of NFS. The current version of rpc.nfsd can support NFS versions 2,3,4 and the newer version 4.1.
-L or --lease-time seconds
Set the lease-time used for NFSv4. This corresponds to how often clients need to confirm their state with the server. Valid range is from 10 to 3600 seconds.
-G or --grace-time seconds
Set the grace-time used for NFSv4 and NLM (for NFSv2 and NFSv3). New file open requests (NFSv4) and new file locks (NLM) will not be allowed until after this time has passed to allow clients to recover state.
specify the number of NFS server threads. By default, just one thread is started. However, for optimum performance several threads should be used. The actual figure depends on the number of and the work load created by the NFS clients, but a useful starting point is 8 threads. Effects of modifying that number can be checked using the nfsstat(8) program.

Note that if the NFS server is already running, then the options for specifying host, port, and protocol will be ignored. The number of processes given will be the only option considered, and the number of active nfsd processes will be increased or decreased to match this number. In particular rpc.nfsd 0 will stop all threads and thus close any open connections.



If the program is built with TI-RPC support, it will enable any protocol and address family combinations that are marked visible in the netconfig database.



nfsd(7), rpc.mountd(8), exports(5), exportfs(8), rpc.rquotad(8), nfsstat(8), netconfig(5).  


Olaf Kirch, Bill Hawes, H. J. Lu, G. Allan Morris III, and a host of others.




This document was created by man2html, using the manual pages.
Time: 04:45:59 GMT, September 16, 2022

댓글 쓰기

0 댓글