现在的位置: 首页 > 综合 > 正文

使用Vagrant在Windows平台搭建嵌入式Linux开发环境(3)nfs服务器搭建

2017年11月18日 ⁄ 综合 ⁄ 共 1214字 ⁄ 字号 评论关闭

转载地址:http://blog.csdn.net/dlutxie/article/details/8634707


目的:在开发板的linux系统访问宿主系统(PC机)的文件,这样方便将宿主系统的文件传到开发板中。PS:也可以通过tfp传。

宿主系统:x86PC机, unbuntu9.04   (作为NFS服务器)

开发板:OMAP4ubuntu12.04(为NFS客户端)

条件:宿住系统和开发板在同一个局域网内或者宿主机有公网IP

 

1. PC机端安装NFS服务器,同时安装客启端方便测试

sudo apt-get installnfs-kernel-server  nfs-common  portmap

2、配置挂载目录和权限

vim/etc/exports

配置如下:

#/etc/exports: the access control list for filesystems which may be exported
#  to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync)hostname2(ro,sync)
#
# Example for NFSv4:
#/srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt)
# /srv/nfs4/homes  gss/krb5i(rw,sync)

/home/nfsroot   *(rw,sync)

解释如下:

/home/nfsbootNFS的共享目录,*表示任何IP都可以共享这个目录,你可以改为受限的IPrw表示的是权限,sync是默认的。

另外如果还有其它读写权限问题,那就:chmod 777 /home/nfsroot  

3、重启NFS服务

 sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务

4.测试( 172.3.32.119PC机的IP)

sudo mount 172.3.32.119:/home/nfsroot   /mnt/tmp

执行:df  -h查看挂载情况

5.在开发板上安装NFS客启端

sudo apt-get install  nfs-common

6. 挂载(172.3.32.119PC机即NFS服务端的IP

sudo mount 172.3.32.119:/home/nfsroot   /home/nfs

注意:如果挂载不成功,请先ping 172.3.32.119看开发板是否能通过网络连接上PC机,如果不行,那请先检测网络!!

 

参考:http://blog.163.com/lucien_cc/blog/static/130290562201022073634446/

http://linux.chinaunix.net/techdoc/system/2009/02/06/1060861.shtml

 

抱歉!评论已关闭.