首页 > 其他分享 >mount nfs4 ....No such file or directory

mount nfs4 ....No such file or directory

时间:2023-03-10 19:13:59浏览次数:41  
标签:exports No .... mount mnt nfs filesystem fsid

转载自:

https://zhuanlan.zhihu.com/p/434209418

https://blog.csdn.net/yusiguyuan/article/details/11515715

 

============

 

# 安装nfs-utils rpcbind
yum -y install nfs-utils rpcbind

# 创建nfs目录
mkdir -p /nfs/data/

# 编辑export文件 # vim /etc/exports
/nfs/data *(rw,fsid=0,no_root_squash,sync)

# 使得配置生效
exportfs -r

 

# 查看生效
exportfs

 

# 启动rpcbind、nfs服务
systemctl start rpcbind && systemctl enable rpcbind   #端口是111
systemctl start nfs && systemctl enable nfs           # 端口是 2049 

 

# 查看rpc服务的注册情况
rpcinfo -p localhost

# showmount测试
showmount -e ip(ip地址)

 

=====================

 

今天用nfs的时候遇到奇怪的问题:

先是:
bee@Thinkpad-x201:/mnt$ sudo mount 192.168.1.177:/share/mnt/test/
mount.nfs: access denied by server while mounting192.168.1.177:/share

发现是nfs版本的问题,我是通过apt-get install安装的nfs,估计是更新到了nfs v4版本,所以需要加上特殊的参数-t nfs4

但加上-t nfs4参数后server没有拒绝,但是却又有一个错误:
bee@Thinkpad-x201:/mnt$
sudo mount -t nfs4192.168.1.177:/share /mnt/test/
mount.nfs4: 192.168.1.177:/share failed, reason given by server: Nosuch file or directory

这就奇怪了,明明有文件有目录,怎么会视而不见呢?

原来针对NFS4,exports需要一个新的参数fsid,
如我的exports:

/home/bee *(rw,fsid=0,sync,no_root_squash)

 

查看exports的帮助:
bee@Thinkpad-x201:~$man exports


fsid=num|root|uuid
NFS needs to be able to identify each filesystem that it
exports. Normally it will use a UUID for thefilesystem (if the
filesystem has such a thing) or the device number ofthe device
holding the filesystem (if the filesystem is stored onthe
device).

As not all filesystems are stored on devices, and not all
filesystems have UUIDs, it is sometimes necessaryto explicitly
tell NFS how to identify a filesystem. Thisis done with the
fsid= option.

For NFSv4, there is a distinguished filesystem which is theroot
of all exported filesystem. This is specifiedwith fsid=root or
fsid=0 both of which mean exactly the same thing.

Other filesystems can beidentified with a small integer, or a
UUID which should contain 32 hex digits and arbitrary punctua‐
tion.

Linux kernels version 2.6.20and earlier do not understand the
UUID setting so a small integer must be used ifan fsid option
needs to be set for suchkernels. Setting both a small number
and a UUID is supported so the same configuration can be madeto
work on old and new kernels alike.


在exports增加fsid这个key word后,
bee@Thinkpad-x201:~$exportfs -r
bee@Thinkpad-x201:/mnt$ sudo mount -t nfs4192.168.1.177:/share /mnt/test/
bee@Thinkpad-x201:/mnt$

OK了......

标签:exports,No,....,mount,mnt,nfs,filesystem,fsid
From: https://www.cnblogs.com/hd92/p/17204436.html

相关文章

  • RuoYi-Cloud gen服务启动成功后报错dynamic-datasource can not find primary datasou
    转:RuoYi-Cloud新建子服务启动成功后报错dynamic-datasourcecannotfindprimarydatasourcemybatis报错Errorqueryingdatabase.Cause:com.baomidou.dynamic.datas......
  • Ignored pom.xml
      产生原因:由于相同名称的module在之前被创建过(之前创建过这个相同名称的模块又删除了),因此在IDEA中留有痕迹。重新创建一个新的同名module会让IDEA误以为是之前被删除......
  • gnutls_handshake() failed: The TLS connection was non-properly terminated.
    重置代理完美解决gitconfig--global --unsethttps.https://github.com.proxy gitconfig--global --unsethttp.https://github.com.proxy ......
  • 银河麒麟KylinV10安装openoffice4.1.14
    使用步骤1.下载openoffice建议去官网下载,这里给出官网地址:https://www.openoffice.org/download/2.安装openoffice2.1、在cd/usr/local目录下创建openoffce文件夹......
  • P1038 [NOIP2003 提高组] 神经网络
     https://www.luogu.com.cn/problem/P1038 #include<iostream>#include<queue>#include<vector>#include<cstring>usingnamespacestd;constintN=104,......
  • P1540 [NOIP2010 提高组] 机器翻译
    P1540[NOIP2010提高组]机器翻译[NOIP2010提高组]机器翻译题目背景小晨的电脑上安装了一个机器翻译软件,他经常用这个软件来翻译英语文章。题目描述这个翻译软件的......
  • nodeBB 论坛系统安装配置
    nodeBB开源论坛系统安装配置参考官方文档:https://docs.nodebb.org/installing/os/ubuntu/一、安装1.1准备Ubuntu操作系统安装Ubuntu20.044GB内存硬盘300GB......
  • Node全局对象介绍
    在学习Javascript之初,会接触一个概念:JS由三部分组成,DOM+BOM+ECMAScript。其中前两者是宿主环境,也就是浏览器所提供的能力。后者才是JS语言本身的标准。在上篇文章......
  • seata can not get cluster name in registry config please make sure registry conf
    问题描述使用seata1.6.1,配合dubbo3,以及nacos22023-03-1012:11:15ERRORio.seata.core.rpc.netty.NettyClientChannelManager181reconnect-cannotgetclusternam......
  • 【notes】Multimedia
     数据表示感知与获取:例如声波通过振膜和电磁铁的磁极,得到模拟信号,模拟信号经过采样和量化得到数字信号。连续的灰度值经过量化得到0-255的整数值。听觉媒体:Definition......