Fedora19安裝配置NFS並連接開發板 zyl-1014-5-6
安裝啓動NFS服務
安裝NFS服務#yum install nfs-utils*#yum install portmap
關閉Fedora默認的防火牆,#systemctl stop firewalld
啓用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
/root/rootfs *(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