Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages
Recommend Us

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 223 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here


Re: How to configure NFS Server and Client Configuration on Ubuntu 15.04 (Score: 1)
by NikhilSingh on Thursday, May 04, 2017 @ 08:00:57 UTC

FS (Network File System) is another way of sharing files across a network. It is used primarily in Linux and UNIX systems, although there are NFS clients for Windows.
Installing NFS

1. Use the following command to install NFS:

yum -y install nfs-utils nfs-utils-lib
Configuring NFS

Configuration of NFS is pretty simple. You add the directories you wish to export to the file /etc/exports.

2. Create a directory called /public with the following command:

mkdir /public

3. Populate it with three empty files:

touch /public/nfs1 /public/nfs2 /public/nfs3

4. Next, edit the file /etc/exports:

vi /etc/exports

5. Add the following line to /etc/exports:

/public *(ro,sync)
Here's an explanation of the fields in the command:
/public--The directory to be shared

*--The clients allowed to access the share. You can restrict it by IP address. For example, you could, instead of the asterisk, put to restrict it to clients on the network.

ro--Read only access

sync--Reply to requests only after any changes have been committed to stable storage. This is a slower, but more stable option than alternatives.

In the following screen capture, you can see how I configured /etc/exports to share /public:
Figure 7: Configuring an NFS shared directory in /etc/exports.

6. NFS requires the rpcbind service to be running. Start it with the following command:

service rpcbind start

7. Then, start the nfs server:

/etc/init.d/nfs start

(You could also use service nfs start.

8. If you want NFS to start at boot, use the following command:

chkconfig --levels 235 nfs on

9. Enable the export immediately with the command exportfs -v. You can view the export with the command showmount -e.

If you are using a firewall, you must explicitly allow traffic from your local subnet to access the server.

For more information, see chapter 10 on Linux security.
Configuring the NFS Client

You must install the nfs package on the client with this command:

yum -y install nfs-utils nfs-utils-lib

Once the package is installed, you can use the showmount command to view exports on an NFS server:
Figure 8: Viewing NFS shares with the showmount command.

You can also create a new directory on your client and mount the NFS export to the directory, thus giving you access to the files in the directory:
Figure 9: Creating and viewing a mount point for the NFS share.

In the above example, I mounted the export from LinuxServer01 (/public) to a directory on my local client machine, called ubuntuServer02. As you can see, after it was mounted, I was able to view the contents of the exported directory locally.
Using rsync to Synchronize Files between Servers

When administering file servers, you may want to configure replication to help minimize the chance of data loss in the event of a server crash. One way to do that is with the rsync utility, which allows you to seamlessly move one or more files from one server to another. Unlike a simple file copy, however, rsync can perform differential file transfers, transferring only the data that has changed. A benefit of rsync is that mirroring occurs with only a single transmission in each direction.

Installing rsync

Use yum to install rsync with the command: yum install -y rsync. The rsync utility must be installed on both computers participating in the mirroring.

Basic rsync syntax


Some common rsync options

-a--archive mode, which allows copying files recursively, plus it preservers symbolic links, user and group ownership, file permissions, and timestamps
-e--specifies the remote shell to use. This option allows you to use SSH for the transfer
-h--human-readable which causes the system to output numbers in a human-readable format
-r--copy data recursively without preserving timestamps and permissions
-u--updates only files that have changed since the last rsync
-z--compress data

Use security with rsync

By itself, rsync transfers data in the clear. You can enable rsync over ssh with the e option, as you'll see in the upcoming exercise.
Hope This will Help
Web design Consultant @ Carmatec & RailsCarma [www.railscarma.com]




Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial can use your help.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.07 Seconds