NFS_(Network File System) Share


 NFS_(Network File System) Share:-
----------------------------------
  1. NFS enables system administrator to share all or a portion of a file system on a network server to make accessible to remote computer users.
  2. NFS stand Network File System.
  3. NFS protocol defines an network file system, originally developed for local sharing among UNIX system and released by Sun Microsystems in 1984.
  4. NFS is an Application Layer protocol.
  5. NFS latest version is v4 with ACL.
  6. For NFS Server you must need to install the package of NFS. The package name is nfs-utils which provided a daemon for kernel NFS Server and related tools such as contains the showmount program.


NFS Configuration in RHEL_8 Machine:-
-------------------------------------
The configuration file of NFS server are:
  1. /etc/nfs.conf:- Main configuration file for the nfs daemon and tools.
  2. /etc/nfsmount.conf:- NFS mount configuration file.


Step-1) Check nfs-utils package is installed or not
----------------------------------------------------
[root@localhost ~]# rpm -qa |grep nfs
nfs-utils-2.3.3-35.el8.x86_64
libnfsidmap-2.3.3-35.el8.x86_64
sssd-nfs-idmap-2.3.0-9.el8.x86_64

Step-2) Install nfs all package with dependencies package
---------------------------------------------------------
[root@localhost ~]# yum install nfs*




Troubleshoot:- If you face this error "error: db5 error(-30969) from dbenv->open: BDB0091 DB_VERSION_MISMATCH: Database environment version mismatch RPM: error: cannot open Packages index using db5 - (-30969)" Then use this command.
[root@localhost ~]# rpm -vv --rebuilddb 


Step-3) Once the installation is completed "start nfs-server" service, "enable" it to automatically start at system boot and they verify via "status" command. You can use "systemctl" command for it.
--------------------------------------------------------------------

[root@localhost ~]# systemctl status nfs-server.service 
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

root@localhost ~]# systemctl start nfs-server.service 
[root@localhost ~]# systemctl enable nfs-server.service 
Created symlink /etc/systemd/system/multi-user.target.wants/nfs-server.service → /usr/lib/systemd/system/nfs-server.service.
[root@localhost ~]# systemctl restart nfs-server.service 

[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 2024-03-15 15:32:41 IST; 42s ago
  Process: 109624 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)

Step-4) Other service that are required for running NFS server or mounting NFS shares such as "nfsd,nfs-idmapd,rpcbind,rpc.mounted,locked,rpc.statd,rpc.rquotad and rpc.idmapd will be automatically started."
----------------------------------------------------------
[root@localhost ~]# systemctl status rpcbind.service 
● rpcbind.service - RPC Bind
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2024-03-15 16:02:05 IST; 8min ago
     Docs: man:rpcbind(8)
 Main PID: 866 (rpcbind)

[root@localhost ~]# systemctl start rpcbind.service 

Step-5) Firewall Management:-
-----------------------------
[root@localhost ~]# systemctl status firewalld.service 
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2024-03-15 16:02:16 IST; 12min ago
     Docs: man:firewalld(1)

[root@localhost ~]# systemctl stop firewalld.service 


Step-6) Creat a Directory with full permission:-
------------------------------------------------
[root@localhost ~]# mkdir /abhishek
[root@localhost ~]# chmod 777 /abhishek

Step-7) Configuration in export files:-
---------------------------------------
[root@localhost ~]# vim /etc/exports

Type this text

/abhishek    192.168.1.0/24(rw,sync)

Now save & exit via :wq! command

[root@localhost ~]# exportfs -avr




No comments:

Post a Comment

Computer Hardware_(A+) & Operating System with Networking

Microprocessor Motherboard About Operating System Create Bootable Pen Drive via Command Map Network Drive File Transfer Protocol in Windows ...