#gedit /etc/exports
编辑nfs 服务的配置文件(注意:第一次打开时该文件是空的),添加以下内容:
/opt/abc/123 *(rw,sync,no_root_squash)
其中:
/opt/abc/123 表示将要共享的的目录,它可以作
为开发板的根文件系统通过nfs 挂接;
* 表示所有的客户机都可以挂接此目录
rw 表示挂接此目录的客户机对该目录有读写的权力
no_root_squash 表示允许挂接此目录的客户机享有该主机的root 身份
,但默认安装的Fedora 系统开启了防火墙,这会导致NFS 服务
无法正常使用。因此先关闭防火墙,在命令行输入“lokkit”命令
选择其中(*)Disabled,然后选择“OK”退出,这样就永久的关闭了防火墙。
下面是启动 NFS 服务的方法和步骤:
(1)通过命令启动和停止nfs 服务
在命令行下运行:
#/etc/init.d/nfs start
这将启动nfs 服务,可以输入以下命令检验nfs 该服务是否启动。
# mount -t nfs localhost:/opt/abc/123 /mnt/
如果没有出现错误信息, 您将可以浏览到/mnt 目录中的内容和
/opt/FriendlyARM/mini6410/root_qtopia_qt4 是一致的。
使用这个命令可以停止 nfs 服务:
#/etc/init.d/nfs stop
(2)通过图形界面启动NFS 服务
为了在每次开机时系统都自动启动该服务,可以输入
# serviceconf
打开系统服务
2. 修改/etc/hosts.allow
sshd:ALL
portmap:192.168.10.0/255.255.255.0:allow
portmap:ALL:deny
nfsd:192.168.10.0/255.255.255.0
3. 启动Fedora 9 nfs server
[root@localhost v2.0]# service nfs start.如果在启动之后需要修改exports,可以exportfs -rv重新输出.
4. 可以在本机测试[root@localhost v2.0]# mount -t nfs 192.168.10.6:/pub /var/nfs
5. 在目标板上运行.下面是我第一次在目标板上运行的结果,查询了之后发现是防火墙的问题.
[root@falinux ~]$ mount -t nfs -o nolock 192.168.10.6:/home/leffy/edfa/v2.0 /mnt/win
mount: RPC: Unable to receive; errno = No route to host
mount: nfsmount failed: Bad file descriptor
mount: Mounting 192.168.10.6:/home/leffy/edfa/v2.0 on /mnt/win failed: Bad file descriptor
6. 关闭防火墙[root@localhost v2.0]# service iptables stop[root@localhost v2.0]# service iptables statusiptables: Firewall is not running.
可以看到防火墙已经半闭以上Fedora 9 nfs系统介绍.
沒有留言:
張貼留言