Linux: Network File System (NFS) - Paiet/Tech-Journal-for-Everything GitHub Wiki

  • Network File System
    • Allow sharing files over the network
    • Developed as a standard protocol
    • Used by *NIX and macOS
      • Can be added to Windows
  • Configuring an NFS Server
    1. Install NFS (if necessary)
      • yum install nfs-utils libnfsidmap
    2. Enable and Start Services
      • systemctl enable --now rpcbind nfs-server rpc-statd nfs-idmapd
    3. Create a folder to share
      • mkdir -pm 777 /export/share
    4. Add the folder to the export list
      • sudo vi /etc/exports
      • /export/share 10.0.0.0/16(rw,sync,no_root_squash)
    5. Reload the config file
      • sudo exportfs -r
      • sudo exportfs -v to verify
    6. Allow clients through the firewall
      • firewall-cmd --permanent --zone public --add-service mountd
      • firewall-cmd --permanent --zone public --add-service rpc-bind
      • firewall-cmd --permanent --zone public --add-service nfs
      • firewall-cmd --reload
  • Configuring an NFS Client
    1. Install NFS (if necessary)
      • yum install nfs-utils libnfsidmap
    2. Enable and Start rpcbind
      • systemctl enable rpcbind
      • systemctl start rpcbind
    3. Test if share is accessible
      • showmount -e <server_ip>
    4. Mount the share to a local folder
      • sudo mkdir /mnt/share
      • mount <server_ip>:/export/share /mnt/share
    5. (Optional) Add to fstab to mount during boot
      • sudo vi /etc/fstab
      • <server_ip>:/export/share /mnt/share nfs rw,sync,hard,intr 0 0

Explanation of NFS Options

⚠️ **GitHub.com Fallback** ⚠️