我正在尝试在 centos 7.2 服务器上挂载 NFS 卷:
当我尝试挂载 NFS 共享点时,这是我得到的响应:
[root@web1:~] #mount -t nfs nfs1.example.com:/var/nfs/home /home
mount.nfs: an incorrect mount option was specified
Run Code Online (Sandbox Code Playgroud)
我检查过,我已经nfs-utils-1.3.0-0.21.el7.x86_64在两台机器上安装了。nfs 客户端和 nfs 服务器操作系统都是 Centos 7.2
为了解决这个问题,我将 NFS 服务器上 /etc/exports 文件中的列表缩减为以下内容:
/var/nfs/home web1.example.com(rw,sync,no_root_squash,no_all_squash)
Run Code Online (Sandbox Code Playgroud)
如果我showmount从服务器执行 a我试图挂载 nfs 共享,这就是我看到的:
[root@web1:~] #showmount -e nfs1.example.com
Export list for nfs1.example.com:
/var/nfs/home web1.example.com
Run Code Online (Sandbox Code Playgroud)
如果我这样做,mount -v这就是我得到的:
[root@web1:~] #mount -v -t nfs nfs1.example.com:/var/nfs/home /home
mount.nfs: timeout set for Fri Jan 13 11:04:19 2017 mount.nfs: trying text-based options 'vers=4,addr=162.xxx.xxx..94,clientaddr=162.xxx.xxx.6'
mount.nfs: mount(2): Invalid argument mount.nfs: an incorrect mount option was specified
Run Code Online (Sandbox Code Playgroud)
在 dmesg 我发现:
[44428.405419] nfsd: last server has exited, flushing export cache
Run Code Online (Sandbox Code Playgroud)
我在 dmesg 中看到了这个:
[ 7.373186] FS-Cache: Netfs 'nfs' registered for caching
[ 7.422181] Key type dns_resolver registered
[ 7.456581] NFS: Registering the id_resolver key type
[ 7.462309] Key type id_resolver registered
[ 7.462386] Key type id_legacy registered
[ 7.514441] SELinux: initialized (dev 0:40, type nfs4), uses genfs_contexts
[ 8.474503] NFSD: starting 90-second grace period (net ffffffff819a29c0) –
[ 16.952180] perf samples too long (2623 > 2500), lowering kernel.perf_event_max_sample_rate to 50000
[ 24.429251] SELinux: initialized (dev tmpfs, type tmpfs), uses transition SIDs
[ 38.368207] perf samples too long (5162 > 5000), lowering kernel.perf_event_max_sample_rate to 25000
[ 38.427323]
Run Code Online (Sandbox Code Playgroud)
-t nfs在命令中未指定会产生相同的结果:
[root@nfs1:~] #mount nfs1.example.com:/var/nfs/home /home
mount.nfs: an incorrect mount option was specified
Run Code Online (Sandbox Code Playgroud)
这些是我拥有的 nfs 文件系统:
[root@nfs1:~] #grep nfs /proc/filesystems
nodev nfsd
nodev nfs
nodev nfs4
Run Code Online (Sandbox Code Playgroud)
以下是为 nfs 加载的模块:
[root@nfs1:~] #lsmod | grep ^nfs
nfsv4 474203 0
nfs 241266 1 nfsv4
nfsd 284378 13
nfs_acl 12837 1 nfsd
Run Code Online (Sandbox Code Playgroud)
这不是防火墙问题,因为当我从 NFS 服务器本身运行 mount 命令时,我得到了完全相同的失败。它得到与它的客户相同的错误。
我应该强调一下,这曾经工作得很好。但是现在已经坏到不能用了。
有人可以帮我解决这个问题吗?我真的被困在这一点上。
小智 5
今天遇到同样的问题。我nfsvers在寻找解释时偶然发现了选项。安装与nfsvers=3和一起使用nfsvers=4。不过,我很乐意提供更详细的解释。
root@localhost:~# uname -rm
4.1.15 armv7l
root@localhost:~# mount -t nfs 10.0.0.5:/srv/nfs tmp
mount.nfs: an incorrect mount option was specified
root@localhost:~# mount -t nfs -o nfsvers=1 10.0.0.5:/srv/nfs tmp
mount.nfs: mount system call failed
root@localhost:~# mount -t nfs -o nfsvers=2 10.0.0.5:/srv/nfs tmp
mount.nfs: requested NFS version or transport protocol is not supported
root@localhost:~# mount -t nfs -o nfsvers=3 10.0.0.5:/srv/nfs tmp
root@localhost:~# mount -t nfs -o nfsvers=4 10.0.0.5:/srv/nfs tmp
root@localhost:~#
Run Code Online (Sandbox Code Playgroud)
最后两个命令成功。
| 归档时间: |
|
| 查看次数: |
50399 次 |
| 最近记录: |