1

I am creating a NFS share. I've configured the NFS server and also the NFS client.

My share was working perfectly fine until yesterday and now I found out it doesn't work.

I redid all the steps of NFS configuration and it still doesn't work.

My problem is that when I try to access my mount folder using cat /mnt/nfs1.txt (which was working perfectly fine until yesterday), nothing appears on the screen. And it looks like it is hanged or it collapsed.

root@ela-native:~# cat /mnt/nfs1.txt

After this nothing appears on the screen and also I have to close the terminal to quit.

What am I doing wrong?

Edit1

The following are the steps in my configurations for the nfs:

NFS server:

sudo apt-get install nfs-kernel-server

sudo mkdir /var/nfs/general

sudo nano /etc/exports

  /var/nfs/general *(rw,sync,no_root_squash,no_subtree_check)

sudo exportfs -a

sudo service nfs-kernel-server start

NFS client:

sudo apt-get install nfs-common

sudo mount 172.21.215.101:/var/nfs/general /mnt

And also if i run mount -t nfs, i get this:

root@ela-native:/home/salini# mount -t nfs
172.21.215.101:/var/nfs/general on /mnt type nfs (rw,vers=4,addr=172.21.215.101,clientaddr=192.168.164.78)

I also tried showmount -e 172.21.215.101 i got

clnt_create: RPC: Port mapper failure - Timed out 

Edit2

And the i tried less /var/log/boot.log in the server machine and according to my understanding, i think that there is some error with the nfs server.

[ESC[0;1;31mFAILEDESC[0m] Failed to start Automatically refresh installed snaps.


 [ESC[0;1;31mFAILEDESC[0m] Failed to mount /mnt/nfs/var/nfs.
    See 'systemctl status mnt-nfs-var-nfs.mount' for details.
   [ESC[0;1;33mDEPENDESC[0m] Dependency failed for Remote File Systems.
             Starting Permit User Sessions...
             Starting LSB: VirtualBox Linux kernel module...
             Starting LSB: Set the CPU Frequency Scaling governor to "ondemand"...
             Starting LSB: Speech Dispatcher...
             Starting LSB: automatic crash report generation...
             Starting LSB: Apache2 web server...
             Starting LSB: daemon to balance interrupts for SMP systems...
    [ESC[0;32m  OK  ESC[0m] Mounted /mnt/nfs/home.

What is the problem here?

Edit3

I did sudo ufw status numbered and sudo netstat -nlp | grep :111. I got this:

root@wsm-ela-inc6:/home/test# sudo ufw status numbered
Status: active

     To                         Action      From
     --                         ------      ----
[ 1] 514/tcp                    ALLOW IN    Anywhere                  
[ 2] 514/udp                    ALLOW IN    Anywhere                  
[ 3] 514/tcp (v6)               ALLOW IN    Anywhere (v6)             
[ 4] 514/udp (v6)               ALLOW IN    Anywhere (v6)             

root@wsm-ela-inc6:/home/test# sudo netstat -nlp | grep :111
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      3062/rpcbind    
tcp6       0      0 :::111                  :::*                    LISTEN      3062/rpcbind    
udp        0      0 0.0.0.0:111             0.0.0.0:*                           3062/rpcbind    
udp6       0      0 :::111                  :::*                                3062/rpcbind    

Edit4

I did :

sudo ufw allow from 192.168.1.0/24 to any port 2049

sudo ufw allow from 192.168.1.0/24 to any port 111

And I tried again for showmount but then again the terminal give me this

clnt_create: RPC: Port mapper failure - Timed out

Also I tried sudo service portmap restart and i got portmap: unrecognized service. Also i tried sudo service statd restart, it went well. Then again i tried showmount but still the same problem.

Edit5

I also tried netstat and got this:

    tcp        0      0 wsm-ela-inc6.csez:52630 maa03s29-in-f2.1e:https ESTABLISHED
tcp        0      0 wsm-ela-inc6.csez.z:nfs wsm-ela-inc6.csez.z:890 ESTABLISHED
tcp        0      0 wsm-ela-inc6.csez:34388 stackoverflow.com:https ESTABLISHED
tcp        0      0 wsm-ela-inc6.csez:35504 maa05s06-in-f8.1e:https TIME_WAIT  
tcp        0      0 wsm-ela-inc6.csez.z:890 wsm-ela-inc6.csez.z:nfs ESTABLISHED
tcp        0      0 wsm-ela-inc6.csez:39524 maa03s22-in-f2.1e:https TIME_WAIT  
tcp        0      0 wsm-ela-inc6.csez:shell 192.168.164.78:58982    ESTABLISHED
tcp        0      0 wsm-ela-inc6.csez:34414 stackoverflow.com:https ESTABLISHED
tcp        0      0 wsm-ela-inc6.csez:34438 stackoverflow.com:https ESTABLISHED
  • 1
    We can't say what you're doing wrong since you haven't said what you're doing (with regards to the NFS configuration). The NFS server is obviously not responding properly, so you should start investigating log files. If you restart the NFS server, make sure to unmount the NFS share on the client first (if possible), then remount it. – Kusalananda Jun 13 '18 at 7:48
  • i tried to unmount it and it gu=ives me this umount: /var/nfs/general: not found – Lublaut Jun 13 '18 at 7:51
  • I also tried showmount -e 172.21.215.101 i got clnt_create: RPC: Port mapper failure - Timed out – Lublaut Jun 13 '18 at 7:52
  • The mount on the client is /mnt, not /var/nfs/general. That's why you get that error from umount. – Kusalananda Jun 13 '18 at 8:08
  • Could you please explain your last comment @Kusalananda – Lublaut Jun 13 '18 at 8:13
0

I figured out that by disabling the firewalls on both the client and the server, the mount and showmount commands works just fine.

I've tried disabling the firewalls on server and client, and it's all sprung into life. Generally, if client and server are not on the same trusted network, running NFS between them isn't a great idea - not least because it doesn't play with dumb firewalls very well. If they are on the same trusted network, then a more blanket permit on each system for input traffic from the other will probably keep things working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.