LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-31-2007, 02:09 PM   #1
Ingla
Member
 
Registered: Oct 2005
Distribution: Ubuntu 8.04, Ubuntu 10.04
Posts: 159

Rep: Reputation: 15
NFS File Share - Cannot Mount


Hello.

I've been trying to set up file sharing between two Linux boxes. I have never made a Linux network before.

In general, I followed a howto at:

http://nfs.sourceforge.net/nfs-howto/ar01s03.html

with a little help from Google and other howto's here and there.

Everything seems to be set on both machines, but I can't mount anything. I get "mount to NFS server '10.0.0.2' failed." with no further feedback.

I'm on one machine, trying to mount a folder on another (10.0.0.2). The machines are connected via a router and hub.

Here's some output for anyone who understands these things.

-------------------------------------------------------------------
/ect/exports:
# /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) hostname2(ro,sync)
#
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes gss/krb5i(rw,sync)
#
/home/aba 0.0.0.0/0(rw) 10.0.0.2(rw) 10.0.0.139(rw)

-----------------------------------------------------------------
/etc/hosts.allow:
# /etc/hosts.allow: list of hosts that are allowed to access the system.
# See the manual pages hosts_access(5), hosts_options(5)
# and /usr/doc/netbase/portmapper.txt.gz
#
# Example: ALL: LOCAL @some_netgroup
# ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper, as well as for
# rpc.mountd (the NFS mount daemon). See portmap(8), rpc.mountd(8) and
# /usr/share/doc/portmap/portmapper.txt.gz for further information.
#
service: 10.0.0.2 , 10.0.0.3
portmap: 10.0.0.2 , 10.0.0.3
lockd: 10.0.0.2 , 10.0.0.3
rquotad: 10.0.0.2 , 10.0.0.3
mountd: 10.0.0.2 , 10.0.0.3
statd: 10.0.0.2 , 10.0.0.3

-----------------------------------------------------------------
/etc/hosts.deny:
# /etc/hosts.deny: list of hosts that are _not_ allowed to access the system.
# See the manual pages hosts_access(5), hosts_options(5)
# and /usr/doc/netbase/portmapper.txt.gz
#
# Example: ALL: some.host.name, .some.domain
# ALL EXCEPT in.fingerd: other.host.name, .other.domain
#
# If you're going to protect the portmapper use the name "portmap" for the
# daemon name. Remember that you can only use the keyword "ALL" and IP
# addresses (NOT host or domain names) for the portmapper. See portmap(8)
# and /usr/doc/portmap/portmapper.txt.gz for further information.
#
# The PARANOID wildcard matches any host whose name does not match its
# address.

# You may wish to enable this to ensure any programs that don't
# validate looked up hostnames still leave understandable logs. In past
# versions of Debian this has been the default.
# ALL: PARANOID
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

---------------------------------------------------------------
ps aux | grep portmap
daemon 4339 0.0 0.0 1768 380 ? Ss Jul30 0:00 /sbin/portmap
aba 10716 0.0 0.0 2888 768 pts/0 S+ 19:31 0:00 grep portmap

----------------------------------------------------------------
rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100005 1 udp 798 mountd
100005 1 tcp 801 mountd
100005 2 udp 798 mountd
100005 2 tcp 801 mountd
100005 3 udp 798 mountd
100005 3 tcp 801 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 32909 nlockmgr
100021 3 udp 32909 nlockmgr
100021 4 udp 32909 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 35975 nlockmgr
100021 3 tcp 35975 nlockmgr
100021 4 tcp 35975 nlockmgr
100024 1 udp 32910 status
100024 1 tcp 42428 status

-----------------------------------------------------------------
showmount -e 10.0.0.2
portmap getport: RPC: Success
-----------------------------------------------------------------
sudo mount -t nfs 10.0.0.2:/media/hdc1 /media/Ubuntu-Shared
mount to NFS server '10.0.0.2' failed.

I have restarted nfs server, nfs-common, daemons, etc.

Can anyone help get this mounted?

Thanks very much.

Last edited by Ingla; 07-31-2007 at 02:16 PM.
 
Old 07-31-2007, 03:41 PM   #2
mallux
Member
 
Registered: Jun 2007
Location: London, UK
Distribution: Ubuntu, RHEL, Fedora
Posts: 46
Blog Entries: 1

Rep: Reputation: 16
Hi Ingla

You have only exported the directory /home/aba on your server (in /etc/exports) but you are attempting to mount a different directory (/media/hdc1). I can't tell which one you really wanted but if you need to mount 10.0.0.2:/media/hdc1 then you need to add it to the end of /etc/exports (instead of /home/aba).
 
