Pho*_*rce 5 linux networking nfs mount
我正在尝试将目录从我的服务器挂载到我的本地机器上。这是因为我想编辑目录并执行文件,而不必在每次编辑后手动将文件推送到服务器。
当我尝试从同一网络上的机器挂载时,我正在使用 NFS 并且当前得到:“连接被拒绝”。
我的服务器 IP 是 192.168.0.12。
我的本地机器ip是192.168.0.2。而在/etc/exports
我有:
/mnt/export 192.168.0.0/24(rw,async,no_subtree_check)
/mnt/export *(rw)
Run Code Online (Sandbox Code Playgroud)
/mnt/export
我要挂载的目录在哪里,我有chmod 777 -r
目录
在我的本地机器上,我执行这个命令:
mount 192.168.0.12:/mnt/export /Desktop/tes
Run Code Online (Sandbox Code Playgroud)
但是得到这个错误:
can't mount /mnt/export from 192.168.0.12 onto /Desktop/tes:
Connection refused
Run Code Online (Sandbox Code Playgroud)
有谁知道我哪里出错了?
您可以从客户端测试其中的一些内容。rpcinfo 有助于告诉您 rpc 调用是否正在发送到服务器进程,然后您可以专门检查 mountd,最后,showmount 将询问服务器导出了哪些卷:
$ rpcinfo -p nfsserv103 | cut -c30- | sort -u
mountd
nfs
nlockmgr
portmapper
rquotad
status
$ rpcinfo -u nfsserv103 mountd
program 100005 version 1 ready and waiting
program 100005 version 2 ready and waiting
program 100005 version 3 ready and waiting
$ showmount -e nfsserv103
Export list for nfsserv103:
/ 10.221.253.101,10.221.252.101,10.221.253.100,10.221.252.100
/mnt_foo/bar (everyone)
Run Code Online (Sandbox Code Playgroud)
(请注意,第一个命令中的“cut”只是为了使输出更简洁。您可以删除除第一个命令之外的所有内容。)