今天用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
先是:
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$
mount.nfs4: 192.168.1.177:/share failed, reason given by server: Nosuch file or directory
这就奇怪了,明明有文件有目录,怎么会视而不见呢?
原来针对NFS4,exports需要一个新的参数fsid,
如我的exports:
/home/bee
查看exports的帮助:
bee@Thinkpad-x201:~$man exports
fsid=num|root|uuid