Technology

A Guide to Network File Systems NFS & Its Configuration.

Network File Systems, commonly known as NFS, is file-level storage, allocated by shared storage. The way you access local files, NFS allows you to access files in an analogous way as a remote host as well.

NFS offers some extremely useful features.

  • Data at the central host can be accessed by multiple clients
  • Data consume a large amount of disk space (Storage space) can be kept at one host.
  • Saves cost via not keeping data at multiple hosts.

It is not difficult setting up basic NFS (Network File Systems) operations on both client and server ends.

Without wasting time let us jump into the configuration and let us see how we can configure and use the network file system.

Before we start, we have some requirements.

Requirement:

nfs-utils, rpcbind                 Package Name

nfs-service                           Deamon Name of NFS Service

Port                                2049

One Mount Point also required

NFS Practical Explanation

Server IP: 192.168.43.152

Client IP: 192.168.43.143

Package Installation:

Now we can check the Package is Installed or Not by using the below command

sudo rpm -qa | grep package_name

After verification of Packages needed to be installed

Now we will Now Start the Respective Services in Server: via using the below commands

systemctl start nfs-utils.service

systemctl start rpcbind

It will start the services

If you are required to restart the services on the server so you can do via the below commands or you can proceed to next procedure.

systemctl restart nfs-utils.service

systemctl restart rpcbind

Now Check the Respective Service in Server:

To check use, the below commands

systemctl restart nfs-utils.service

systemctl restart rpcbind

Add The Firewall Rule to the Server

NOTE: – Keep in mind that this will only be needed if you enable Firewall to your server.

Check Firewall Status via the commands below

systemctl status firewalld.service

Or

sudo firewall-cmd –state

Now Add Some Services to the Firewall:

Firewall-cmd —permanenet —add-service=service_name

firewall-cmd —permanenet —add-service=nfs firewall-cmd —permanenet —add-service=mountd firewall-cmd —permanenet —add-service=rpc-bind

Now when you enable/Start all the Services you need to create a Mount Point

In this configuration blog, for example, it will be Mount “/dev/sdb1 on /nfs/mount”

Let’s create a directory in which you will mount your Disk

Now Mount 70GB Disk on Mount Point /nfs/mount

Command: mount /dev/sdb1 /nfs/mount/

Now Add The details in the /etc/exports file

rw for reading and writing

sync for sync

It will share the disk to 192.168.43.143/24 For Subnet

If you want to Share to the Entire Network, then 192.168.43.0/24 :-> It will share

To the Entire Network

Server Site View:

Client Site View:

Now there is another simple & realistic way of Mooting the device

you need to create a Folder on the clients that folder & under the folder, you need to Put the Mount Command So the Disk Mount Directory.

Client site Create a folder

mkdir export

showmount -e Server_IP

Mount The Server Site Disk into the Client

Check if the NFS Share Successfully Exported:

Now we need to add the Mount point details for Permanent Mounting Directory

nano /etc/fstab

Check if there are some malfunctions arising or not on the client site

Mount -a

Check if the disk successfully Mounted or Not in the Client Site Export Directory

df -h

As we can simply see the /nfs/mount Point Disk on the server Site Successfully Mounted on the Client Site Now We can simply Enter that directory in the client site for accessing the Content.

All the Data Hosting on the Server Site can be accessed by the Client!

The above-written blog will help you get a clear understanding of NFS configuration and how smoothly you can work when you have an unobstructed vision of how it is processed. If you still find yourself stuck at any point, feel free to contact us @Contact Us – Zindagi Technologies

Zindagi Technologies is a system integration and IT consulting firm that can provide end-to-end IT infrastructure solutions, cloud solutions, managed IT services, and many more. Our goal at Zindagi is to add value to our customers by combining our extensive industry knowledge, technical expertise, and business information. If want to get support from us on any of the services, then give us a call or WhatsApp us at +919773973971 or drop us a mail @ info@zindagitech.com.

Author
Ravi Kumar Singh

Consulting Engineer- Enterprise Networking  

Author

Team ZT

Leave a comment

Your email address will not be published. Required fields are marked *