This post will cover the complete installation and setup of a NFS client and server on SuSE Linux. By default, the system include the NFS client but not the server.
First of all, make sure that NFS traffic is allowed if you are running any firewall on the client/server machine. You can achieve this through YaST :
YaST -> Security and Users -> Firewall
Then follow these steps to configure the server and client(s) :
1. On the machine from where the files are located and will act as “server”, install the server software :
yast2 -i nfs-kernel-server
(If you are installing offline or without repo, you will be required to insert the installation disk #1.)
2. Since we are using NFSv4, we want to configure idmapd which handle the user ID mapping across the systems (you do not have to match the user IDs anymore by default with NFSv4, just ensure that the user(s) exist on all systems) :
vi /etc/idmapd.conf
At the begining of the file, search for :
Domain = localhost
And change it to your “domain” (this usually match the domain or subdomain (FQDN) that cover your infrastructure) Example :
Domain = dev.itechlounge.net
3. Add the folders and host permissions to the exports (remote client machines that should be allowed to access each ressources) :
vi /etc/exports
Then add the IP adresses as followed :
/path/to/nfs 192.168.5.100(rw,sync,no_root_squash,no_subtree_check)
4. Restart the daemon :
/etc/init.d/idmapd restart
5. On the machine that will act as a “client”, configure idmapd with the same domain value you’ve set on the server at point #2 (make sure the same required users from the server system are created).
6. Restart nfs client :
/etc/init.d/nfs restart
7. Configure fstab :
vi /etc/fstab
And add the NFS mount points as followed :
192.168.5.10:/path/to/nfs /path/to/nfs nfs4 rsize=8192,wsize=8192,timeo=14,intr
You should now be fine to mount the NFS resource, make sure the folder exist on the client computer and mount it :
mount /path/to/nfs