sudo dnf install nfs-utils
sudo systemctl enable rpcbind
sudo systemctl enable nfs-server
sudo service rpcbind start
sudo service nfs-server start
edit /etc/exports
and add
/media/nfs/ 192.168.1.2(rw,sync,no_subtree_check)
than run sudo exportfs -avrf
N.B: replace
/media/nfs
by the folder you want to share and192.168.1.2
by the ip address of the machine that want to access to folder ( you can put*
instead of ip address if you want the folder to be shared with every one
in the client machine install nfs component using sudo apt install nfs-common portmap -y
than run sudo mkdir -p /mnt/nfs_client
to create the folder in which we gonna mount the shared folder (remote folder)
and run
sudo mount -o rw,hard,intr -t nfs4 192.168.1.10:/media/nfs /mnt/nfs_client
N.B: the address
192.168.1.10
is the ip address of the machine sharing the folder
thanks goes to
https://www.linuxquestions.org/questions/linux-networking-3/system-hangs-when-nfs-connection-is-lost-814578/
andhttps://kb.netapp.com/Advice_and_Troubleshooting/Data_Storage_Software/ONTAP_OS/What_are_the_differences_between_hard_mount_and_soft_mount