Welcome to my blog! In this article, I will guide you through the steps to install and configure NFS (Network File System) server on Fedora 36. NFS is a popular protocol used to share files and directories across a network. By following these instructions, you can set up an NFS server on Fedora 36 system and start sharing files with other machines on your network. So, let’s get started!

Configure NFS Server

[root@dlp ~]# dnf -y install nfs-utils
[root@dlp ~]# vi /etc/exports

/run/media/JellyStorage *(rw,sync,all_squash,anonuid=1000,anongid=1000)

[root@dlp ~]# systemctl enable --now rpcbind nfs-server 

If Firewalld is running, allow NFS service

 [root@dlp ~]# firewall-cmd --add-service=nfs --zone=FedoraWorkstation --permanent

success
# if use NFSv3, allow follows, too

[root@dlp ~]# firewall-cmd --add-service={nfs3,mountd,rpc-bind} --permanent

success
[root@dlp ~]# firewall-cmd --reload

success 

using showmount to check if an NFS share is working properly. Type showmount -e <server> and replace <server> with the hostname or IP address of the NFS server you want to check.

[root@fedora VirtStorage]# showmount -e 192.168.52.110
Export list for 192.168.52.110:
/run/media/JellyStorage *

and then you can create a temp directory to test it:

mkdir ./test_nfs
mount -t nfs 192.168.52.110:/run/media/JellyStorage ./test_nfs
touch ./test_nfs/test

If can see test file in server folder, it should be work properly, and then you can use umount ./test_nfs to unmount the test directory.

For basic options of exports

  • rw: Allow both read and write requests on a NFS volume.
  • ro: Allow only read requests on a NFS volume.
  • sync: Reply to requests only after the changes have been committed to stable storage. (Default)
  • async: This option allows the NFS server to violate the NFS protocol and reply to requests before any changes made by that request have been committed to stable storage.
  • secure: This option requires that requests originate on an Internet port less than IPPORT_RESERVED (1024). (Default)
  • insecure: This option accepts all ports.
  • wdelay: Delay committing a write request to disc slightly if it suspects that another related write request may be in progress or may arrive soon. (Default)
  • no_wdelay: This option has no effect if async is also set. The NFS server will normally delay committing a write request to disc slightly if it suspects that another related write request may be in progress or may arrive soon. This allows multiple write requests to be committed to disc with the one operation which can improve performance. If an NFS server received mainly small unrelated requests, this behaviour could actually reduce performance, so no_wdelay is available to turn it off.
  • subtree_check: This option enables subtree checking. (Default)
  • no_subtree_check: This option disables subtree checking, which has mild security implications, but can improve reliability in some circumstances.
  • root_squash: Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids or gids that might be equally sensitive, such as user bin or group staff.
  • no_root_squash: Turn off root squashing. This option is mainly useful for disk-less clients.
  • all_squash: Map all uids and gids to the anonymous user. Useful for NFS exported public FTP directories, news spool directories, etc.
  • no_all_squash: Turn off all squashing. (Default)
  • anonuid=UID: These options explicitly set the uid and gid of the anonymous account. This option is primarily useful for PC/NFS clients, where you might want all requests appear to be from one user. As an example, consider the export entry for /home/joe in the example section below, which maps all requests to uid 150.
  • anongid=GID: Read above (anonuid=UID)