fedora 24 nfs 服务器搭建

来源:互联网 发布:c语言打印等腰杨辉三角 编辑:程序博客网 时间:2024/05/21 22:40

fedora 24 nfs 服务器搭建


安装启动NFS服务
安装NFS服务

#dnf install nfs-utils*

# dnf install portmap


关闭Fedora默认的防火墙,

#systemctl stop firewalld

# service iptables stop   (即时生效,重启后失效)

#chkconfig iptables off    (重启后生效)


启用NFS服务# systemctl enable nfs-server.service
ln -s '/lib/systemd/system/nfs-server.service''/etc/systemd/system/multi-user.target.wants/nfs-server.service'


检查NFS服务是否被启用

# systemctl is-enabled nfs-server.service

enabled


配置需要nfs导出的文件:

#vi /etc/exports

/home/lindp/samba 192.168.111.100(insecure,rw,sync,no_root_squash)    (共享路径)


启动NFS服务# systemctl start nfs-server.service
或者用service命令# service nfs-server restart
Redirectingto /bin/systemctl restart nfs-server.service


查看NFS服务状态# systemctl status nfs-server.service
nfs-server.service- NFS Server
Loaded:loaded (/lib/systemd/system/nfs-server.service; enabled)
Active:active (running) since Sun, 29 Apr 2012 11:08:59 +0800; 1min 46s ago

本地测试# showmount -e 192.168.0.117 测试结果:


# mount -t 192.168.0.117: (空格)/root/rootfs /mnt/nfs

出现错误1:

对于最后一个错误:mount.nfs : access denied by server whilemounting

192.168.0.117:     /root/Work,根据网址:

http://liuzhigong.blog.163.com/blog/static/17827237520115305226932/

修改配置文件/etc/exports,加入 insecure 选项

/root/rootfs *(insecure,rw,sync,no_root_squash)

# mount -t nfs192.168.0.117:/root/rootfs /mnt

出现error:mount.nfs:Connection timed out

Slove:http://bbs.chinaunix.net/thread-4121859-1-1.html:关闭防火墙

http://bbs.csdn.net/topics/360017569

关闭Fedora默认的防火墙,#systemctl stop firewalld:

使用## mount -t nfs –o tcp192.168.0.117:/root/rootfs /mnt/nfs

#Mount –t nfs –onolock 192.168.1.104:/root/rootfs /mnt/nfs

通过df -h 查看:

参考网站:http://my.oschina.net/davisqi/blog/76124

http://blog.chinaunix.net/uid-9679478-id-4145508.html

卸载:

# umount /mnt

注意:每次修改过 /etc/exports 文件内容之后都要重启NFS服务。经过本地showmount测试,重新挂载。

设置开发板:

要想ARM开发板和pc机能够建立网络共享,必须将ARM开发板与PC通过网线连接起来

并且设置ARM开发板和pc机在同一网段内,我们可以用一下命令查看和修改ARM开发板

IP地址:

Ifconfig //查看以太网Ip地址,

Ifconfig eth0(端口名) (ip地址1)//该ip地址1要与PC机ip处在同一网段中。

测试:ping (PC机ip地址),查看是否能够ping通

注意:1,#systemctlstop firewalld

2,开启nfs服务

3测试nfs

2,在主机上测试

3,在目标机上mount

Arm开发板和PC机挂接:

使用如下命令:

Mount –t nfs –o nolock192.168.1.104:/root/rootfs /mnt/nfs


# service iptables stop


0 0
原创粉丝点击