Skip to main content

Creating NFS Storage

This guide demonstrates how to create an NFS (Network File System) server for storage sharing in Nuvion solution environments.

NFS allows multiple servers to access a remote directory as if it were a local file system.


📄 Prerequisites

Before starting, verify that:

  • There is network connectivity between server and clients
  • The firewall allows communication on port 2049/TCP
  • The user has sudo access

🚀 Step 1 – Update the server and install the NFS Server

First, update the system packages and install the NFS service.

Debian / Ubuntu

sudo apt update
sudo systemctl restart nfs-kernel-server

RHEL / CentOS / Alma / Rocky

sudo dnf update -y
sudo systemctl restart nfs-server

Older systems (CentOS 7)

sudo yum install nfs-utils -y
info

The nfs-kernel-server package installs and configures the service responsible for exporting NFS directories on Linux.


➕ Step 2 – Create the sharing directory

Now let's create the directory that will be shared via NFS.

sudo mkdir -p /mnt/storage

If the server has an additional disk for data storage, mount it on the created directory.

sudo mount /dev/vdb1 /mnt/storage

❌ Step 3 – Adjust directory permissions

Set permissions to allow access to NFS clients.

sudo chown nobody:nogroup /mnt/storage
sudo chmod 777 /mnt/storage
warning

In production environments, it is recommended to use more restrictive permissions.


📁 Step 4 – Configure NFS export

Edit the NFS export file.

sudo nano /etc/exports

Add the network or IP that will be allowed to access the share:

/mnt/storage 172.16.40.0/24(rw,sync,no_subtree_check)

Replace 172.16.40.0/24 with the correct IP or network of your environment.

Parameters used:

  • rw → Allows read and write
  • sync → Ensures synchronous writing to disk
  • no_subtree_check → Avoids validation of subdirectories

📦 Step 5 – Apply the configurations

After saving the file, apply the configured exports.

Debian / Ubuntu

sudo exportfs -a
sudo systemctl restart nfs-kernel-server

RHEL / CentOS / Alma / Rocky

sudo exportfs -a
sudo systemctl restart nfs-server

🛠️ Step 6 – Allow access in the firewall

If the UFW firewall is enabled, allow access to the NFS service.

UFW (Ubuntu / Debian)

sudo ufw allow from 172.16.40.0/24 to any port nfs

firewalld (RHEL / CentOS / Alma / Rocky)

sudo firewall-cmd --permanent --add-service=nfs
sudo firewall-cmd --reload

Compatibility

The installation and management commands for NFS may vary depending on the Linux distribution used (APT, DNF, or YUM). This guide presents examples for the main distribution families.

✅ Conclusion

After these steps, the NFS server will be ready for use, allowing multiple servers to access the shared storage over the network.

This type of configuration is widely used in environments such as:

  • clusters
  • containers
  • distributed applications

🧠 Questions?

Contact technical support and send your question—we are available to help you!