SOLVED NFS mount times out

Status
Not open for further replies.

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
I'm a Freenas noob here having a great time exploring all the capabilities of Freenas. I'm running 8.04 p2 x64 and I am having trouble mounting an NFS share on my Ubuntu 12.04 laptop. I have gone through the documentation and set it just like the examples but it always times out without connecting. Here is what I get:


bob@bob-1000HE:~$ sudo mount -v -o tcp -t nfs 192.168.90.204:/mnt/Dundee45 /home/bob/BU
mount.nfs: timeout set for Sat May 26 09:42:54 2012
mount.nfs: trying text-based options 'tcp,vers=4,addr=192.168.90.204,clientaddr=192.168.90.180'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'tcp,addr=192.168.90.204'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.90.204 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 192.168.90.204 prog 100005 vers 3 prot TCP port 896
mount.nfs: portmap query failed: RPC: Timed out
mount.nfs: mount to NFS server '192.168.90.204:/mnt/Dundee45' failed: timed out, giving up

I can see the mount point from the client:

bob@bob-1000HE:~$ showmount -e 192.168.90.204
Export list for 192.168.90.204:
/mnt/Dundee45 192.168.90.0

What can I do next to troubleshoot this issue?
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
start mountd on your server


rpcinfo -p <host> shows which rpc-program that has registered at the portmapper
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
It appears that mountd is running.

bob@bob-1000HE:~$ sudo rpcinfo -p 192.168.90.204
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100000 4 7 111 portmapper
100000 3 7 111 portmapper
100000 2 7 111 portmapper
100005 1 udp 896 mountd
100005 3 udp 896 mountd
100005 1 tcp 896 mountd
100005 3 tcp 896 mountd
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100024 1 udp 1005 status
100024 1 tcp 1005 status
100021 0 udp 630 nlockmgr
100021 0 tcp 750 nlockmgr
100021 1 udp 630 nlockmgr
100021 1 tcp 750 nlockmgr
100021 3 udp 630 nlockmgr
100021 3 tcp 750 nlockmgr
100021 4 udp 630 nlockmgr
100021 4 tcp 750 nlockmgr
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
Ahh i see ( what i missed )
trying text-based options 'tcp,vers=4,

try to mount version 3 instead.
(mount -o nfsv3 fo rfreebsd )
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
No joy!


bob@bob-1000HE:~$ sudo mount -v -t nfs -o nfsvers=3 192.168.90.204:/mnt/Dundee45 /home/bob/BU
mount.nfs: timeout set for Tue May 29 17:54:38 2012
mount.nfs: trying text-based options 'nfsvers=3,addr=192.168.90.204'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.90.204 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.90.204 prog 100005 vers 3 prot UDP port 611
mount.nfs: portmap query retrying: RPC: Timed out
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 192.168.90.204 prog 100005 vers 3 prot TCP port 611
mount.nfs: portmap query failed: RPC: Timed out
mount.nfs: mount to NFS server '192.168.90.204:/mnt/Dundee45' failed: timed out, giving up
 

peterh

Patron
Joined
Oct 19, 2011
Messages
315
you also have ( in your first message ) the output of showmount -e :
Export list for 192.168.90.204:
/mnt/Dundee45 192.168.90.0

that allows 192.168.90.0 to mount. Does the client have this ip ?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
I had the same problem or close to it. I got a new USB key and among other things I wound up doing a factory restore on the original USB drive. Of course my saved config turned out to be couple of weeks old and I couldn't be bothered to take a few seconds to click on save config.:mad: Not a big deal, which was why I hadn't done it, but annoying nonetheless.

After I manually put my settings back on the original drive I decided to double check the NFS issue. If I remember right showmount -e took forever before.

When I ran it this time it responded immediately. I tried mounting the share and it worked right away.

The first time easily could have been user error as I don't setup NFS shares often. In fact I didn't even have nfs-common on my Squeeze install at first. Here's the successful mount:
Code:
mount.nfs yyy.aaa.zzz.nnn:/mnt/tank/tNFS /mnt/test/ -v
mount.nfs: timeout set for Wed May 30 00:02:08 2012
mount.nfs: trying text-based options 'vers=4,addr=yyy.aaa.zzz.nnn,clientaddr=aaa.zzz.nnn.yyy'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=yyy.aaa.zzz.nnn'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying yyy.aaa.zzz.nnn prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying yyy.aaa.zzz.nnn prog 100005 vers 3 prot UDP port 666
yyy.aaa.zzz.nnn:/mnt/tank/tNFS on /mnt/test type nfs


I realize the above's not really a solution, but it's working for me now.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Are you sharing out your entire volume?

On the NAS what's the output of the following:
Code:
ls -al /mnt/
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
Here you go.

[bschaefer@freenas] /> ls -al /mnt/
total 4
drwxr-xr-x 4 root wheel 512 May 29 19:47 ./
drwxr-xr-x 20 root wheel 512 May 4 10:37 ../
drwxrwxr-x 2 root operator 512 May 29 19:47 .snap/
drwxr-xr-x 6 bschaefer wheel 15 May 26 10:32 Dundee45/
-rw-r--r-- 1 root wheel 5 May 4 10:36 md_size

