Introduction to NFS

A simple introduction to network file system

What Is NFS?

NFS (Network File System) is a file system protocol that allows directories and files to be shared across a network.
Think of it like plugging a USB drive into your machine—when you connect it, the system mounts it and you can access the files immediately.
NFS works in a similar way, except the files are mounted over a network connection instead of through a physical device.

In an NFS setup, there are two main roles:

NFS Server

  • Provides the shared directories
  • Controls access permissions
  • Manages read/write rights for clients

NFS Client

  • Connects to the shared directories
  • Requires proper credentials and permissions
  • Mounts shared folders to a local path on the system

When to Use NFS?

Backing Up Files

When performing backups, it’s best to store them on a different server.
Backing up to another directory on the same machine defeats the purpose—if the server fails, both the original data and backup may be lost.

Example:
Company A runs its application on a Red Hat server.
To protect critical data, they set up another machine as an NFS server.
A cron job on the Red Hat server regularly copies important files to the NFS server.
This ensures backups remain safe even if the main server goes down.


Load Balancing

When multiple servers share the workload, they often need access to the same files—such as uploads, images, or shared resources.

NFS allows these servers to access a common storage directory.

Example:
Company A runs its website on Server A and Server B, both behind a load balancer.
To ensure both servers access the same content, they mount an NFS share that hosts all uploads and shared files.


Other Common Uses of NFS

  • Centralised user home directories for organisations
  • Shared storage for VMs and virtualised environments
  • Persistent storage for containers
  • Shared development workspace across multiple systems

NFS in Cloud Platforms

Modern cloud providers offer managed NFS services, providing the same functionality as traditional NFS without the need to set up or maintain the server manually.

AWS – EFS (Elastic File System)

A fully managed, scalable file storage service that automatically grows or shrinks based on usage.

Google Cloud – Filestore

A managed file storage solution designed for applications that need high-performance, shared storage.

Microsoft Azure – Azure Files

A shared storage service that supports both NFS and SMB, making it suitable for Linux and Windows environments alike.

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy