How to install and configure NFS on OpenSUSE 13.1

How to install and configure NFS on OpenSUSE 13.1

NFS (Network File System) is used for share files between Linux/UNIX to UNIX/Linux systems. With NFS users can access files on remote systems as if they were stored locally. OpenSUSE is an user-friendly operating system based on the Linux distributions.The main purpose of OpenSUSE is to make it as a suitable choice for software vendors and Linux experts. This article will explain the installation and configuration procedure of NFS on OpenSUSE 13.1.

Pre-Requisite

There should be a Server-Client relationship for the NFS to work on OpenSUSE 13.1

NFS Server IP Address : 192.168.7.216

NFS Client IP Address : 192.168.7.218

Installation and configuration procedure

To install NFS in Server side system, execute the following command.

linuxhelp1:~ # zypper in nfs-kernel-server
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following NEW package is going to be installed:
  nfs-kernel-server

1 new package to install.
Overall download size: 113.4 KiB. After the operation, additional 440.5 KiB will be used.
Continue? [y/n/? shows all options] (y): y
Retrieving package nfs-kernel-server-1.2.8-4.2.1.x86_64                                               (1/1), 113.4 KiB (440.5 KiB unpacked)
Retrieving: nfs-kernel-server-1.2.8-4.2.1.x86_64.rpm ................................................................................[done]
(1/1) Installing: nfs-kernel-server-1.2.8-4.2.1 .....................................................................................[done]

Now enable and start rpcbind and NFS services by running the following commands.

linuxhelp1:~ # systemctl enable rpcbind.service
linuxhelp1:~ # systemctl start rpcbind.service
linuxhelp1:~ # systemctl start nfsserver.service
linuxhelp1:~ # chkconfig nfsserver on

Next install the NFS in Client side system and run the following yum command.

[root@www~]# yum install nfs-utils

Create a new NFS user shares in server side by creating a new directory and changing the user permission for the created directory.

linuxhelp1:~ # mkdir /var/user_share
linuxhelp1:~ # chmod 777 /var/user_share/

Export the shared directory on NFS Server and create a new file named exports using vim editor. Enter the following contents and save the changes.

linuxhelp1:~ # vim /etc/exports
/var/unixmen_share/     192.168.7.218(rw,sync,no_root_squash,no_all_squash,no_subtree_check)

To check whether the configuration file that you have created is correct or not, run the following command.

linuxhelp1:~ # exportfs  -a

Next restart the rpcbind and NFS services by executing the following command.

linuxhelp1:~ # systemctl restart nfsserver.service
linuxhelp1:~ # systemctl restart rpcbind.service

Go to your client system and Create a mount point to mount the share directory ‘ var/user_share’ which we have created earlier. By default, openSUSE firewall doesn’ t allow remote clients to connect to NFS server.

To allow NFS server to access from the outbound, go to YAST control center -> Security and Users -> Firewall. Navigate to Allowed Services tab. Select NFS Secure Service from Service to Allow drop down box and click add. Finally click Next to allow the NFS service through SUSE firewall.



The firewall configuration is in process.

Create a file named fstab using vim editor and enter the following contents in the file. Save and exit from the file.

[root@www~]# vim /etc/fstab
192.168.7.218:/var/user_share/ /var/nfs_share/ nfs defaults 0 0

To check whether the configuration procedure is correct or not, execute the following synax.

[root@www~]# mount -a

Create a directory in client side and view it in server side.

[root@www~]#cd /var/nfs_share
[root@www nfs_share]# mkdir test1

Go to the server side directory and list the created directories.

linuxhelp1:~ # cd /var/user_share/
linuxhelp1:/var/user_share # ls -l
total 4
drwxr-xr-x 2 root root 4096 Aug  2 13:47 test1

The installation and configuration of NFS in OpenSUSE is now complete.

FAQ
Q
Can I run NFS across the TCP/IP Transport Protocol?
A
Client support for NFS over TCP is integrated into all 2.4 and later kernels.

Server support for TCP appears in 2.4.19 and later 2.4 kernels, and in 2.6 and later kernels. Not all 2.4-based distributions support NFS over TCP in the Linux NFS server.
Q
What is purpose of NFS?
A
It is designed in such a way that it supports sharing of folders and files by using a standard client/server architecture.
Q
Whether NFS and CIFS both are same?
A
No, they both have different purposes, not to be the same.
Q
What is protocol to be used in NFS?
A
RPC(Remote Procedure Call) protocol which will be using in NFS.
Q
Whether its possible to change the default path of NFS into customizing path?
A
Yes, you can change the default path of NFS.