NFS (Network File System)

JAY SHAH
5 min readMar 24, 2023

--

Network File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1984, allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed. NFS, like many other protocols, builds on the Open Network Computing Remote Procedure Call (ONC RPC) system. The Network File System is an open standard defined in RFCs, allowing anyone to implement the protocol.

1. Features of NFS

  • NFS enables remote files to be accessed locally.
  • It utilizes normal client/server architecture to share files across all computers depending on unix.
  • With NFS, both machines do not need to run on the same OS.
  • We can set up centralized storage solutions with the assistance of NFS.
  • Users receive their information regardless of their physical place.
  • No refresh manual required for fresh files. Also a new version of NFS

2. Advantages and Disadvantages

2.1 Advantages

a. Save local storage space, store commonly used data on a server and access it through the network

b. Simple and easy to use

c. Convenient deployment is very fast and maintenance is very simple

2.2. Disadvantages

a. Limitations are prone to single points of failure, and all clients cannot be accessed if the server is down

b. NFS efficiency/performance is limited under high concurrency

c. The client has no user authentication mechanism, and the data is transmitted in clear text, and the security is general (generally recommended to use in LAN)

d. The data of NFS is clear text, and the integrity of the data is not verified

e. When multiple machines mount NFS server, connection management and maintenance is troublesome

3. Installing and configuring NFS Server on Ubuntu

Step 1: Install NFS Kernel Server in Ubuntu

The first step is to install the nfs-kernel-server package on the server. But before we do this, let’s first update the system packages using the following apt command.

Once the update is complete, proceed and install the nfs-kernel-server package as shown below. This will store additional packages such as nfs-common and rpcbind which are equally crucial to the setup of the file share.

Step 2: Create an NFS Export Directory

The second step will be creating a directory that will be shared among client systems. This is also referred to as the export directory and it’s in this directory that we shall later create files that will be accessible by client systems.

Run the command below by specifying the NFS mount directory name.

Step 3: Grant NFS Share Access to Client Systems

Permissions for accessing the NFS server are defined in the /etc/exports file. So open the file using your favorite text editor:

Step 4: Export the NFS Share Directory

After granting access to the preferred client systems, export the NFS share directory and restart the NFS kernel server for the changes to come into effect.

Step 5: Allow NFS Access through the Firewall

For the client to access the NFS share, you need to allow access through the firewall otherwise, accessing and mounting the shared directory will be impossible. To achieve this run the command:

4. Install the NFS Client on the Client Systems

Step 1: Install NFS Kernel Server in Ubuntu

The first step is to install the nfs-kernel-server package on the server. But before we do this, let’s first update the system packages using the following apt command.

Step 2: Create an NFS Mount Point on Client

Next, you need to create a mount point on which you will mount the nfs share from the NFS server. To do this, run the command:

Step 3: Mount NFS Share on Client System

The last step remaining is mounting the NFS share that is shared by the NFS server. This will enable the client system to access the shared directory.

Let’s check the NFS Server’s IP address using the ifconfig command.

Step 4: Testing the NFS Share on Client System

To verify that our NFS setup is working, we are going to create a few files in the NFS share directory located in the server.

Now head back to the NFS client system and check if the files exist.

Conclusion:

With the help of NFS protocol we saw that we can access file from any other pc/laptop and does not depend on OS.

Thank you for reading these blog.

--

--