NFS-Utils-1.2.8

Introduction to NFS Utilities

The NFS Utilities package contains the userspace server and client tools necessary to use the kernel's NFS abilities. NFS is a protocol that allows sharing file systems over the network.

This package is known to build and work properly using an LFS-7.4 platform.

Package information

NFS Utilities Dependencies

Required

libtirpc-0.2.3 and pkg-config-0.28

rpcbind-0.2.1 (Runtime dependency)

Optional for NFSv4 Support

libevent-2.0.21, SQLite-3.8.0.2, and libnfsidmap

Optional for GSS (RPC Security) Support

MIT Kerberos V5-1.11.3 or libgssapi, and librpcsecgss

Optional for SPKM-3 Support

SPKM-3

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/nfs-utils

Kernel Configuration

Enable the following options in the kernel configuration and recompile the kernel if necessary:

File systems:
  Network File Systems:
    NFS File System Support: M or Y
    NFS Server Support: M or Y

Select the appropriate sub-options that appear when the above options are selected.

Installation of NFS Utilities

Before you compile the program, ensure that the nobody user and nogroup group have been created. You can add them by running the following commands as the root user:

groupadd -g 99 nogroup &&
useradd -c "Unprivileged Nobody" -d /dev/null -g nogroup \
    -s /bin/false -u 99 nobody
[Note]

Note

The classic uid and gid values are 65534 which is also -2 when interpreted as a signed 16-bit number. These values impact other files on some filesystems that do not have support for sparse files. The nobody and nogroup values are relatively arbitrary. The impact on a server is nil if the exports file is configured correctly. If it is misconfigured, an ls -l or ps listing will show a uid or gid number of 65534 instead of a name. The client uses nobody only as the user running rpc.statd.

Install NFS Utilities by running the following commands:

./configure --prefix=/usr          \
            --sysconfdir=/etc      \
            --without-tcp-wrappers \
            --disable-nfsv4        \
            --disable-nfsv41       \
            --disable-gss &&
make

If your /usr directory is NFS mounted, you should install the executables in /sbin by passing an additional parameter --sbindir=/sbin to the above ./configure command.

This package does not come with a working test suite.

Now, as the root user:

make install

Command Explanations

--disable-nfsv4 and --disable-nfsv41: Disables support for NFS version 4 and version 4.1.

--disable-gss: Disables support for RPCSEC GSS (RPC Security).

--without-tcp-wrappers: This option is needed because TCP Wrappers is not in BLFS.

Configuring NFS Utilities

Server Configuration

/etc/exports contains the exported directories on NFS servers. Refer to the exports.5 manual page for the syntax of this file. Also refer to the "NFS HowTo" available at http://nfs.sourceforge.net/nfs-howto/ for information on how to configure the servers and clients in a secure manner. For example, for sharing the /home directory over the local network, the following line may be added:

/home <192.168.0.0/24>(rw,subtree_check,anonuid=99,anongid=99)
Boot Script

Install the /etc/rc.d/init.d/nfs-server init script included in the blfs-bootscripts-20130908 package to start the server at boot.

make install-nfs-server

Now create the /etc/sysconfig/nfs-server configuration file:

cat > /etc/sysconfig/nfs-server << "EOF"
PORT="2049"
PROCESSES="8"
QUOTAS="no"
KILLDELAY="10"
EOF
[Note]

Note

The above parameters may be optionally placed in /etc/sysconfig/rc.site.

Client Configuration

/etc/fstab contains the directories that are to be mounted on the client. Alternately the partitions can be mounted by using the mount command with the proper options. To mount the /home and /usr partitions, add the following to the /etc/fstab:

<server-name>:/home  /home nfs   rw,_netdev,rsize=8192,wsize=8192 0 0
<server-name>:/usr   /usr  nfs   ro,_netdev,rsize=8192            0 0

In some circumstances an /etc/netconfig file is required by an nfs client. It does no harm to create one even if it is not in fact needed. As the root user:

cat > /etc/netconfig << "EOF"
udp6 tpi_clts v inet6 udp - -
tcp6 tpi_cots_ord v inet6 tcp - -
udp tpi_clts v inet udp - -
tcp tpi_cots_ord v inet tcp - -
rawip tpi_raw - inet - - -
local tpi_cots_ord - loopback - - -
EOF
Boot Script
[Note]

Note

The following boot script is not required if the nfs-server script is installed.

Install the /etc/rc.d/init.d/nfs-client init script included in the blfs-bootscripts-20130908 package to start the client services at boot.

make install-nfs-client

To automatically mount nfs filesystems, clients will also need to install the netfs bootscript as described in Configuring for Network Filesystems.

Contents

Installed Programs: exportfs, mountstats, mount.nfs, mount.nfs4 (link to mount.nfs), nfsiostat, nfsstat, rpc.mountd, rpc.nfsd, rpc.statd, rpcdebug, showmount, sm-notify, start-statd, umount.nfs (link to mount.nfs), and umount.nfs4 (link to mount.nfs)
Installed Libraries: None
Installed Directories: /var/lib/nfs

Short Descriptions

exportfs

maintains a list of NFS exported file systems.

mountstats

displays NFS client per-mount statistics.

mount.nfs

Used to mount a network share using NFS

mount.nfs4

Used to mount a network share using NFSv4

nfsiostat

Report input/output statistics for network filesystems.

nfsstat

displays statistics kept about NFS client and server activity.

rpc.mountd

implements the NFS mount protocol on an NFS server.

rpc.nfsd

implements the user level part of the NFS service on the server.

rpc.statd

is used by the NFS file locking service. Run on both sides, client as well as server, when you want file locking enabled.

rpcdebug

sets or clears the kernel's NFS client and server debug flags.

showmount

displays mount information for an NFS server.

sm-notify

is used to send Network Status Monitor reboot messages.

start-statd

is a script called by nfsmount when mounting a filesystem with locking enabled, if statd does not appear to be running. It can be customised with whatever flags are appropriate for the site.

umount.nfs

Used to unmount a network share using NFS

umount.nfs4

Used to unmount a network share using NFSv4

Last updated on 2013-08-20 15:41:29 -0700