Ubuntu挂载nfs文件系统出错:mount.nfs: Connection timed out。
一、问题描述。
在挂载Ubuntu下的文件夹时,出现如下错误。
ms@ubuntu:/mnt$ sudo mount -t nfs -o nolock 198.168.1.20:/mnt/nfs /mnt/nfs/
mount.nfs: Connection timed out
ms@ubuntu:/mnt$
二、问题分析。
网络文件系统,英文Network File System(NFS),是由SUN公司研制的UNIX表示层协议(presentation layer protocol),能使使用者访问网络上别处的文件就像在使用自己的计算机一样。造成上述问题,其中可能的两原因,一是网络不通,二是未安装NFS服务。
三、解决方案。
1、先确认网络是通的,通过ping命令进行测试。
2、安装 Ubuntu NFS 服务,命令如下。若还是不行,可尝试安装nfs-common和portmap。
sudo apt-get install nfs-kernel-server -y