NFSv4 挂载在 Ubuntu 20.04 上工作正常,但在 RHEL 8.6 上失败

NFSv4 挂载在 Ubuntu 20.04 上工作正常,但在 RHEL 8.6 上失败

我有一个 NFSv4 服务器,它是 RHEL 7.9 机器。我们的 Ubuntu 20.04 机器可以毫无问题地从该服务器挂载共享。现在我正在设置 RHEL 8.6 机器,但它无法挂载共享,并出现错误“没有这样的文件或目录”。

服务器上的 /etc/exports 文件是:

/opt/exports      127.0.0.1(rw,sync, fsid=0, crossmnt, no_subtree_check)   10.10.3.83(rw,sync, fsid=0, crossmnt, no_subtree_check)   10.10.3.70(rw,sync, fsid=0, crossmnt, no_subtree_check)   10.10.3.52(rw,sync,  no_root_squash,  no_subtree_check)
/opt/exports/syst 127.0.0.1(rw,sync,  no_root_squash,  no_subtree_check)   10.10.3.83(rw,sync,  no_root_squash,  no_subtree_check)   10.10.3.70(rw,sync,  no_root_squash,  no_subtree_check)   10.10.3.52(rw,sync,  no_root_squash,  no_subtree_check)
/syst             127.0.0.1(rw,sync,  no_root_squash,  no_subtree_check)   10.10.3.83(rw,sync,  no_root_squash,  no_subtree_check)   10.10.3.70(rw,sync,  no_root_squash,  no_subtree_check)   10.10.3.52(rw,sync,  no_root_squash,  no_subtree_check)

[为了演示/清晰度而添加的空格。]

这个挂载命令在我们的 Ubuntu 机器上运行良好:

# mount -vvv -t nfs4 -o proto=tcp,port=2049 syst-1:/syst /syst
mount.nfs4: timeout set for Mon Jun  6 19:13:21 2022
mount.nfs4: trying text-based options 'proto=tcp,port=2049,vers=4.2,addr=10.10.3.22,clientaddr=10.10.3.52'
mount.nfs4: mount(2): No such file or directory
mount.nfs4: mounting syst-1:/syst failed, reason given by server: No such file or directory

showmount 命令正确显示导出,因此我知道该部分有效:

# showmount --exports syst-1
Export list for syst-1:
/syst             10.10.3.52,10.10.3.70,10.10.3.83,127.0.0.1
/opt/exports/syst 10.10.3.52,10.10.3.70,10.10.3.83,127.0.0.1
/opt/exports      10.10.3.52,10.10.3.70,10.10.3.83,127.0.0.1

只是为了踢球和咯咯笑,我尝试过:

# mount -vvv -t nfs4 -o proto=tcp,port=2049 syst-1:/opt/export/syst /syst
# mount -vvv -t nfs4 -o proto=tcp,port=2049 syst-1:/        /syst

具有相同的结果。的目标目录/syst确实存在,我已将其删除并重新创建它,以防万一我不小心用隐藏字符或其他内容创建了它。出于绝望,我也尝试重新启动客户端和服务器。我已将必要的端口添加到防火墙,甚至尝试暂时禁用防火墙。服务器的正向和反向 DNS 解析正确。日志中没有错误,但我还没有研究是否可以设置更详细的日志记录。

我还尝试删除多余的/syst(导出文件中的第三行);不用找了。

我已经用 Google 搜索了很多次,但我发现的结果要么是不同的问题,要么是我已经设置的内容(例如导出文件第一行中的 fsid=0)。

答案1

叹息......在我发表这篇文章之前检查了所有细节,但我错过了最重要的部分。我想说 RHEL 客户端的参数是从其他客户端复制的并且是相同的。

也许我被打扰了,也许我决定测试一些东西。可能是两者的结合。

不管怎样,问题是 RHEL 客户端参数中缺少 fsid=0 语句。

相关内容