Logo ← PostgreSQL Blog

Guide to Mounting a File Server on RHEL 9 Using NFS

In this guide, you will learn how to mount a share from a Windows File Server to an RHEL 9 (Red Hat Enterprise Linux 9) server using the…

Guide to Mounting a File Server on RHEL 9 Using NFS

In this guide, you will learn how to mount a share from a Windows File Server to an RHEL 9 (Red Hat Enterprise Linux 9) server using the Network Attached Storage (NAS) File System (NFS). Additionally, we will cover the steps to make the mount persistent across server reboots.

Step 1: Install NFS Utilities Packages on Linux

Firstly, you need to install the NFS utility packages on your Linux server. To do this, run the following command in your terminal:

dnf install nfs-utils

Step 2: Create a Local Directory

You need to create a local directory where the NFS share will be mounted. For example, to create the /dba/backups directory, use the following command:

mkdir -p /dba/backups

Step 3: Mount the NFS Windows Share

Mount the NFS share from the Windows File Server to the directory you created. For example:

sudo mount -t nfs saridepo3:/nfscbsdbbackup /dba/backups

To verify if the mount was successful, you can use the df -h command:

df -h

Step 4: Use fstab for Automatic Mounting

To ensure that the mount is persistent across server reboots, you need to add an entry to the /etc/fstab file.

Add an entry to the /etc/fstab file like the following:

saridepo3:/nfscbsdbbackup  /dba/backups  nfs  port=2049,rw,bg,hard,nointr,tcp,actimeo=0,vers=3,timeo=600  0  0

Note: When adding the above line, you can adjust the parameters and values based on the configuration of your NFS server.

After adding to the fstab file, test your new configuration and perform the mount with the following commands:

mount -a
df -h

Step 5: Unmount the NFS Share

If you wish to unmount the NFS share that you mounted, you can use the following command:

umount /dba/backups

Conclusion

In this guide, you have learned step-by-step how to mount a share from a File Server to an RHEL 9 server using NFS. Additionally, you have followed the necessary steps to ensure the mount is persistent across server reboots. For more detailed and technical articles like this, keep following our blog on Medium. If you have any questions or need further assistance, feel free to reach out in the comments below and directly.