RHCSA RHEL 8 – Mount and unmount network file systems using NFS

Mount and unmount network file systems using NFS

Your support on Ko-Fi is much appreciated: https://ko-fi.com/csg_yt

More information on Sophos Home Antivirus: http://bit.ly/SophosHP

More information about Hostinger VPS: http://bit.ly/H-VPS

This video is based on RHEL 8. Video to cover the section ‘Mount and unmount network file systems using NFS’ for the RHCSA (Red Hat Certified System Administrator).

More information on the required learning: http://bit.ly/rhcsa8

Notes from the video:

NFS Server Build (10.0.2.5)

Note: this isn’t required knowledge for the RHCSA.

First on a new server install the NFS server (not required as part of the exam):

# yum groupinstall -y file-server

Add firewall rule.

# firewall-cmd --permanent --add-service=nfs

# firewall-cmd --reload

Start NFS at boot:

# systemctl enable rpcbind nfs-server

# systemctl start rpcbind nfs-server

Create directories to export:

# mkdir /home/nfs-share

# chmod 777 /home/nfs-share

Update the SELINUX contexts:

# yum install -y setroubleshoot-server

Enable SELINUX booleans:

# setsebool -P nfs_export_all_rw on
# setsebool -P nfs_export_all_ro on
# setsebool -P use_nfs_home_dirs on

Edit the /etc/exports file and create a new line with the following:
/home/nfs-share 10.0.2.6(rw,no_root_squash)

Restart nfs-server:

# systemctl restart nfs-server

Check the share is working:

# showmount -e localhost

NFS Client Setup (10.0.2.6)

This is the required section for the exam.

Install NFS-Utils (if not already installed):

# yum install -y nfs-utils

To mount temporarily:

# mount -t nfs 10.0.2.5:/home/nfs-shared /mnt

Check the mount is working:

# ls /mnt

# vi /mnt/somefile

To unmount:

# umount /mnt

To mount permanently edit /etc/fstab with the following line:

10.0.2.5:/home/nfs-share /mnt nfs4 defaults 1 2

To test the fstab mount configuration force a mount:

# mount -a

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started