安装nfs:

#sudo apt-get install nfs-kernel-server

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

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

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

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

/home/kevin:要共享的目录

* :允许所有的网段访问

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设定

命令执行情况如下:

kevin@ubuntu:~$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

kevin@ubuntu:~$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 ]

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

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

注:localhost为本机linux的IP地址

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

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

我在开发板上使用的挂载命令:

mount -t nfs -o nolock 192.168.1.8:/home/kevin /mnt

ubuntu12.04的NFS配置的更多相关文章

  1. (转)Ubuntu12.04上NFS Server安装使用过程

    原文链接:Ubuntu12.04上NFS Server安装使用过程 实现步骤: 1.服务器端:sudo apt-get install portmap2.服务器端:sudo apt-get insta ...

  2. ubuntu12.04下NFS链接开发板并测试交叉编译的第一个应用

    思路:配置网络->安装NFS->配置NFS->挂载NFS服务->Down文件执行.Okay lets go! 配置网络: 在配置网络之前,首先咱得搞定与开发板的交互工作,那么这 ...

  3. ubuntu12.04的vim配置

    ubuntu12.04中使用的vim的版本不支持像语法高亮和文件类型检测等配置 #sudo apt-get install vim vim默认的配置使用起来还不能让人满意,还需要自己配置默认配置文件是 ...

  4. UBUNTU12.04下安装配置体验gnome3

    年. ubuntu12.04默认采用unity界面,但是自己更加喜欢gnome3的操作方式. 安装gnome3: sudo apt-get install  gnome-shell 其实安装成功后,注 ...

  5. ubuntu12.04安装搜狗输入法配置,安装packettracer字体设置,软件推荐

    装上系统,后的各种配置,各种出错之后的解决. 一.安装搜狗输入法 如果系统以前安装了先卸载: sudo apt-get remove fcitx* #删除配置文件 sudo apt-get purge ...

  6. ubuntu12.04 安装和配置jdk1.7

    第一步:下载jdk-7-linux-i586.tar.gz wget -c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586 ...

  7. Ubuntu12.04安装并配置Sublime Text 2

    Ubuntu是个好系统,Sublime Text 是个好编辑器. 下载&安装 个人习惯喜欢到官网下载软件,http://www.sublimetext.com/2 选择合适的包下载回来的格式是 ...

  8. 阿里云ubuntu12.04环境下配置Apache+PHP+PHPmyadmin+MYsql

    此教程中使用的相关IP等设置,在你的环境中要做相应修改. 使用之前更新apt-get,因为服务器基本上是一个裸系统 apt-get update;apt-get upgrade; 1 我们使用root ...

  9. ubuntu12.04 dnw2 fl2440 配置

    1.安装libusb-dev sudo apt-get install libusb-dev 2.dnw2编译配置 源码如下,将其保存为dnw2.c 编译命令 gcc dnw2.c -o dnw2 - ...

随机推荐

  1. uint8与double,二维矩阵显示灰度图

    double型0~1对应uint8型0~255,转换用im2double和im2uint8 如果直接用uint8(double型),则为0~1的uint8型数据,图像全黑. 处理数据过程推荐用doub ...

  2. Django中使用Bootstrap

    一.在Django中引用Bootstrap模版 1.首先下载bootsrtap代码(http://v3.bootcss.com/getting-started/#download),并将下载后的文件放 ...

  3. 转Delphi中Memo显示行号列号

    http://www.alonely.com.cn/Delphi/20160814/8912.html 实例说明本例是个光标应用的简单技巧,希望通过这个例子的学习后能举一反三.Delphi中像这样简单 ...

  4. C# 几个特殊运算符的理解和Nullable<T> 的研究

    可空值类型和?运算符 谈到运算符,大家一定很熟悉,但是对所有的运算符都能掌握吗? 看了下面代码再回答. Nullable<Int32> count = ; ; bool? flag = f ...

  5. A - 小彭玉的扫荡食堂计划

    A - 小彭玉的扫荡食堂计划 Time Limit: 20000/10000MS (Java/Others)    Memory Limit: 128000/64000KB (Java/Others) ...

  6. URL匹配与req参数解析

    通配URL*(可代表任何字符串) 例如: app.get('/test/*', function(req, res){ res.send(req.query.aa); }) '/test/*通配tes ...

  7. 恢复SQLSERVER被误删除的数据(转)

    恢复SQLSERVER被误删除的数据 曾经想实现Log Explorer for SQL Server的功能,利用ldf里面的日志来还原误删除的数据 这里有一篇文章做到了,不过似乎不是所有的数据类型都 ...

  8. First blogs start

    这是我第一次写博客笔记,为了更好的成长,从现在开始我的博客记录. 我是从事linux运维的,到目前为止,已经有2年的工作经验了. 希望从此以后我能够坚持每天记录下点点滴滴.

  9. javaWEB总结(6):ServletRequest

    1.首先看ServletRequest的API javax.servlet Interface ServletRequest All Known Subinterfaces: HttpServletR ...

  10. mb_detect_encoding() 运行sitemap.php 字符编码不能转换修改php.ini

    1.phpinfo() 找php.ini位置 2.备份然后 php.ini文件中顶部添加extension=php_mbstring.dll Call to undefined function mb ...