centos7挂载nas盘报错mount.nfs: rpc.statd is not running but is required for remote locking

centos7挂载nas盘报错信息如下:

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

解决办法:需要安装nfs-utls包,并且开启rpcbind服务。
其中rpcbind是一个RPC服务,主要是在nfs共享时候负责通知客户端,服务器的nfs端口号的。

命令如下:

# centos 7
yum install nfs-utils
systemctl enable rpcbind
systemctl start rpcbind
systemctl enable nfs-server
systemctl start nfs-server

# 然后可以正常进行挂盘
mount -o nolock -t nfs 172.20.0.1:/infoshare_1t /apps/data/

# 挂盘完成别忘了在/etc/fstab添加配置,否则服务器重新启动你挂的盘就看不到了,需要重新挂
172.20.0.1:/infoshare_1t /apps/data    nfs     defaults        0 0

你可能感兴趣的:(linux)