Old 07-31-2007, 05:27 PM   #3
isuck@linux
Member
 
Registered: Jun 2006
Distribution: messed up debian
Posts: 250

Rep: Reputation: 30
Do you have the correct port number forwarding in your router? check this out:

NFS port ranges
The NFS_PORT_RANGE environment variable can be used to limit the source port of network calls the client makes to the server.

If used, this environment variable should be added to the /etc/environment file. The format of the environment variable is as follows:
NFS_PORT_RANGE=udp[4000-5000]:tcp[7000-8000]
In this example, UDP packets sent by the client will have a source port in the range 4000 to 5000, and TCP connections will have a source port in the range 7000 to 8000.
 
Old 08-01-2007, 09:12 AM   #4
Ingla
Member
 
Registered: Oct 2005
Distribution: Ubuntu 8.04, Ubuntu 10.04
Posts: 159

Original Poster
Rep: Reputation: 15
Thanks for the replies.

I haven't tried the port thing yet, but a couple of things have come up:

Trying to mount the correct folder gives the same results:

sudo mount -t nfs 10.0.0.2:/home/aba /media/Ubuntu-Shared
Password:
mount to NFS server '10.0.0.2' failed.
------------------------------------------------------------------

So far, I've been sitting on the Feisty machine, trying to mount the Dapper machine's home directory. I've now tried it the other way around. On the Dapper machine I do get a reason "Permission denied". So, I made sure the folder on Feisty gave r/w permissions to everyone (the directories to mount to are set that way too), but no good.

There's a Troublshooting guide in the howto at:
http://nfs.sourceforge.net/nfs-howto/ar01s07.html

Went back to Feisty to check it out:

It says to run exportfs -ra, which I did (even though I had not edited the file manually ... the contents of the file were created automatically ... apparently when I shared the folder with the GUI).

I got this:
exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "0.0.0.0/0:/home/aba".
Assuming default behaviour ('subtree_check').
NOTE: this default will change with nfs-utils version 1.1.0
exportfs: invalid netmask `0' for 0.0.0.0
-----------------------------------------------------------------
Also, it said to check /proc/fs/nfs/exports and /var/lib/nfs/xtab. Both files are empty on both machines. I don't know what to write there. Apparently, nothing was put there automatically when I set up the server.

One more thing: Both machines have been online continously since I did the setup (I started all the daemons manually, except that I don't seem to have rpc.rquotad). I have not rebooted either.

Note: On Feisty, installation of NSF stuff did not create files hosts.allow or hosts.deny. I copied those files from Dapper and manually pasted them into Feisty (FTP), using the same ownership and permissions, and edited manually.
------------------------------------------------------------------

Does this information shed any new light on the problem?

Thanks.

Last edited by Ingla; 08-01-2007 at 09:24 AM.
 
Old 08-06-2007, 09:13 AM   #5
mallux
Member
 
Registered: Jun 2007
Location: London, UK
Distribution: Ubuntu, RHEL, Fedora
Posts: 46
Blog Entries: 1

Rep: Reputation: 16
Quote:
Originally Posted by Ingla
exportfs: invalid netmask `0' for 0.0.0.0

Does this information shed any new light on the problem?
Ah, perhaps 0.0.0.0/0(rw) is not valid syntax for the NFS server and it's stopping at that point. If you want to export to everyone (which is what this is effectively saying) then you can use *(rw) or even just (rw) on its own. Otherwise remove that whole phrase and leave it with explicitly defined host entries thus:
/home/aba 10.0.0.2(rw) 10.0.0.139(rw)
 
Old 08-06-2007, 04:05 PM   #6
Ingla
Member
 
Registered: Oct 2005
Distribution: Ubuntu 8.04, Ubuntu 10.04
Posts: 159

Original Poster
Rep: Reputation: 15
Thanks for the reply.

I did exactly that. Also, went over all the steps again and fixed a few things.

At last, I have a working NFS connection between two machines in both directions.

Thanks to everyone!
 
Old 08-06-2007, 07:56 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
How about writing that up and adding it to the 'Success Stories' forum?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab entry does not mount nfs share nanbudh Linux - Networking 13 06-07-2012 02:05 PM
NFS mount of smb mount of windows share: permission denied problem :( Bagatur Linux - Networking 4 07-07-2009 11:34 AM
df halt when mount large NFS share PhillipHuang Red Hat 8 10-26-2007 03:57 AM
Permission denied trying to mount nfs share leupi Linux - Networking 1 07-30-2007 01:32 AM
Can't mount nfs- or cifs-share rw in Debian pingu Linux - Networking 0 07-03-2007 07:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration