Improve company productivity with a Business Account.Sign Up


NFS Setup

Posted on 2000-05-10
Medium Priority
Last Modified: 2010-03-18
When I attempt to use the following command:
mount samba3:/home/public /mnt/samba3
I get an error
Mount: RPC: Program not registered
What do have to do to make this work.
Question by:davidpm
  • 4
  • 3
  • 2
  • +1

Expert Comment

ID: 2798905
I assume you use RedHat Linux.
When you encounter this problem, I think you need to add a line in the /etc/fstab file like:

samba3:/home/public  /mnt/samba3 NFS noauto 0 0

Then run you command again

Author Comment

ID: 2800021
I added that line on the client and it  did not work.
I also believe you are going the wrong direction because my command should have mounted the file system manually. IOW fstab is for bootup automation etc and is not "required" for a manual mount.
I suspect it has something to do with portmapper and perhaps hosts.allow but what I have tried has not worked so far.

Expert Comment

ID: 2802834
You need to make sure your /etc/exports file is set up properly on your server computer, samba3.  Add the following line to the file:
/home/public clientname(rw)
where client name is the remote computer you are trying to mount the drive to.  Then type:
exportfs -a
Then you must restart the NFS daemon using linuxconf, in control panel, control service activity.  Or to restart it type ""/etc/rc.d/init.d/nfs restart".
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!


Accepted Solution

unixway52 earned 150 total points
ID: 2803137
On RH 6.1 you must install the knfsd-1.4.7-7.i386.rpm first ...

Insert your rh cd then cd /mnt/cdrom/RedHat/RPMS. Let it automount
or mount it manually.

# rpm -U knfsd-1.4.7-7.i386.rpm
# cd /etc/rc.d/init.d
# ./nfs start

I don't know why the server side has to be installed in order for the
client side to be able to talk to portmap, but at least in RH I seem to
remember it's been that way for some time. The knfsd-client gets installed
during the normal os install.


Author Comment

ID: 2804556
I noticed that I did not have a exportfs command so I stumbled on your solution a few minutes before you posted it.
I will try a clean build on two machines so I'll know exactly what is required.
I defintly had to install the server side on the server but are you saying that the server package has to be installed on the client side also?
I'll try it out both ways so I'll know for sure.

Expert Comment

ID: 2804597
What release of Linux are you running?

Expert Comment

ID: 2805779
Sorry if I wasn't clear. Yes, you do need to install the server side for the client to work.
I'm not sure if this is specific to RH ...
I suspect not.

It had been documented some time ago in the
Caldera knowledgebase (which is based in RH).

In particular, commands like showmount need
the server running on the calling machine.


Author Comment

ID: 2806401
RH 6.1
Will test with and with-out server rpm

Expert Comment

ID: 2807635
Your client side needs only kernel support compiled in for NFS to work.  Otherwise how could diskless clients perform NFS mounts????  Of course to manually mount a drive from the client side, you need to have ability to use the mount command, but you don't need to run or install the server software.

Author Comment

ID: 2807890
I wrote the following little faq sheet for my NT guys who are learning Linux.
Notice that at least for 6.1 the nfs server is not required to mount a nfs directory and is not required for showmount.

To prove this I did a clean install. Fixed hosts and then ran the mount and showmount commands as above and they worked fine.

I am looking for technical criticism of the following paper. Whats wrong?

What is NFS?
NFS stands for network file system. It is composed of a server and client component. The server component exports a local directory so it can be mounted (seen) by other Linux (or Unix) systems. If you only have one Linux machine and want to share its directories you probably want Samba instead of NFS.
It is similar to file sharing in Windows but different in many ways including the following:
1.      There is no browsing. To see an exported directory you have to know the host name and the directory/
2.      The path to this share is from your own root path. You need to know the server’s host name and the shared directory path to mount (connect) it. Once mounted it is accessed as if it was a local directory.
3.      A share is referred to as an exported directory.

Assumed Environment
Red Hat 6.1

Server Setup
If you are building a server and plan on exporting directories select the NFS Server package during install. If you have an existing install you can install the NFS server e following commands:
1.      mount /mnt/cdrom
2.      cd /mnt/cdrom/RedHat/RPMS
3.      rpm –Uvh knfsd-1.4..7-7.rpm
If you are not sure if you have nfs server installed do the following command:
find /usr/sbin -name exportfs
If the exportfs file is not present you need to install the package
vi /etc/exports
Add a line similar to the following:
The /home/public is the directory to export
The means allow access to the whole subnet
You many put only one ip address to limit access to one host.
The (rw) means grant read write rights.

/etc/rc.d/init.d/nfs start
If you want it to start on bootup run:
Setup then select system services and turn on nfs and nfslock

Client setup
The client portion of nfs is installed by default.
From a client you can mount the exported directory with the following command
mount hostname:/home/public /mnt
hostname is the name of the computer with the exported directory
What follows is the path to the exported directory
The /mnt is where on your system you are going to mount the contents of the /home/public directory from the nfs server. Notice that you will not see a directory public under /mnt in the above example. You will see the contents of /home/public from the nfs server. If you want to see a folder public you have to do the following:
Mkdir /mnt/public
mount hostname:/home/public /mnt/public
To disconnect type:
umount /mnt/public
Hostname has to resolve to the ip address of hostname for the above command to work.
Vi /etc/hosts
Add a line like the following  nfs-server

man exports give more information on the exports file.
Man nfs give more information on nfs
There is a nfs how-to that goes into more detail.

Showmount  nfs-server-host-name will show who is connected to the exported directory.

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…

606 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question