大网数据广告活动
服务器运维问答

Mounting hangs the terminal

· 52CE 我爱测

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 d…

问题原文

原帖链接 · Lublaut · CC BY-SA 4.0

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.

Now that I've did umount, I couldn't do mount. The terminal just hangs!!

Help please.

已采纳解答

原帖链接 · MadHatter · CC BY-SA 4.0

You'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 client and server 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-06-14)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。