系统平台:virtualbox3.2.10+ubuntu10.10

安装nfs:

#sudo apt-get install nfs-kernel-server

ubuntu10.10中的已经是最新版本了,无需安装

打开/etc/exports文件,在末尾加入:

/home/xgc *(rw,sync,no_root_squash)

注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义如下:

/home/xgc:要共享的目录

* :允许所有的网段访问

rw :读写权限

sync:资料同步写入内在和硬盘

no_root_squash:nfs客户端共享目录使用者权限

重启服务:
#sudo /etc/init.d/portmap restart                <---重启portmap,很重要
#sudo /etc/init.d/nfs-kernel-server restart      <---重启nfs服务
#showmount -e                                    <---显示共享出的目录

注:nfs是一个RPC程序,使用它前,需要映射好端口,通过portmap设定

命令执行情况如下:

xgc@xgc-VirtualBox:~$ sudo /etc/init.d/portmap restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service portmap restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the restart(8) utility, e.g. restart portmap
portmap start/running, process 474

xgc@xgc-VirtualBox:~$ sudo /etc/init.d/nfs-kernel-server restart
 * Stopping NFS kernel daemon                                         [ OK ] 
 * Unexporting directories for NFS kernel daemon...                   [ OK ] 
 * Exporting directories for NFS kernel daemon...

exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/home/xgc".
  Assuming default behaviour ('no_subtree_check').
  NOTE: this default has changed since nfs-utils version 1.0.x
                                                                    [ OK ]
 * Starting NFS kernel daemon                                       [ OK ]

xgc@xgc-VirtualBox:~$ showmount -e
Export list for xgc-VirtualBox:
/home/xgc *

现在可以在本机上试一下:
#sudo mount -t nfs localhost:/home/xgc /mnt

注:localhost为本机linux的IP地址

这样就把共享目录挂到了/mnt目录,取消挂载用:
#sudo umount /mnt

如果用在嵌入式设备上挂载,要加上参数-o nolock

NFS文件系统搭建

Ubuntu主机IP地址:192.168.1.101 
开发板Ip地址:192.168.1.6 
参考网址:http://blog.chinaunix.net/uid-22030783-id-366815.html

流程: 
1、安装NFS文件系统: 
#sudo apt-get install nfs-kernel-server

2、打开/etc/exports文件,在末尾加入: 
/home/mike/learn201511/nfs *(rw,sync,no_root_squash) #前提是你必须的创建该路径[/home/mike/learn201511/nfs] 
注:nfs允许挂载的目录及权限,在文件/etc/exports中进行定义,各字段含义如下: 
/home/xgc:要共享的目录 
* :允许所有的网段访问 
rw :读写权限 
sync:资料同步写入内在和硬盘 
no_root_squash:nfs客户端共享目录使用者权限

3、重启服务: 
#sudo /etc/init.d/portmap restart <—重启portmap,很重要 
#sudo /etc/init.d/nfs-kernel-server restart <—重启nfs服务 
#showmount -e <—显示共享出的目录

上面安装可能会出错,注意下面提示的错误信息,权限问题:chmod 777 -R /var/lib/nfs/etab
Exporting directories for NFS kernel daemon...
exportfs: could not open /var/lib/nfs/etab for locking
exportfs: can't lock /var/lib/nfs/etab for writing

4、在ubuntu上测试: 
#sudo mount -t nfs localhost:/home/mike/learn201511/nfs /mnt 
注:localhost为本机linux的IP地址 
这样就把共享目录挂到了/mnt目录,取消挂载用: 
#sudo umount /mnt

5、在开发板上挂载: 
[root@EmbedSky /]# mount -o nolock -t nfs 192.168.1.101:/home/mike/learn201511/nfs /mnt 
#192.168.1.101 为主机(UBUNTU)系统的IP地址 
#/home/mike/learn201511 为上面网址中创建的NFS文件系统

为了使用NFS进行调试。需要安装NFS server,具体的流程在上一篇博文中有较为详细的介绍。在配置内核时需要做如下的操作: 
 
 
 
对于Boot option中的处理,可以不用写在env.txt配置也是可以的。 
baudrate=115200 
bootargs=noinitrd console=ttyS0,115200 root=/dev/nfs nfsroot=129.1.5.109:/home/collector/nuc970bsp/rootfs_48 bootm 0x7FC0 ip=129.1.5.107:129.1.5.109:129.1.5.109:255.255.255.0 rdinit=/sbin/init mem=64M; bootcmd=tftp 0x7FC0 970uimage; 
bootcmd=tftp 0x7FC0 970uimage ;bootm 0x7FC0 
bootdelay=3 
ethact=emac 
ethaddr=00:00:00:33:66:98 
gatewayip=129.1.88.1 
ipaddr=129.1.5.107 
netmask=255.255.255.0 
serverip=129.1.5.109 
stderr=serial 
stdin=serial 
stdout=serial 
写到这儿,过几天我还会通过修改这个文件,实现USB更新内核,文件系统的功能,在这儿先卖个关子。 
东西不难,也都是我从数据手册里拷贝的,但是时间久了,自己忘得连个思路都没有,怕不怕,惊不惊悚?从小历史学的就不好….没办法。

