ubuntu12.04的NFS配置

时间:2023-01-31 14:43:06

安装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. &lpar;转&rpar;Ubuntu12&period;04上NFS Server安装使用过程

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

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

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

  3. ubuntu12&period;04的vim配置

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

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

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

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

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

  6. ubuntu12&period;04 安装和配置jdk1&period;7

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

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

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

  8. 阿里云ubuntu12&period;04环境下配置Apache&plus;PHP&plus;PHPmyadmin&plus;MYsql

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

  9. ubuntu12&period;04 dnw2 fl2440 配置

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

随机推荐

  1. 1&period;5&period;8 语言分析器&lpar;Analyzer&rpar;

    语言分析器(Analyzer) 这部分包含了分词器(tokenizer)和过滤器(filter)关于字符转换和使用指定语言的相关信息.对于欧洲语言来说,tokenizer是相当直接的,Tokens被空 ...

  2. apache 设置禁止访问某些文件或目录

    [apache配置禁止访问]1. 禁止访问某些文件/目录增加Files选项来控制,比如要不允许访问 .inc 扩展名的文件,保护php类库:<Files ~ "\.inc$" ...

  3. Windows Server 2008 R2安装IIS

    在"服务器管理器"中选择"添加角色".   在"服务器角色"步骤选择"Web 服务器(IIS)".   "角色 ...

  4. XML文件的解析方式

    XML文件4种解析方式分别是:DOM解析,SAX解析,JDOM解析,DOM4J解析.1.基础方法:DOM:与平台无关的官方的解析方式.SAX:Java平台提供的基于事件驱动的解析方式.2.扩展方法(在 ...

  5. cenots 下的 lamp&lpar;备份与恢复&rpar;

    用 putty连接数据库: mysql -uroot -p密码 create database yourdb DEFAULT CHARACTER SET utf8 COLLATE utf8_chine ...

  6. logstash 处理tomcat catalina&period;out

    input { file { type => "zj_api" path => ["/data01/applog_backup/zjzc_log/zj-api ...

  7. 【学习笔记】C&num; 抽象类

    抽象类 有时设计类仅仅为了表达抽象的概念,不与具体的事物相联系,只作为其派生类的基类使用,用来描述所有子类的共同特性,这时我们可以使用抽象类 抽象类不能被实例化,抽象类可以包含抽象方法 抽象方法 抽象 ...

  8. js中定义对象的几种方式

    转载:http://blog.sina.com.cn/s/blog_60f632050100wz7h.html (1)基于已有对象的扩充方法:适用于临时构建对象,弊端:每次构建对象都要新建一个. va ...

  9. js模拟form表单提交数据&comma; js模拟a标签点击跳转,避开使用window&period;open引起来的浏览器阻止问题

    js模拟form表单提交数据, js模拟a标签点击跳转,避开使用window.open引起来的浏览器阻止问题 js模拟form表单提交数据源码: /** * js模拟form表单提交 * @param ...

  10. Python运维开发基础05-语法基础【转】

    上节作业回顾(讲解+温习90分钟) #!/usr/bin/env python # -*- coding:utf-8 -*- # author:Mr.chen import os,time Tag = ...