Fedora 17 x64如何配置nfs服务

测试环境:

[root@tp system]# uname -a
Linux tp 3.3.4-5.fc17.x86_64 #1 SMP Mon May 7 17:29:34 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

配置nfs exports:

vim /etc/exports

/run/media/k/Elements/unzip/ora11gR2forLinux64 192.168.221.0/24(rw,sync,no_root_squash)

激活exports,可直接用exportfs刷新或者重启服务:

1. exportfs刷新:

[root@tp system]# exportfs -avf
exporting 192.168.221.0/24:/run/media/k/Elements/unzip/ora11gR2forLinux64
2. 重启服务:
[root@tp system]# systemctl restart nfs-server.service

查看本机共享出的nfs文件夹:

[root@tp system]# showmount -e
Export list for tp:
/run/media/k/Elements/unzip/ora11gR2forLinux64 192.168.221.0/24

换台机器挂载nfs文件夹:

[root@rac1 ~]# mount -t nfs 192.168.221.1:/run/media/k/Elements/unzip/ora11gR2forLinux64 /mnt
[root@rac1 ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/VolGroup00-LogVol00
188G 2.7G 176G 2% /
/dev/sda1 99M 23M 71M 25% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm
/dev/sr0 3.6G 3.6G 0 100% /media
192.168.221.1:/run/media/k/Elements/unzip/ora11gR2forLinux64
932G 806G 127G 87% /mnt
[root@rac1 ~]#


注意问题:

1. 检查配置没有问题后,仍无法发现nfs共享,可以先临时关闭防火墙(systemctl stop iptables.service)和SELINUX(setenforce 0),再试试看。

2. 客户机上能发现nfs共享,并且可以成功mount,但是没有权限列出mount后的目录,需要加no_root_squash到nfs exports选项里,这样客户机能以root权限来查看nfs共享文件夹。

man exports

root_squash
Map requests from uid/gid 0 to the anonymous uid/gid. Note that
this does not apply to any other uids or gids that might be
equally sensitive, such as user bin or group staff.

no_root_squash
Turn off root squashing. This option is mainly useful for disk‐
less clients.


REF:

1. Fedora 17 - NFS Server : Server World

http://www.server-world.info/en/note?os=Fedora_17&p=nfs

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值