%general-entities; ]> $LastChangedBy$ $Date$ NFS-Utils-&nfs-utils-version; NFS-Utils 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. &lfs77_checked; Package Information Download (HTTP): Download (FTP): Download MD5 sum: &nfs-utils-md5sum; Download size: &nfs-utils-size; Estimated disk space required: &nfs-utils-buildsize; Estimated build time: &nfs-utils-time; NFS Utilities Dependencies Required Recommended , and (for NFSv4 support) and (for NFSv4.1 support) Optional , (for mountstats and nfsiostat), or libgssapi and librpcsecgss (for GSS and RPC security support) Required (runtime) User Notes: Kernel Configuration Enable the following options in the kernel configuration and recompile the kernel if necessary: File systems ---> [*] Network File Systems ---> [CONFIG_NETWORK_FILESYSTEMS] <*/M> NFS client support [CONFIG_NFS_FS] <*/M> NFS server support [CONFIG_NFSD] Select the appropriate sub-options that appear when the above options are selected. NFS-Utils Installation of NFS Utilities Fix an issue that would prevent rpc.statd from starting: sed -i "/daemon_init/s:\!::" utils/statd/statd.c Install NFS Utilities by running the following commands: ./configure --prefix=/usr \ --sysconfdir=/etc \ --sbindir=/sbin \ --enable-libmount-mount \ --without-tcp-wrappers \ --disable-gss && make To test the results, issue: make check. Now, as the root user: make install && install -v -m644 utils/mount/nfsmount.conf /etc/nfsmount.conf If the NFSv4 support was not disabled, run the following commands while still as the root user: install -v -dm555 /var/lib/nfs/rpc_pipefs && install -v -dm755 /var/lib/nfs/v4recovery && cat > /etc/idmapd.conf << "EOF" [General] Verbosity = 0 Pipefs-Directory = /var/lib/nfs/rpc_pipefs Domain = localdomain [Mapping] Nobody-User = nobody Nobody-Group = nogroup [Translation] Method = nsswitch EOF Command Explanations --enable-libmount-mount: This switch enables linking of the mount.nfs program with the libmount library. --without-tcp-wrappers: This switch disables TCP Wrappers support because it is not part of BLFS. --disable-gss: This switch disables support for RPCSEC GSS (RPC Security). Remove it if you have installed optional dependencies. : Tis switch disables support for NFS version 4. Use it if you have not installed recommended dependencies. It implies . : Tis switch disables support for NFS version 4.1. Use it if you have not installed LVM2 but stil wish to enable support for NFS version 4. Configuring NFS Utilities NFS 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 for information on how to configure the servers and clients in a secure manner. For sharing the /home directory over the local network using NFSv3, add the following line to /etc/exports: /home 192.168.0.0/24(rw,no_subtree_check,anonuid=99,anongid=99) NFSv4 exports exist in a single pseudo filesystem, where the real directories are mounted with the option. In order to share /home over NFSv4, you need to bind mount it into a pseudo filesystem you are going to export (in this example we will use /srv/nfsv4, in which case the /home directory will become /srv/nfsv4/home). install -v -dm755 /srv/nfsv4/home && mount -v --bind /home /srv/nfsv4/home To make the above change permanent, you can add the following line to your /etc/fstab: /home /srv/nfsv4/home none bind 0 0 Update /etc/exports to export your NFSv4 share: /srv/nfsv4 192.168.0.0/24(rw,fsid=0,no_subtree_check) /srv/nfsv4/home 192.168.0.0/24(rw,nohide,insecure,no_subtree_check) Be sure to replace the directory, network address and prefix above to match your network. The only space in the lines above should be between the directory and the network address. /etc/exportfs Systemd Units To start the NFS server daemons at boot, install the systemd units from the package by running the following command as the root user: make install-nfsv4-server If you have disabled NFSv4 support, run the following command as the root user to omit the NFSv4 specific systemd units: make install-nfs-server nfs-server You can edit the /etc/default/nfs-utils file to change the startup options for NFS daemons. Defaults should be fine for most use cases. /etc/default/nfs-utils 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,x-systemd.automount,x-systemd.device-timeout=10,timeo=14 0 0 <server-name>:/usr /usr nfs ro,x-systemd.automount,x-systemd.device-timeout=10,timeo=14 0 0 The options which can be used are specified in man 5 nfs. If both the client and server are running recent versions of Linux, most of the options will be negotiated. You can specify either rw or ro, x-systemd.automount if the filesystem is to be automatically mounted at boot, or noauto (and perhaps user) for other filesystems. If the fileserver is not running a recent version of Linux, you may need to specifiy other options. /etc/fstab Systemd Units The following systemd unis are not required if the nfs-server units were previously installed. To start the NFS client services at boot, install the systemd units from the package by running the following command as the root user: make install-nfs-client nfs-client Contents Installed Programs Installed Libraries Installed Directories blkmapd, exportfs, mount.nfs, mount.nfs4 (link to mount.nfs), mountstats, nfsdcltrack, nfsiostat, nfsstat, osd_login, rpcdebug, rpc.idmapd, rpc.mountd, rpc.nfsd, rpc.statd, showmount, sm-notify, start-statd, umount.nfs (link to mount.nfs) and umount.nfs4 (link to mount.nfs) None /var/lib/nfs Short Descriptions blkmapd is used to perform device discovery and mapping for the parallel NFS (pNFS) block layout client. blkmapd exportfs is used to maintain a list of NFS exported file systems. exportfs mount.nfs is used to mount a network share using NFS. mount.nfs mount.nfs4 is used to mount a network share using NFSv4. mount.nfs4 mountstats is used to display NFS client per-mount statistics. mountstats nfsdcltrack is the NFSv4 client tracking callout program. nfsdcltrack nfsiostat is used to report input/output statistics for network filesystems. nfsiostat nfsstat is used to display statistics kept about NFS client and server activity. nfsstat rpcdebug is used to set or clear the kernel's NFS client and server debug flags. rpcdebug rpc.idmapd implements the NFSv4 ID <-> name mapping daemon. rpc.idmapd osd_login is a script that is a part f the autologin feature mandated by the pnfs-objects standard. osd_login rpc.mountd implements the NFS mount protocol on an NFS server. rpc.mountd rpc.nfsd implements the user level part of the NFS service on the server. rpc.nfsd 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. rpc.statd showmount is used to display mount information for an NFS server. showmount sm-notify is used to send Network Status Monitor reboot messages. sm-notify 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. start-statd umount.nfs is used to unmount a network share using NFS. umount.nfs umount.nfs4 is used to unmount a network share using NFSv4. umount.nfs4