㈢ 文件权限
对于一个文件的写入权限、需要满足:
(1)使用者账号,亦即 UID 的相关身份
(2)NFS 服务器允许有写入的权限
(3)文件系统确实具有 w 的权限
㈣ 2 个命令
① 在Client端使用:
showmount -e IP或主机名
查看可挂载的目录
② 在Server端使用:
重新配置/etc/exports后可用:
exportfs -avr
㈤ Troubleshoting
① 用户或客户端身份权限不符
[root@linux ~]# mount -t nfs localhost:/home/test /home/nfs
mount: localhost:/home/test failed, reason given by server: Permission denied
解决方案:
如果确定您的 IP 没有错误,那么请通知服务器端, 请管理员将你的 IP 加入 /etc/exports
② 服务器或客户端某些服务未启动:
[root@linux ~]# mount -t nfs localhost:/home/test /home/nfs
mount: RPC: Port mapper failure - RPC: Unable to receive
[root@linux ~]# mount -t nfs localhost:/home/test /home/nfs
mount: RPC: Program not registered
解决方案:
要嘛就是 portmap 忘记开,要嘛就是服务器端的 nfs 忘记开!解决的方法就是去启动这两个咚咚啦!
③ 被防火墙档掉了:
这个也很容易忘记了!那就是重新设定一下您的防火墙,这包含了两部份,包括 iptables 与 TCP_Wrappers !
因为我们启动了 portmap ,这个东西有两个数据需要分享出来,一个是 port 111 需要提供出去,
因此您的 iptables 规则当中,需要开放这个 port 喔
㈥ 经验建议
如果 NFS 在高速环境下运行的话、建议加上:
mount -t nfs -o nosuid,noexec,nodev,rw,bg,soft,rsize=32768,wsize=32768
