我的服务器上有两个NFS导出,它们在/etc/exports中配置相同。在我的NFS客户端上,一个总是用NFS-3自动挂载,另一个用NFS-4挂载。我要nfs-4。我怎样才能做到这一点?
在服务器上(“nina”):
# cat /etc/exports
/home 192.168.0.0/24(rw,no_all_squash,anonuid=1545,anongid=501)
/misc/fedora-backup 192.168.0.0/24(rw,no_all_squash,anonuid=1545,anongid=501)
# exportfs -arv
exporting 192.168.0.0/24:/misc/fedora-backup
exporting 192.168.0.0/24:/home关于客户:
$ ls /net/nina/home /net/nina/misc/fedora-backup
/net/nina/home:
bhepple data guest lost+found nina watched-files
/net/nina/misc/fedora-backup:
backup-copy lost+found media
$ mount |grep nfs
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime)
nina:/home on /net/nina/home type nfs4 (rw,nosuid,nodev,relatime,vers=4.2,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.0.104,local_lock=none,addr=192.168.0.19)
nina:/misc/fedora-backup on /net/nina/misc/fedora-backup type nfs (rw,nosuid,nodev,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.0.19,mountvers=3,mountport=20048,mountproto=udp,local_lock=none,addr=192.168.0.19)这两种都是最新的fedora-37系统。
编辑手动挂载也显示了错误:
sudo mount -t nfs4 nina:/misc/fedora-backup ~/tmp/mnt
mount.nfs4: mounting nina:/misc/fedora-backup failed, reason given by server: No such file or directory 如果我省略了-t nfs4,它就会挂载OK,但它只是nfs-3。
发布于 2023-01-30 23:07:44
在客户端查找选项vers。主挂载上有vers=4.2,备份上有vers=3。
此外,如果没有指定type nfs4或其别名nfsvers,则可以使用type nfs和vers来确定版本。
发布于 2023-01-31 06:25:10
看起来nfs4无法导出单独的目录--它们都需要嵌套在一起,可能需要使用绑定挂载来指向您想要的位置。
https://superuser.com/questions/362736/cant-mount-nfs4-share
https://unix.stackexchange.com/questions/733768
复制相似问题