NUC972配置为支持NFS的更多相关文章

  1. cinder支持nfs快照

    [问题描述] cinder后端设置为NFS,磁盘创建快照失败. 日志里面发现了这个错误: VolumeDriverException: Volume driver reported an error: ...

  2. Cluster基础(一):配置iSCSI服务、编写udev规则、配置并访问NFS共享、部署Multipath多路径环境

    一.配置iSCSI服务 目标: 本案例要求先搭建好一台iSCSI服务器,并将整个磁盘共享给客户端: 虚拟机添加新的磁盘 将新添加的磁盘分区并创建两个逻辑卷 逻辑卷名称分别为:/dev/myvg/isc ...

  3. 配置samba和NFS共享服务

                            配置samba和NFS共享服务 1案例1:配置SMB文件夹共享 1.1问题 本例要求在虚拟机server0上发布两个共享文件夹,具体要求如下: 此服务器 ...

  4. 基于Spring的可扩展Schema进行开发自定义配置标签支持

    一.背景 最近和朋友一起想开发一个类似alibaba dubbo的功能的工具,其中就用到了基于Spring的可扩展Schema进行开发自定义配置标签支持,通过上网查资料自己写了一个demo.今天在这里 ...

  5. ubuntu 配置TFTP和NFS

    1.安装软件包 sudo apt-get install tftpd tftp xinetd 2.建立配置文件 在/etc/xinetd.d/下建立一个配置文件tftp sudo vi /etc/xi ...

  6. 使用HttpClient发送HTTPS请求以及配置Tomcat支持SSL

    这里使用的是HttpComponents-Client-4.1.2 package com.jadyer.util; import java.io.File; import java.io.FileI ...

  7. nginx配置pathinfo支持,最佳方案 - chunyu

    〇. 前言 pathinfo有两个,1 pathinfo()函数,2 $_SERVER['PATH_INFO'].pathinfo()是php的库函数,原生支持不需要nginx配置,$_SERVER[ ...

  8. 配置chrome支持本地(file协议)ajax请求

    将html代码拖拽进入chrome通过file协议浏览时,发送的ajax请求本地文件,会报跨域错误. XMLHttpRequest cannot load file:///E:/webs/extJS/ ...

  9. Ubuntu14.04配置Apache支持多个站点

    怎样在一个Ubuntu的机器上(虚拟机)配置Apache支持多个网站呢? 比如你有一台独立的Ubuntu虚拟机,配有一个外网的IP(45.46.47.48),并且注册了两个域名AAA.com和BBB. ...

随机推荐

  1. MYSQL查询前30条数据

    , LIMIT 接受一个或两个数字参数. 参数必须是一个整数常量. 如果给定两个参数,第一个参数指定第一个返回记录行的偏移量, 第二个参数指定返回记录行的最大数目. 初始记录行的偏移量是 (而不是 )

  2. Union和Union All的区别[转]

    来源:http://blog.csdn.net/wanghai__/article/details/4712555/ 假设我们有一个表Student,包括以下字段与数据: drop table stu ...

  3. 第三百二十八节,web爬虫讲解2—urllib库爬虫—状态吗—异常处理—浏览器伪装技术、设置用户代理

    第三百二十八节,web爬虫讲解2—urllib库爬虫—状态吗—异常处理—浏览器伪装技术.设置用户代理 如果爬虫没有异常处理,那么爬行中一旦出现错误,程序将崩溃停止工作,有异常处理即使出现错误也能继续执 ...

  4. /var/log/messages Logging not working on Centos 7

    This was the solution, not permanent, though: rm -f /var/lib/rsyslog/imjournal.state systemctl resta ...

  5. remove docker ce fully on centos7

    在centos7上用curl 安装了docker ce版本 删除的方法是 $ sudo yum -y remove docker-ce

  6. Git log和git reflog

    1.git log  log命令可以显示所有提交过的版本信息.显示信息如下: $ git log commit e1bdff6e4830e09383078c860f45334d03771b03 (HE ...

  7. [转]Apache 监听端口失败,selinux惹的祸

    原文在此 CentOS 下启动Httpd 失败,报 (13)Permission denied: make_sock: could not bind to address [::]:8000 因为 小 ...

  8. window.frames[]在Firefox下无法兼容的解决方式

    html代码段: <iframe id="fr" src="ProjectTree.aspx?IsFree=true&f=yes&IsCheckPr ...

  9. keynote代码高亮【转】

    码农即使做ppt,也离不开代码,在keynote下,如果要粘贴代码,如何做到语法高亮呢? 补充1,该功能由pygments提供支持,所以支持的语言见:http://pygments.org/langu ...

  10. 本地文件到通过flume到kafka

    配置文件 cd /usr/app/flume1.6/conf vi flume-dirKakfa.properties #agent1 name agent1.sources=source1 agen ...