NFS Configuration on SUSE Linux

NFS stands for Network File System. Used for file sharing between *nix machines only. If you want to share files between Windows and Unix machines then you need to use SAMBA for that.

Server Side Configuration:

To check nfs packages are installed on the server machine use this command on terminal  
#rpm -qa |grep nfs

Configure Host File:

#cd /etc

/etc # vi hosts

Add IP addresses of all machines in hosts file with full qualified domain name    ws1.pim    ws1     ws1 is machine name & pim is domain name   ws2.pim    ws2

Save and close hosts file.

Now restart the services of network as shown below.

Following file needs to be configured on the Server machine on which you want to share the directories. 

# /etc/exports

The format of this file is:

DirectoryPath                             hostlist(permissions)

Where path is the absolute path of the directory you want to share and host list can be one or more hosts that can access the share. Each host to be separated by a white space.  Hosts can be specified in the following ways:

• By using a hostname, if the host is part of local domain. eg. ws2
• By using a fully qualified domain name. eg. ws2.pim      where ws2 is machine name & pim is domain name
• By using a hostname containing a wild card. e.g. *.pim
• By using IP address. e.g.
• By using a network address. e.g. or

And permissions can be (ro) for read only and (rw) for read & write. DO NOT specify any white space between host specifier and permissions.Also w.r.t permissions, by default, if a client is logged in as root on his own machine, then he will NOT be given root permissions on the machine hosting the shares ( he will be squashed !) . Instead, such requests are mapped to user id 65535 (which of-course doesn't exist on a normal system). If you want to permit remote root acting as local root on the machine holding shares, then you need to enable a special permission as (no_root_squash). e.g. 

/mnt                            ws2.pim(rw,no_root_squash)

This line means that if root logs in from ws2.pim, and he tries to write some files in the /mnt directory of the computer holding the shares, then he will be ALLOWED to do all the editing to the files which are write able by root of local machine.

Now we share the nfs folder that is present in /mnt directory:

# vi  /etc/exports

/mnt/nfs   ,no_root_squash)

Save the exports file. 

Once /etc/exports file is edited, you need to run given below command on terminal:

# service nfsserver restart

Now check if the directories you put in /etc/exports are now available as shares or not by:

use showmount -e command to show the nfs shares.

If you edit your /etc/exports file later, then you need to run exportfs command again with a -r switch to refresh the share list. i.e.

# exportfs -r

Client Side Configuration:

To check which directory is shared from the server machine, issue this command from client machine: 

# showmount -e ws1 where ws1 is Server machine name

Whatever the name resolution method being used in the domain, it should be working correctly / configured correctly else NFS mount will normally fail and will also give weird messages. If you occasionally need to access the shared directories on the server, then there is nothing to be configured on the client side. You just need to give the following command each time to want to access a share on the server.

# mount -t nfs ws1:/mnt/nfs /mnt/ServerNFS/

The above line means that /mnt/nfs directory from the server ws1 will be mounted on a local directory (mount point) /mnt/ServerNFS  using nfs protocol, or simply nfs file-system.


Popular posts from this blog

Create Tables in Oracle Database using TOAD

How to create Oracle stored Procedures using TOAD for Oracle

How to Create Packages in Oracle Database using TOAD for Oracle