How to configure NFS Server on Oracle Linux
To Install and Configure the NFS-SERVER on Oracle Linux
Introduction:
Network File System (NFS) is a distributed file system protocol originally developed by Sun Microsystems Its allow a user on a client computer to access files over a computer network The server stores data on its disks and the clients may request data through some protocol messages.
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: Starting 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 the sharing folder by using the below command
[root@localhost nfs_share]# touch /nfs_share/abc{1..10}
Step 8: Verify the files 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 exported file is configured 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 by using the below command
[root@ client ~]# mkdir /home/linux/Desktop/nfs_acess
Step 18: Change the permission to 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 made in client machine by using the below command
[root@localhost]# cat /nfs_share/abc1
Test
The Installation and configuration of the NFS-SERVER on oracle linux has come to an End.