How to install NFS-SERVER on Oracle Linux

To Install and configure the NFS-SERVER on oracle linux

Introduction :

NFS (Network File System) is a distributed file system protocol that was developed by Sun Microsystem to allow a user on a client computer to access files over a network. The server stores data on its disks, and clients access it using messages in the protocol.

Installation steps:

Step 1 : check the OS version by using the below command

[root@localhost /]# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="8.4"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
ORACLE_SUPPORT_PRODUCT_VERSION=8.4

Step 2 : install the NFS packages by using the below command

[root@localhost /]# yum install nfs-utils
Last metadata expiration check: 0:20:23 ago on Friday 19 November 2021 12:54:51 AM IST.
Package nfs-utils-1:2.3.3-41.el8.x86_64 is already installed.
Dependencies resolved.
Upgrading:
 nfs-utils                     x86_64                     1:2.3.3-46.el8                        ol8_baseos_latest                     500 k

  Running scriptlet: nfs-utils-1:2.3.3-41.el8.x86_64                                                                                    2/2 
  Cleanup          : nfs-utils-1:2.3.3-41.el8.x86_64                                                                                    2/2 
  Running scriptlet: nfs-utils-1:2.3.3-41.el8.x86_64                                                                                    2/2 
/sbin/ldconfig: /etc/ld.so.conf.d/kernel-5.4.17-2102.201.3.el8uek.x86_64.conf:6: hwcap directive ignored
   Verifying        : nfs-utils-1:2.3.3-46.el8.x86_64                                                                                    1/2 
Upgraded:
  nfs-utils-1:2.3.3-46.el8.x86_64                                                                                                           
Complete!

Step 3: start the NFS service by using the below command

[root@localhost /]# systemctl start nfs-server.service

Step 4 : Enable the NFS service by using the below command

[root@localhost /]# systemctl enable nfs-server.service

Step 5 : check the status of NFS service by using the below command

[root@localhost /]# systemctl status nfs-server.service
● nfs-server.service - NFS server and services
 Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
 Active: active (exited) since Fri 2021-11-19 01:16:48 IST; 32s ago
Main PID: 47153 (code=exited, status=0/SUCCESS)
  Tasks: 0 (limit: 10509)
 Memory: 0B
 CGroup: /system.slice/nfs-server.service

Nov 19 01:16:48 localhost.localdomain systemd[1]: Starting NFS server and services...
Nov 19 01:16:48 localhost.localdomain systemd[1]: Started NFS server and services.

Step 6: create folder for sharing by using the below command

[root@localhost /]# mkdir /nfs_share

Step 7 : create files in sharing folder by using the below command

[root@localhost nfs_share]# touch /nfs_share/abc{1..10}

Step 8 : verify the files are created using ls command

[root@localhost nfs_share]# ls /nfs_share
abc1  abc10  abc2  abc3  abc4  abc5  abc6  abc7  abc8  abc9

Step 9 : Edit the export file by using the below command

[root@localhost nfs_share]# vim /etc/exports
/nfs_share	192.168.6.132(sync,rw)

Step 10 : check the export file is configure correctly by using the below command

[root@localhost nfs_share]# exportfs -avr
exporting 192.168.6.0/23:/nfs_share

Step 11 : print a brief information about the shares by using the below command

[root@localhost nfs_share]# exportfs -s
/nfs_share  192.168.6.0/23(sync,wdelay,hide,no_subtree_check,sec=sys,rw,secure,root_squash,no_all_squash)

Step 12 : Install client packages by using the below command

[root@ client ~]# yum install nfs-utils nfs4-acl-tools
Loaded plugins: langpacks, ulninfo
Package 1:nfs-utils-1.3.0-0.68.0.1.el7.2.x86_64 already installed and latest version
Package nfs4-acl-tools-0.3.3-21.el7.x86_64 already installed and latest version
Nothing to do

Step 13 : start the NFS service by using the below command

root@ client ~]# systemctl start nfs-utils.service 

Step 14 : Enable the NFS service by using the below command

[root@ client ~]# systemctl enable  nfs-utils.service 

Step 15 :check the status of NFS by using the below command

[root@ client ~]# systemctl status  nfs-utils.service
● nfs-utils.service - NFS server and client services
   Loaded: loaded (/usr/lib/systemd/system/nfs-utils.service; static; vendor preset: disabled)
   Active: active (exited) since Fri 2021-11-19 03:39:17 IST; 12s ago
 Main PID: 2966 (code=exited, status=0/SUCCESS)
Nov 19 03:39:17 localhost.localdomain systemd[1]: Starting NFS server and cli...
Nov 19 03:39:17 localhost.localdomain systemd[1]: Started NFS server and clie...
Hint: Some lines were ellipsized, use -l to show in full.

Step 16 : check the shares from the server by using the below command

[root@ client ~]# showmount -e 192.168.6.132
Export list for 192.168.6.132:
/nfs_share 192.168.6.0/23

Step 17 : create a directory for mount the server shares

[root@ client ~]# mkdir  /home/linux/Desktop/nfs_acess

Step 18 : change the permission for the folder by using the below command

[root@client ~]# chmod -R 777  /home/linux/Desktop/nfs_access

Step 19 : mount the server shares into local directory by using the below command

[root@ client ~]# mount -t nfs  192.168.6.132:/nfs_share /home/linux/Desktop/nfs_access

Step 20 : change the shared folder permissions in server by using the below command

[root@localhost]# chmod -R 777 /nfs_share/  

Step 21 : verify the changes that was done in client machine by using the below command

[root@localhost]# cat /nfs_share/abc1
Test

With this process of Installation and configuration of the NFS-SERVER on oracle linux has comes to an End.

FAQ
Q
How can access to NFS be granted?
A
The access to NFS be granted is located at /etc/exports.
Q
How Does Network File System Work?
A
NFS client-server protocol begins with a “mount” command, which specifies client and server software options or attributes.
Q
What is the Benefits of Using NFS?
A
The Benefit of Using NFS is Multiple clients can use the same files, which allows everyone on the network to use the same data, accessing it on remote hosts as if it were acceding local files.
Q
What is a NETWORK FILE SYSTEM (NFS)?
A
Network File System (NFS), was a protocol invented in the 80s to facilitate remote file sharing between servers.
Q
Who developed the NFS?
A
It was developed by Sun Microsystems