What is NFS
NFS stands for Network File System. It's a distributed file system that allows user on a client computer to access shared files and directories among networked computers.

Source from: IBM Developer, The NFS architecture
When would use NFS
- File Sharing in a Network:
NFS is widely used when you need to share files and directories among multiple computers in a network.
- Centralized Storage:
NFS is useful when you want to centralize storage on a dedicated file server.
How to setup NFS on Ubuntu Servers
Pre-required
- 2 instances with ubuntu 22.04 in the same subnet.
- check the 2 instances could connect to each other.
NFS server (one of the instances)
- create a shared directory and set permission.
- install NFS package.
- config the
/etc/exports
to use a new shared directory and indicate the subnet.
- export the directories specified in the
/etc/exports
NFS client
- create a shared directory and set the permission of a directory
- install NFS package.
- edit the
/etc/fstab
to mount the shared directory
- mount the shared directory
Testing
- create a file in
/shared
on server 1.
- check the file in
/shared
on server 2.
Reference
1. Building a SLURM Cluster Using Amazon EC2 (AWS) Virtual Machines