Problem: cannot mount NFS share

Asked by jaws

Ubuntu 9.04 - januty jackalope

I am trying to get nfs volume to mount, but having no luck after hours of reading and trying different methods from support bulletins and forum posts. Is this a Ubuntu 9.04 issue? I'm not sure where to go from here. Can someone give me the low down on how to accomplish this with Ubuntu.

I have followed the Ubuntu on-line documentation for server and client install. All services are running on each system. Here is the mount command I am using.

# mount 192.168.0.3:/home/username/host directory /home/username/client directory

I'm running this as root instead of (sudo). It returns the following:

mount.nfs: mount system call failed

If I do it as (sudo mount ....) it returns a RPC failure error.

What am I missing here? Please help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu nfs-utils Edit question
Assignee:
No assignee Edit question
Solved by:
Dominik
Solved:
Last query:
Last reply:

This question was reopened

  • by jaws
Revision history for this message
jaws (john-westtexan) said :
#1

I continued reviewing other NFS related messages for an answer but have not found one yet. I also noticed that you can mount remote file systems without using nfs-kernel-server. I have not tried this but have seen references of mounting remote file systems. Are you still exporting them?

Revision history for this message
Dominik (domfi) said :
#2

Hello jaws,

do you have the package "portmap" installed on your client (and server)? If you do
an "sudo apt-get nfs-client" this should be installed as a dependancy. You can check
if it is installed with "dpkg -l portmap". To check if the portmap daemon runs try
"/etc/init.d/portmap status".

For further investigations:

What protocol version of NFS are you using V3 or V4? Could you please paste your
/etc/exports here?

On the server side: which package do you have installed: unfs3 or nfs-kernel-server?

Cheers,
Dominik

Revision history for this message
jaws (john-westtexan) said :
#3

Thanks for your reply. I finally got things working and the problem was one of
two of my errors.

First, I spent hours trying to mount as user "root" instead of "sudo" to root.
I thought that would be okay because I thought my UID was equal to root. I
have forgot about all of this. I was use to logging in as root with Unix
system V, so once again user permissions is probably culprit. The other thing
I noticed is that I had two instances of "statd" in my hosts.allow. I guess
this would not be a problem though.

I would like to know how to mount remote files systems without nfs-kernel-
server installed. There is one post on how to do this but I have not been
successful. I just need to mount a directory to copy files to the other client.
Could some elaborate and give some examples.

Thanks!

On Friday 12 June 2009 07:40:59 am Dominik wrote:
> Your question #73865 on nfs-utils in ubuntu changed:
> https://answers.launchpad.net/ubuntu/+source/nfs-utils/+question/73865
>
> Status: Open => Needs information
>
> Dominik requested for more information:
> Hello jaws,
>
> do you have the package "portmap" installed on your client (and server)? If
> you do an "sudo apt-get nfs-client" this should be installed as a
> dependancy. You can check if it is installed with "dpkg -l portmap". To
> check if the portmap daemon runs try "/etc/init.d/portmap status".
>
> For further investigations:
>
> What protocol version of NFS are you using V3 or V4? Could you please
paste
> your /etc/exports here?
>
> On the server side: which package do you have installed: unfs3 or nfs-
> kernel-server?
>
> Cheers,
> Dominik

Revision history for this message
jaws (john-westtexan) said :
#4

This is just a test install to experiment with. I believe it is NFSv3 kernel-server. The version is 1:1.1.4-1ubuntu1. rpcinfo shows version 2,3, &4 UDP & TCP deamons are running.

Hope this helps. I have it working now but I would like to learn more about the non-server configuration. Give me some more status commands that are useful in diagnosing nfs operations. I'll be looking a the man pages and other documentation to get back up to speed on this. It has been 10 years, and I have forgotten almost everything including vi commands. It will come back quickly though.

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
#
/home/johnw/test 192.168.0.3(rw,sync,no_subtree_check)
#/home/johnw/Public 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)

Revision history for this message
jaws (john-westtexan) said :
#5

Someone please explain the difference between (having or not), nfs-kernel-server installed for mounting directories over the network. It sounds like nfs-common is all I need to share a directory temporarily? I assume the server method is full featured and secure, whereas, client-to-client is bare bones.

Please elaborate.

Revision history for this message
jaws (john-westtexan) said :
#6

user@host:~/Documents$ dpkg -l portmap
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii portmap 6.0-9ubuntu1 RPC port mapper

user@host:~/Documents$ dpkg -l nfs-common
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii nfs-common 1:1.1.4-1ubunt NFS support files common to client and serve

user@host:~/Documents$ dpkg -l nfs-kernel-server
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii nfs-kernel-ser 1:1.1.4-1ubunt support for NFS kernel server

Revision history for this message
Best Dominik (domfi) said :
#7

First some commands for diagnosis as you requested:

With NFS your options to diagnose problems are poo in comparison to e.g. Samba.
On client-side you can make shure, that all necessary daemons are running:
# /etc/init.d/portmap status
# /etc/init.d/nfs-common status

Or you use "ps" to look at the running processes:
# ps -ef |grep -E "rpc|portmap|nfs"
daemon 2557 1 0 15:45 ? 00:00:00 /sbin/portmap
statd 2567 1 0 15:45 ? 00:00:00 /sbin/rpc.statd
root 2570 2 0 15:45 ? 00:00:00 [rpciod/0]
root 2573 2 0 15:45 ? 00:00:00 [rpciod/1]
root 2577 2 0 15:45 ? 00:00:00 [nfsiod]
root 2592 1 0 15:45 ? 00:00:00 /usr/sbin/rpc.idmapd
root 4953 2 0 15:45 ? 00:00:00 [nfsv4-svc]

Pass "-v" to your mount command to get some more verbosity.

You find some configuration parameters for the nfs-client under /etc/default/nfs-common.

And as you already know, you can use "rpcinfo" to check, if all necessary daemons
are running on your server:
# rpcinfo -p <nfs-server>

To get some statistics of your established NFS-Connections you can use

# nfsstat

But I think this is only from interest if you are using NFS V4.

That's all I remember at the moment. I hope it helps.

Second: your question regarding nfs-kernel-server and nfs-common
On all machines which should use nfs in either way you need nfs-common installed. If
you want to export directories via NFS to other machines the exporting machine
must act as a NFS-Server. For this you need the virtual package nfs-server.
If you try to install this it gives you two options to get a nfs-server:

# apt-get install nfs-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package nfs-server is a virtual package provided by:
  unfs3 0.9.21+dfsg-1
  nfs-kernel-server 1:1.1.4-1ubuntu1
You should explicitly select one to install.
E: Package nfs-server has no installation candidate

I can't say anything about "unfs3". I always use the nfs-kernel-server.
To export a directory I install nfs-kernel-server, configure /etc/exports and
start up /etc/init.d/nfs-kernel-server and /etc/init.d/nfs-common.

I've never heard of a client-to-client NFS configuration. For NFS you always
need a NFS-Server (program or daemon or so) to export directories.

Cheers,
Dominik

Revision history for this message
jaws (john-westtexan) said :
#8

Thanks Dominik! I just need to spend some time to get reaquainted with system & network administration techniques. This is all in effort to switch over Ubuntu as my primary OS. I'm already there, but I have to move files and things normalized under Linux. Getting to up to speed on Samba and VMware server are next.

There is another post about mounting remote file system without being a nfs-server. I will follow up with that if I find out more on it.

Thanks for the tips.