NFS Server Configuration
Aim: To configure NFS Server in RedHat Enterprise
Linux
Theory: NFS, or Network File System, is a serverclient protocol for sharing files between computers on a
common network. NFS enables you to mount a file
system on a remote computer as if it were local to your
own system. You can then directly access any of the
files on that remote file system. The server and client
do not have to use the same operating system. The
client system just needs to be running an NFS
client compatible with the NFS server.
For example NFS server could be a Linux system and
Unix could be a client. But it cant be a window system
because window is not NFS compatible. The NFS server
exports one or more directories to the client systems,
and the client systems mount one or more of the
shared directories to local directories called mount
points. After the share is mounted, all I/O operations are
written back to the server, and all clients notice the
change as if it occurred on the local file system.
A manual refresh is not needed because the client
accesses the remote file system as if it were local
because access is granted by IP address, a username
and password are not required. However, there are
security
risks
to
consider
because
the NFS
server knows nothing about the users on the client
system.
Configure NFS Server
In this example we will configure a nfs server and will
mount shared directory from client side.
For this example we are using two systems one linux
server one linux clients . To complete these per quest of
nfs server Follow this link
Network configuration in Linux
A linux server with ip address 192.168.0.254 and
hostname Server
A linux client with ip address 192.168.0.1 and
hostname Client1
Updated /etc/hosts file on both linux system
Running portmap and xinetd services
Firewall should be off on server
We suggest you to review the below snapshot before
starting the configuration of nfs server.
Three rpm are required to configure nfs server. nfs,
portmap, xinetd check them if not found then install
Now check nfs, portmap, xinetd service in system
service it should be on
#setup
Select System service
from list
[*]portmap [*]xinetd [*]nfs
Now restart xinetd and portmap service
To keep on these services after reboot on then
via chkconfig command
After reboot verify their status. It must be
in running condition
now create a /data directory and grant full permission
to it
Now open /etc/exports file
share data folder for the network
of 192.168.0.254/24 with read and write access
save file and exit
now restart the nfs
service and also on it
with chkconfig if you want to keep the services after
reboot on
also restart nfs daemons with exportfs
verify with showmount command that you have
successfully shared data folder
configure client system
ping form nfs server and check the share folder
now mount this share folder on mnt mount point. To
test this share folder change directory to mnt and
create a test file
After use you should always unmount from mnt mount
point
In this way you can use shared folder.
Conclusion: Thus we have successfully studied NFS
Server Configuration.