How to Install NFS on Debian 11 Server. In this article we will introduce what NFS server with its pros and benefits, as well as NFS Server versions and next move into installation phase. Let’s get started.
What is NFS
NFS, also known as Network File System and it is a client/server application, which is a protocol built in 1984 by Sun Microsystem on the principle of sharing. This protocol allows users to access files on client computers. It means that it is a distributed file system that helps businesses in sharing files over a network.
It enables you to access remote data or files from any remote computers or devices linked to the network you are using. This way, all people working within your network will be accessing similar files, thereby making the efforts of file sharing easier.
Since its launch, it has evolved tremendously, and it is still continuously changing today. It is because it is an open standard solution where anyone within your network reach can implement this protocol on every operating system and make necessary adjustments accordingly.
NFS utilizes a fundamental system in which the “mount” command induces the server to link with multiple clients. This way, it allows the clients to have access to the identical files on the server via appropriate platforms. However, it also uses security protocol to control the access of specific files to produce a simplified and safe way of working.
It also uses a file locking system that can be used to share files among multiple clients. It manages several applications and assesses threads for operations by using various hosts.
NFS features
You can enjoy the following benefits with NFS server:
The way NFS works depends upon the version you are using. As of today, there are a total of three NFS versions, and each of them constitutes different standards for its operations.
NFS versions
NFS version 2 (NFSv2)
This version is one of the oldest and the most widely used format of NFS. It employs User Datagram Protocol (UDP) via an IP network that provides a solid network connection. It has convenient features that make the connection effortless and work in no time. However, UDP clients continuously send requests to the server even if the connection is not working.
NFS version 3 (NFSv3)
This version is designed to support non contemporaneous writing. It allows servers to organize data by helping them in employing appropriate policies. Here, the data is synchronized before creating a command to manage the data. The design creates a better buffer than NFSv2. It is also capable of handling any errors or mistakes and managing massive files precisely.
NFS version 4 (NFSv4)
NFS version 4 is the latest version of this protocol, which can not only work on the internet but on the firewall as well. Moreover, since it does not require any rpcbind service, you can effortlessly run this protocol in multiple places.
Transmission Control Protocol, or TCP works with NFS form. It links the application and IP protocol. This way, they keep tabs on the data and only receive frames that are lost in the TCP set while sending something for the second time.
This server also accepts TCP port 2049 commands that are widely used to eliminate the need for interactions with daemons like rpcbind and lockd options.
To summarize, NFS is the most essential protocol as it helps in sharing the file with people within your network. However, look at the version and ensure it’s working to make both your network and file content visible to everyone in your business. Implement NFS daemon to access data stored on another device immediately and efficiently.
Follow the next steps about how to install the NFS on Debian 11 server.
You can verify the status of the NFS service using the following command:
systemctl status nfs-server
You will get the following output:
● nfs-server.service - NFS server and services
Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2022-04-04 12:09:06 UTC; 5s ago
Main PID: 4198 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 2353)
Memory: 0B
CGroup: /system.slice/nfs-server.service
April 04 12:09:05 debian11 systemd[1]: Starting NFS server and services...
April 04 12:09:06 debian11 systemd[1]: Finished NFS server and services.
Next step in this article about How to Install NFS on Debian 11 Server, you will need to create a directory on the NFS serve that you want to share with the client systems. Let’s create a directory named /data using the following command:
mkdir /data
Following that, assign proper ownership and permissions to the /data directory so it can be accessible from the client machines.
chown nobody:nogroup /data
chmod -R 777 /data
Configure an NFS Exports
After creating the NFS directory, you will need to allow client systems to access the NFS share. You can do it by editing the /etc/exports file.
nano /etc/exports
Add the following line:
/data 192.168.0.0/24(rw,sync,no_subtree_check)
Save and close the file when you are finished.
The above configuration will allow all clients in the 192.168.0.0 network to access the NFS share.
Where:
rw – Assign read and write
sync – Write changes to disk before applying them
no_subtree_check – Avoid subtree checking
Next, run the following command to export the shared directory and make it available to all client systems.
If you have configured UFW firewall on your server. Then, you will need to allow NFS service to the client network. You can allow it by running the following command:
ufw allow from 192.168.0.0/24 to any port nfs
Next is to reload the UFW firewall to apply the changes.
ufw reload
Install NFS Client
At this point, the NFS server is installed and configured. Now, you will need to install the NFS client package on the client system. You can install it by running the following command:
apt-get install nfs-common -y
Once the NFS client package is installed, you can proceed to the next step.
In the above post, you learned how to install the NFS server and client on Debian 11. You also learned how to share a directory through NFS and mount it on the client machine.
NFS is a solution for remote file sharing between the servers, by using the existing internet protocol infrastructure. NFSv3 is the most popular server and some of the interesting protocol features are caching, security support, shared file locking and in NFS server, remote server management is used.
I hope this article will assist you in file sharing using NFS on your internal network.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.
51vote
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.