Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
PHP Web Host - Quality Web Hosting For All PHP Applications

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents
Up to --> Networking

· The Flow of Things
· When Things Go Wrong
· Automount

Man Pages
Linux Topics
Test Your Knowledge

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

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

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

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

Linux Tutorial - Networking - NFS - The Flow of Things
  NFS ---- When Things Go Wrong  

The Flow of Things

There are two daemon processes that provide the NFS services on the server. These are mountd and nfsd. mountd is responsible for checking access permissions to the exported filesystem. When a clients tries to mount a filesystem, mountd returns a pointer to the filesystem if the client has permission to mount it.

The workhorse on the server side is the nfsd daemon. It has the responsibility of handling all filesystem requests from the clients. Once a filesystem has been mounted, all access to the data on that remote filesystem is made through nfsd. Remember that you could be exporting directories and not just entire filesystems. Therefore it's better to say that access to the mount point and below is made through nfsd.

Also key to this whole process is the portmapper, portmap. The portmapper converts TCP/IP port numbers to RPC program numbers. What this means is that when the NFS starts up, it registers its port with the local portmap process. The clients access the server by asking the portmapper on the server for the port number of nfsd and mountd. The port number is then used on all subsequent RPC calls.

In principle, mounting a remote filesystem is like mounting a local one. The general syntax is:

One of the primary differences is that since we are an NFS filesystem, we have to explicitly tell mount, by using the '-t nfs option. We can also include other options such as '-r' for read only. Let's assume that we have our two machines jmohr and siemau. On siemau is an NFS filesystem that we want to mount from jmohr. Assuming that the proper entries exist in the /etc/exports file on siemau, the command on jmohr might look like this:

Like other filesystems, the local mount command parses the command into tokens and ensures that entries don't already exist in the mount table (/etc/mnttab) for either the filesystem or the directory. Realizing that this is a remote filesystem, mount gets the IP address for siemau (by whatever means are configured on the local machine) and gets the port number of mountd on siemau. The mount command then passes mountd the pathname of the requested directory (/usr/data).

Now it's the server's turn. To makes sure it can service the request, mountd must first check /etc/exports for the requested filesystem. In this case /usr/data. If jmohr is permitted, mountd passes back what is called a file handle, or pointer. Now the mount back on jmohr uses that file handle and the mount point (/data) as arguments the mount() system call. Finally, an entry is placed in the local mount table.

There are two primary NFS configuration files: /etc/exports and /etc/fstab. The /etc/exports file exists on the server and list those files and directories that can be accessed by remote hosts. It can also be configured to allow or deny access to specific hosts. Since each of these is a filesystem, you can manage anything mounted by NFS through /etc/fstab. This allows you to mount remote filesystems at boot or in any way you can with a "normal" filesystem. One advantage NFS has over local filesystems is that you can configure them to be mounted only when you need them. That is, if the files in the directories are not used, the connection is not made. However, if the files are needed, the connection is automatically made. This is the concept of automounting, which we will get into next.

 Previous Page
  Back to Top
Table of Contents
Next Page 
When Things Go Wrong


Test Your Knowledge

User Comments:

You can only add comments if you are logged in.

Copyright 2002-2009 by James Mohr. Licensed under modified GNU Free Documentation License (Portions of this material originally published by Prentice Hall, Pearson Education, Inc). See here for details. All rights reserved.



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?
You can get all the latest Site and Linux news by checking out our news page.


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.13 Seconds