Saturday 30 November 2019

How to Mount an NFS Share on CentOS 8 Client



NFS (Network File System) is a distributed network file sharing system protocol. It is provides to share files and folders between Linux distributions over the network. Nfs-utils package needed to mount NFS share on clients as local file system.
This article describes How to Mount an NFS Share on CentOS8 Client.

Step 1. Package Installation: nfs-utils package needed to mount NFS share on clients as local file system. Run the following command to install nfs-utils:

[root@linuxcnf ~]# dnf install nfs-utils –y
………………..
Installed:
  nfs-utils-1:2.3.3-14.el8_0.2.x86_64   gssproxy-0.8.0-5.el8.x86_64   keyutils-1.5.10-6.el8.x86_64  
………………..
Complete!
[root@linuxcnf ~]#

Step 2. Mounting NFS Share: Run the following command to check available NFS Shared directory on the Server:

[root@linuxcnf ~]# showmount -e 192.168.43.168
Export list for 192.168.43.168:
/nfsshare 192.168.43.88
[root@linuxcnf ~]#

Run the following commands to create a new directory and mount NFS Shared directory:

[root@linuxcnf ~]# mkdir /mnt/nfsdirectory
[root@linuxcnf ~]# mount 192.168.43.168:/nfsshare /mnt/nfsdirectory
[root@linuxcnf ~]#

Step 3. Auto Mounting (Optional): Append the following entry to the /etc/fstab file to automatically mount the NFS Share on the local machine:

[root@linuxcnf ~]# vi /etc/fstab
………………
192.168.43.168:/nfsshare /mnt/nfsdirectory/  nfs      defaults    0       0
[root@linuxcnf ~]#

Save the file and run the following command to mount the NFS Share folder:

[root@linuxcnf ~]# mount -a
[root@linuxcnf ~]#

Step 4. Validate NFS Share Mount: Validate the NFS Server and client configuration by checking mount points:

[root@linuxcnf ~]# df -h
Filesystem                Size  Used Avail Use% Mounted on
………………….
192.168.43.168:/nfsshare  8.0G  3.9G  4.2G  49% /mnt/nfsdirectory
[root@linuxcnf ~]#

Done!!! NFS Share is successfully mounted on CentOS8 Client.

No comments:

Post a Comment