What are you thinking?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
What are you thinking?
That your permissions might be not be correct. If I remember right you were mapping users to the nobody user. Other has read access so I would think you should be able to mount it at least.

I'm guessing your UID for your user on the FreeNAS box is 1001. What's the UID for your Ubuntu user?

Create a user with the same UID as your Ubuntu user called nfsTester.

Then try the following:


  1. Delete current NFS share

  2. Turn off NFS service

  3. Create the directory /mnt/Dundee45/mick. As root from a SSH session or the shell:
    Code:
    mkdir /mnt/Dundee45/mick
    
    chown nfsTester /mnt/Dundee45/mick
  4. Create new NFS share authorizing a single IP & no special user mappings using /mnt/Dundee45/mick

  5. Turn on NFS

  6. Attempt mount from the authorized IP
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
Ah, I see where you are going with this. Here are the results:

Ubuntu user id: uid=1000(bob)

New FreeNas user is bullwinkle and new directory owned by bullwinkle is /rocky
[bschaefer@freenas] /> id bullwinkle
uid=1000(bullwinkle) gid=3(sys) groups=3(sys)
[bschaefer@freenas] /> ls -al /mnt/Dundee45/rocky
total 13
drwxr-xr-x 2 bullwinkle sys 10 Jun 2 07:37 ./

Results:

bob@bob-1000HE:~$ sudo sudo mount -v -t nfs 192.168.90.204:/mnt/Dundee45/rocky /home/bob/BU -otcp,vers=3
[sudo] password for bob:
mount.nfs: timeout set for Sat Jun 2 08:15:52 2012
mount.nfs: trying text-based options 'tcp,vers=3,addr=192.168.90.204'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.90.204 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: trying 192.168.90.204 prog 100005 vers 3 prot TCP port 614
mount.nfs: portmap query failed: RPC: Timed out
mount.nfs: mount to NFS server '192.168.90.204:/mnt/Dundee45/rocky' failed: timed out, giving up

But I think you may be on to something. Does the volume ownership have to match the user?
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
But I think you may be on to something. Does the volume ownership have to match the user?
Yes, they have to have the necessary permissions unless you use mapall and map the UIDs/GIDs to a specific account, i.e. nobody. Then all clients are consider to be that user.


Did you set it only your IP vs your subnet? Double check it took with:

Code:
cat /etc/exports
I believe mine hadn't updated at least one of the times I changed it, but I may not have restarted NFS in between.
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
One of my sons, who was a Linux Sys Admin for a major search provider for 3 years, found the problem this weekend. During the mount process, NFS apparently does a reverse DNS lookup to see if the address is valid. On a local network there is no way to do that unless you add the IP address of the client to the hosts file on the server. The hosts file even mentions that in the documentation in the beginning of the file. Once we did that the mount connected very quickly.

There is still one problem. FreeNAS resets the hosts file every time the system is rebooted. Now I am looking for a way to make that change permanent.
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
During the mount process, NFS apparently does a reverse DNS lookup to see if the address is valid. On a local network there is no way to do that unless you add the IP address of the client to the hosts file on the server. The hosts file even mentions that in the documentation in the beginning of the file.
Interesting. Good to know.


There is still one problem. FreeNAS resets the hosts file every time the system is rebooted. Now I am looking for a way to make that change permanent.
The commands you are looking for:
Code:
mount -uw /

mount -ro /
Changes file system on USB stick to read-write and back to read-only.
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
Thank you for providing the commands to unlock the files. I am still trying to find the proper file to change so host file changes are permanent. I can easily change the hosts file and NFS works after that but, anytime you reboot, FreeNas simply over writes it. The FreeNas developers really need to make an easy way to add local network IP addresses to the hosts file. Older versions seem to have that capability but I couldn't find that anywhere in 8.04 p2.

Thanks for all your help PaleoN!
 

paleoN

Wizard
Joined
Apr 22, 2012
Messages
1,403
Thank you for providing the commands to unlock the files. I am still trying to find the proper file to change so host file changes are permanent.
Try looking under:
Code:
/conf/base/etc
If it's not there then it's probably generated directly from the database.
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
You are correct, /conf/base/etc, is the location of the hosts file used by FreeNas to write the /etc/hosts file. Once I changed the permission to read write on the USB, I could add my laptop IP to the /conf/base/etc/hosts file. After changing the usb back to read only and rebooting, the etc/hosts file contained the changes I made.

My laptop quickly mounts the NFS share now!! Thanks again for all your help.
 
J

James

Guest
Just to add to this thread: 8.3 addresses this issue by adding a "Host name database" field to Network ->Global Configuration.
 

ByteTamer

Dabbler
Joined
May 10, 2012
Messages
17
That is good news! When I started this thread I was in the testing phase of my home backup plan. I have since upgraded to 8.2.x and I am currently expanding my backup to 3 home computers making FreeNAS my on site backup. I currently have 4 x 2TB hard drives in Raid1 configuration. FreeNAS is now my "live" backup solution. I still have an off site backup solution in place as well.

I look forward to the 8.3.x release to make it easier to backup my Ubuntu laptop.
 
Status
Not open for further replies.
Top