linux nfs挂载时报错,SuSE linux NFS挂载失败案例处理:mount.nfs: access denied

1. 环境描述

NFS server和NFS client操作系统版本:

bidw2:~ # cat /etc/SuSE-release

SUSE Linux Enterprise Server 11 (x86_64)

VERSION = 11

PATCHLEVEL = 1

bidw2:~ # uname -a

Linux bidw2 2.6.32.59-0.7-default #1 SMP 2012-07-13 15:50:56 +0200 x86_64 x86_64 x86_64 GNU/Linux

2. NFS client挂载时出现错误

bidw2:~ # mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 192.168.142.60:/filedir /filedir

mount.nfs: access denied by server while mounting 192.168.142.60:/filedir

经确认过,防火墙都是关闭的,网络是正常的:

bidw2:~ # showmount -e 192.168.142.60

Export list for 192.168.142.60:

/filedir 192.168.142.*

在NFS server的messages日志中有这样的提示:

Sep 24 12:57:37 bidw1 mountd[17400]: refused unmount request from 192.168.142.61 for /filedir (/filedir): unmatched host

Sep 24 12:57:55 bidw1 mountd[17400]: refused mount request from 192.168.142.61 for /filedir (/filedir): unmatched host

NFS server的/etc/exports配置如下:

bidw1:~ # cat /etc/exports

/filedir 192.168.142.*(rw,no_root_squash,sync)

这种配置,我在SuSE 10 sp1/sp2的系统中都做过配置,NFS都是可以正常使用的,也可以正常挂载,为什么到了SuSE 11后就不行了呢?

3. 解决办法

根据以往碰到这类问题的经验,我将NFS server的配置调整为:

bidw1:~ # cat /etc/exports

/filedir 192.168.142.0/24(rw,no_root_squash,sync)

然后重启了下NFS server:

bidw1:~ # rcnfsserver restart

再次在NFS client中进行挂载NFS时,发现挂载成功了:

bidw2:~ # mount -t nfs -o rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,timeo=600,actimeo=0 192.168.142.60:/filedir /filedir

bidw2:~ # df -h

Filesystem Size Used Avail Use% Mounted on

/dev/sda1 127G 43G 78G 36% /

devtmpfs 109G 5.0M 109G 1% /dev

tmpfs 64G 26G 38G 42% /dev/shm

/dev/sda3 30G 309M 28G 2% /home

/dev/sda2 50G 498M 47G 2% /opt

/dev/sda6 50G 18G 30G 37% /opt/oracle

192.168.142.60:/filedir

1.5T 316G 1.1T 23% /filedir

总结:

或许在SuSE 11系统中,已经不能使用通匹符*做匹配了,只能做精确匹配,或时使用192.168.142.0/24做网段匹配。

-- Bosco  QQ:375612082

---- END ---- ------------------------------------------------------------------------------------------------------- 版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值