LightYear
/Docs
DocsComputeSet Up NFS Shared Storage Between Servers

Set Up NFS Shared Storage Between Servers

Configure an NFS server and mount shared storage across multiple compute nodes.

intermediate
8 min read
LightYear Team
Updated April 24, 2026
nfsstoragenetworkinglinux
Ready to get started?

Use Case

NFS shared storage is useful when multiple servers need access to the same dataset or model weights — for example, a training cluster where all nodes read from a shared /data directory.

Architecture

[NFS Server] ────────────────────────────────── | Private Network (10.x.x.x) [Node 1] [Node 2] [Node 3]

Step 1 — Set Up the NFS Server

On the NFS server:

>_BASH
$apt-get install -y nfs-kernel-server
$mkdir -p /exports/data
$chmod 777 /exports/data

Edit /etc/exports:

/exports/data 10.0.0.0/24(rw,sync,no_subtree_check,no_root_squash)

Apply:

>_BASH
$exportfs -a
$systemctl restart nfs-kernel-server

Step 2 — Mount on Client Nodes

On each client node:

>_BASH
$apt-get install -y nfs-common
$mkdir -p /data
$mount -t nfs 10.0.0.10:/exports/data /data

Make persistent (/etc/fstab):

10.0.0.10:/exports/data /data nfs defaults,_netdev 0 0

Step 3 — Verify

>_BASH
$df -h /data
$# Filesystem Size Used Avail Use% Mounted on
$# 10.0.0.10:/exports/data 500G 1G 499G 1% /data

Performance Tuning

>_BASH
$# Mount with performance options
$mount -t nfs -o rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2 10.0.0.10:/exports/data /data

Security Note

Restrict NFS exports to your private network CIDR only. Never expose NFS to the public internet.

Was this article helpful?

Your cookie choices for this website

This site uses cookies and related technologies, as described in our privacy policy, for purposes that may include site operation, analytics, and enhanced user experience. You may choose to consent to our use of these technologies, or manage your own preferences. Cookie policy