LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   NFS File Share - Cannot Mount (http://www.linuxquestions.org/questions/linux-software-2/nfs-file-share-cannot-mount-573733/)

Ingla 07-31-2007 02:09 PM

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.

mallux 07-31-2007 03:41 PM

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).

isuck@linux 07-31-2007 05:27 PM

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.

Ingla 08-01-2007 09:12 AM

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.

mallux 08-06-2007 09:13 AM

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)

Ingla 08-06-2007 04:05 PM

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!

chrism01 08-06-2007 07:56 PM

How about writing that up and adding it to the 'Success Stories' forum?


All times are GMT -5. The time now is 11:39 AM.