Oracle Linux 9.3 Install NFS Server

Oracle Linux 9.3 Install NFS Server

Oracle Linux 9.3 Install NFS Server

When searching for documentation, I appreciate receiving just the commands without a lot of accompanying text. Sometimes, I need to quickly install shared storage for testing purposes. This snippet will be used in upcoming automations, but I figured I would just put it here. The below assumes you have set up your data share, I would recommend a dedicated LVM.

  
dnf install nfs-utils
systemctl enable --now nfs-server
systemctl start rpcbind 
systemctl enable rpcbind
  

Port 111 (TCP and UDP) and 2049 in firewalld

  
firewall-cmd --permanent --zone=public --add-port=111/tcp  
firewall-cmd --permanent --zone=public --add-port=111/udp
firewall-cmd --permanent --zone=public --add-port=2049/tcp  
firewall-cmd --permanent --zone=public --add-port=2049/udp
firewall-cmd --reload
  

Add share to exports

  
vi /etc/exports 
systemctl restart nfs-server
  

That's it you can mount on client machines, if the nfs client is not installed on the client machine

  
dnf install nfs-utils
sudo mount -t nfs -o vers=4 [server ip]:/mnt/share /mnt/test 
  

Tasty shares.....