The Network File System (NFS) was developed to allow machines to mount a disk partition on a remote machine as if it were a local disk. It allows for fast, seamless sharing of files across a network.
It also gives the potential for unwanted people to access your hard drive over the network (and thereby possibly read your email and delete all your files as well as break into your system) if you set it up incorrectly. So please read Section 6, “Security and NFS” of this document carefully if you intend to implement an NFS setup.
There are other systems that provide similar functionality to NFS. Samba (http://www.samba.org) provides file services to Windows clients. The Andrew File System, originally developed by IBM (http://www.openafs.org) and now open-source, provides a file sharing mechanism with some additional security and performance features. The Coda File System (http://www.coda.cs.cmu.edu/) combines file sharing with a specific focus on disconnected clients. Many of the features of the Andrew and Coda file systems are slated for inclusion in the next version of NFS (Version 4) (http://www.nfsv4.org). The advantage of NFS today is that it is mature, standard, well understood, and supported robustly across a variety of platforms.
This HOWTO is intended as a complete, step-by-step guide to setting up NFS correctly and effectively. Setting up NFS involves two steps, namely configuring the server and then configuring the client. Each of these steps is dealt with in order. The document then offers some tips for people with particular needs and hardware setups, as well as security and troubleshooting advice.
This HOWTO is not a description of the guts and underlying implementation and architecture of NFS. Recommended materials that cover topics such as these can be found in the NFS FAQ (http://nfs.sourceforge.net/) , as well as in the Appendix of the HOWTO.
This document is also not intended as a complete reference manual, and does not contain an exhaustive list of the features of Linux NFS. For that, you can look at the man pages for nfs(5), exports(5), mount(8), fstab(5), nfsd(8), lockd(8), statd(8),rquotad(8), and mountd(8).
It will also not cover PC-NFS, which is considered obsolete (users are encouraged to use Samba to share files with Windows machines) or NFS Version 4, which is still in development.
You should know some basic things about TCP/IP networking before reading this HOWTO; if you are in doubt, read the Networking-Overview-HOWTO.
The differences between Version 2 NFS, Version 3 NFS, and Version 4 NFS will be explained later on; for now, you might simply take the suggestion that you will need NFS Version 3 if you are installing a dedicated, high-volume, or production file server. NFS Version 2 or 4 should be fine for casual use.
NFS Version 2 has been around for quite some time now (at least since the 1.2 kernel series) however you will need a kernel version of at least 2.2.18 if you wish to do any of the following:
There are also patches available for kernel versions above 2.2.14 that provide the above functionality. Some of them can be downloaded from the Linux NFS home page. If your kernel version is 2.2.14 - 2.2.17 and you have the source code on hand, you can tell if these patches have been added because NFS Version 3 server support will be a configuration option. However, unless you have some particular reason to use an older kernel, you should upgrade because many bugs have been fixed along the way. Kernel 2.2.19 contains some additional locking improvements over 2.2.18.
Version 3 functionality will also require the nfs-utils package of at least version 0.1.6, and mount version 2.10m or newer. However because nfs-utils and mount are fully backwards compatible, and because newer versions have lots of security and bug fixes, there is no good reason not to install the newest nfs-utils and mount packages if you are beginning an NFS setup.
All 2.4 and higher kernels have full NFS Version 3 functionality. All kernels 2.6 and higher have varying levels of NFS Version 4 functionality. This will be discussed in more detail later on.
In all cases, if you are building your own kernel, you will need to select NFS and the NFS versions support that you want to deploy. Nowadays almost every standard distribution of Linux provides a kernel that supports NFS version 3.
Handling files larger than 2 GB will require a 2.4x kernel or greater and a 2.2.x version or greater of glibc.
All kernels after 2.2.18 support NFS over TCP on the client side. Server-side NFS over TCP only exists in a buggy form as an experimental option in the post-2.2.18 series; patches for 2.4 and 2.5 kernels have been introduced starting with 2.4.17 and 2.5.6. Use of TCP in NFS is\ now mainstream and receives widespread use.
Because so many of the above functionalities were introduced in kernel version 2.2.18, this document was written to be consistent with kernels above this version (including 2.6.x). If you have an older kernel, this document may not describe your NFS system correctly.
As we write this document NFS version 4 support is under active development in the 2.6.x kernel. Its implementation is still very fluid and changing, and it is not recommended for production use. Configuration of NFS version 4 and associated integrated technologies are discussed later in this document.
As of November 2000, the Linux NFS homepage is at http://nfs.sourceforge.net. Please check there for NFS related mailing lists as well as the latest version of nfs-utils, NFS kernel patches, and other NFS related packages.
When you encounter a problem or have a question not covered in this manual, the faq or the man pages, you should send a message to the nfs mailing list (nfs at lists dot sourceforge dot net). To best help the developers and other users help you assess your problem you should include:
It is also useful to know the networking configuration connecting the hosts.
If your problem involves the inability mount or export shares please also include:
Sending all of this information with a specific question, after reading all the documentation, is the best way to ensure a helpful response from the list.
You may also wish to look at the man pages for nfs(5),exports(5), mount(8), fstab(5), nfsd(8), lockd(8), statd(8), rquotad(8), and mountd(8).