Introduction
In this challenge, you will learn how to mount and unmount network file systems using the Network File System (NFS) protocol on a Red Hat Enterprise Linux (RHEL) system. NFS allows you to share directories and files with other Linux systems over a network. This challenge will guide you through setting up a simple NFS share on your local machine and then mounting it, simulating a basic server-client configuration on a single host.
Configure and Mount an NFS Share
In this first step, you will configure your local machine to act as an NFS server. You will export a directory, start the necessary NFS services, and then mount that directory back to your local machine, which will act as the NFS client. This is a common method for testing NFS configurations.
Tasks
- Configure the NFS server to export the
/nfs_sharedirectory. - Start the required NFS services.
- Configure the NFS client to mount the exported directory to
/mnt/nfs.
Requirements
- The
/etc/exportsfile must be configured to share the/nfs_sharedirectory with the local machine. - The NFS share must be mounted on the
/mnt/nfsdirectory. - All operations should be performed on the local machine (
localhost).
Hints
- You will need to edit the
/etc/exportsfile to define the shared directory and its permissions. A common configuration for testing is(rw,sync,no_root_squash). - In a container environment without
systemd, you cannot usesystemctl. Instead, you must start therpcbind,nfsd, andmountdservices manually. Use therpcbind,rpc.nfsd, andrpc.mountdcommands. - After modifying
/etc/exports, use theexportfs -rcommand to apply the changes. - The server address for mounting on the local machine is
localhost.
Manage the NFS Mount
Once a file system is mounted, you may need to unmount it for maintenance or other reasons. In this step, you will practice unmounting the NFS share you mounted previously and then remounting it.
Tasks
- Unmount the NFS file system from the
/mnt/nfsdirectory. - Remount the NFS file system back to the
/mnt/nfsdirectory.
Requirements
- You must successfully execute the
umountcommand on the/mnt/nfsdirectory. - At the end of this step, the NFS share must be mounted again on
/mnt/nfs.
Hints
- The command to unmount a file system is
umount. - You can use the same
mountcommand from Step 1 to remount the share.
Summary
In this challenge, you have learned the fundamentals of managing NFS file systems on a single RHEL host. You successfully configured an NFS export, started the necessary services in a container-friendly way, and mounted the share as a client. You also practiced the common administrative tasks of unmounting and remounting an NFS share. These skills are essential for the "Create and configure file systems: Mount and unmount network file systems using NFS" objective in the RHCSA exam.



