NFS Setup

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.
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

unixway52Connect With a Mentor Commented:
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.

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
davidpmAuthor Commented:
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.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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".
davidpmAuthor Commented:
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.
What release of Linux are you running?
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.

davidpmAuthor Commented:
RH 6.1
Will test with and with-out server rpm
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.
davidpmAuthor Commented:
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.
All Courses

From novice to tech pro — start learning today.