🖥️

NFS-Utils Configuration Guide

Jun 19, 2025

Overview

This lecture covers how to configure and install NFS-Utils 2.5.2 for network file sharing on Linux, including kernel setup, installation steps, and key configuration for both server and client systems.

Kernel Configuration

  • Enable "Network File Systems" in the kernel, selecting NFS client and/or server support as needed.
  • For NFS v3, add nfsver=3 to mount options to avoid negotiation errors, especially if NFS v4 is enabled.
  • Using nfsver=3 helps prevent mount option error messages even if NFS v4 is not supported.

Installation of NFS Utilities

  • Ensure "nobody" user and "nogroup" group (usually UID and GID 99) exist before installing.
  • Configure with: ./configure --prefix=/usr --sysconfdir=/etc --sbindir=/sbin --disable-nfsv4 --disable-gss.
  • Run make and then as root: make install.
  • Set permissions: chmod u+w,go+r /sbin/mount.nfs.
  • Change ownership of /var/lib/nfs to nobody.nogroup.

Server Configuration

  • Define exported directories in /etc/exports, e.g., /home 192.168.0.0/24(rw,subtree_check,anonuid=99,anongid=99).
  • Install the nfs-server boot script to start NFS server services at boot: make install-nfs-server.
  • Configure /etc/sysconfig/nfs-server with desired port and process parameters.
  • Parameters may optionally go in /etc/sysconfig/rc.site.

Client Configuration

  • Add NFS mounts to /etc/fstab, e.g., <server-name>:/home /home nfs rw,_netdev 0 0.
  • Use NFS options like rw (read/write), ro (read-only), _netdev (for automatic mounting at boot).
  • If needed, install nfs-client init script and the netfs bootscript for automounting.

Contents and Tools

  • Main programs include: exportfs, mount.nfs, nfsconf, nfsstat, rpc.mountd, rpc.nfsd, rpc.statd, and others.
  • No libraries are installed; directory /var/lib/nfs created.

Key Terms & Definitions

  • NFS (Network File System) — Protocol for sharing files over a network.
  • nfsver=3 — Mount option to force use of NFS version 3.
  • nobody/nogroup — Unprivileged user and group for NFS processes.
  • /etc/exports — File specifying directories shared by the NFS server.
  • /etc/fstab — File defining mount points for filesystems on the client.
  • rpc.statd — Program used for NFS file locking services.

Action Items / Next Steps

  • Recompile kernel if necessary with required NFS options.
  • Create "nobody" user and "nogroup" group if they don't exist.
  • Configure NFS utilities, server or client settings as needed.
  • Install and enable appropriate boot scripts for server or client.
  • Review man pages and NFS HowTo documentation for further details.