#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

转载于:https://www.cnblogs.com/liulipeng/p/3386353.html

ubuntu12.04的NFS配置相关推荐

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

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

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

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

  3. ubuntu12.04安装及配置过程详解1

    http://wenku.baidu.com/view/f8bc1d29453610661ed9f4a3.html

  4. ubuntu12.04 kermit 权限配置

    安装完kermit后,每次直接执行kermit都会提示"/dev/ttyUSB0: Permission denied": gouwa@lurk:~$ kermit ?OpenSS ...

  5. Ubuntu12.04安装配置Theano

    上次写了一个关于DL的开篇内容,本来说是要继续跟进的,后来教研室里面出了一些事情,加上写论文.和隔壁教研室做实验,就一直拖到现在.早就让小K配置环境研究研究Theano,这货和我一样也发拖延症了,理由 ...

  6. 树莓派和Ubuntu12.04配置无线连接与无线AP热点

    转载自:http://laoniangke.com/pi/2013/06/29/pi-wifi-ap.html 下面是一个英文帖子,应该是原帖,推荐看原帖: https://learn.adafrui ...

  7. ubuntu12.04嵌入式开发环境搭建(各种问题、各种配置)

    ubuntu-12.04嵌入式开发环境搭建 先安装ubuntu-16.04  *** 想使用root用户登陆的,操作如下 给root用户设定一个密码 supreme@supreme:~# sudo p ...

  8. Ubuntu12.04 Jdk1.7 Tomct7.0部署配置

    Ubuntu12.04 Jdk1.7 Tomct7.0部署配置 jdk1.7 下载 http://download.oracle.com/otn-pub/java/jdk/7u67-b01/jdk-7 ...

  9. ubuntu-12.04下TQ2440 NFS挂载

    平台:2440 vmware 6 ,ubuntu12 转载至:http://dreamlcr.cublog.cn/ mount -t nfs -o intr,nolock,rsize=1024,wsi ...

最新文章

  1. jQuery插件之-selectList
  2. Postfix+Amavisd-new+Spamassassin+ClamAV整合安装
  3. mysql 数据库系统开发_MySQL------数据库系统概述
  4. 64位cad commondialog添加_常用软件分享PDF转CAD软件
  5. 认证拦截功能需求分析
  6. Spring 中的编程思想总结
  7. python去掉字符串最外侧的引号_疯狂Python讲义第二章读书笔记
  8. pvrect r语言 聚类_R语言实现KEGG通路富集可视化
  9. HTML只言片语网站导航模板
  10. 【Flink】Flink ES6写入报错 IncompatibleClassChangeError: Implementing class
  11. WAP 的组成及主要特点
  12. 1656. Far Away Kingdom's Army
  13. SpringCloud-Gateway网关
  14. jquery ligerui php,jQuery LigerUI操作表格
  15. NH2-UiO-66,CAS:1260119-00-3
  16. watchOS7.2新增“心适能功能” 监测和分类心肺适能水平
  17. c语言kbhit函数6,C语言中kbhit()函数怎么复位
  18. 第10章两个独立样本的t检验
  19. linux搭建天地伟业easy7,easy7视频监控系统客户端|天地伟业easy7监控客户端简洁版(Easy7 Smart Client Express)下载 V7.12 官方版 - 比克尔下载...
  20. StackFrame

热门文章

  1. Android开发笔记(一百零五)社会化分享SDK
  2. Spring是如何注解的
  3. Spark团队开源新项目MLflow发布0.2版本,内置TensorFlow集成
  4. 2017.11.24
  5. 笔记16(shell编程)
  6. Java基础(二):基本数据类型和变量类型
  7. 需要注意的一些Mysql语句
  8. 关闭rhel 6.5的selinux
  9. 多线程-Threading
  10. POJ3264Balanced Lineup(线段树)