安装 NFS server

mystery@lcw:~$ sudo apt-get install nfs-kernel-server 

  编辑/etc/exports,添加目标系统的根文件系统映射目录,假如目标系统的根文件系统最后映射到/home/mystery/nfs_files,则/etc/exports内容如下

/home/mystery/nfs_files *(subtree_check,rw,no_root_squash,async)    

  解释如下:

  • /home/mystery/nfs_files:映射目录
  • *:允许所以的主机挂载
  • subtree_check:子目录权限检查
  • rw:可读写
  • no_root_squash:无root权限
  • async:同步文件

重启服务

mystery@lcw:~$ sudo /etc/init.d/nfs-kernel-server restart
* Stopping NFS kernel daemon
...done.
* Unexporting directories for NFS kernel daemon...
...done.
* Exporting directories for NFS kernel daemon...
exportfs: Failed to stat /home/mystery/nfs_files: No such file or directory
...done.
* Starting NFS kernel daemon
...done. mystery@lcw:~$ sudo exportfs
/home/mystery/nfs_files
<world>
mystery@lcw:~$

  最好每修改过 /etc/exports 后都执行一次

测试NFS

  首先建立一个nfs测试的挂载点

mystery@lcw:~$ sudo mkdir /mnt/nfs
mystery@lcw:~$ ls /mnt/nfs/
mystery@lcw:~$  

  挂载NFS

mystery@lcw:~$ sudo mount 192.168.7.233:/home/mystery/nfs_files /mnt/nfs/ -t nfs
mystery@lcw:~$  

  测试下

mystery@lcw:~$ cd /mnt/nfs/
mystery@lcw:/mnt/nfs$ ls
mystery@lcw:/mnt/nfs$ touch test
mystery@lcw:/mnt/nfs$ ls
test
mystery@lcw:/mnt/nfs$ ls /home/mystery/nfs_files/
test
mystery@lcw:/mnt/nfs$

  OK,卸载

mystery@lcw:/mnt/nfs$ cd ..
mystery@lcw:/mnt$ sudo umount ./nfs/
mystery@lcw:/mnt$ cd nfs/
mystery@lcw:/mnt/nfs$ ls
mystery@lcw:/mnt/nfs$

【教程】ubuntu下安装NFS服务器的更多相关文章

  1. Ubuntu下安装nfs服务器

    安装 NFS 软件包在 ubuntu 终端输入下面命令安装 NFS 服务器:vmuser@Linux-host: ~$ sudo apt-get install nfs-kernel-server # ...

  2. Ubuntu下安装nfs,Windows下访问

    Linux 下: 1. 在终端输入  sudo apt-get install portmap nfs-common nfs-kernel-server 2.建立客户机访问目录  sudo mkdir ...

  3. ubuntu下安装ssh服务器方法

    由于xshell远程连接ubuntu是通过ssh协议的,所以,需要给ubuntu安装ssh服务器. 1)ubuntu安装ssh服务器 sudo apt-get install openssh-serv ...

  4. Linux下安装nfs服务器

    1. 安装nfs服务 $sudo apt-get install nfs-kernel-server portmap 2. 在配置文件/etc/exports中添加以下内容/home/jxhui/nf ...

  5. 【教程】ubuntu下安装samba服务器

    一.准备工作 首先更新 software sources, 找到最快的源 lcw@ubuntu:~$ sudo apt-get update 二.安装samba lcw@ubuntu:~$ sudo ...

  6. ubuntu下安装svn服务器

    sudo apt-get install apache2 sudo apt-get install subversion sudo apt-get install libapache2-svn 其次, ...

  7. ubuntu下安装ftp服务器

    参考文献: 5.4 FTP 服务器 vsftpd - FTP 服务器安装 vsftpd 是可在 Ubuntu 中使用的 FTP 守护程序之一.它在安装.设置和维护方面十分方便.要安装 vsftpd 您 ...

  8. Ubuntu下安装Samba服务器

    闲来无聊尝试自己安装下Samba服务器,使本机和虚拟机可以无障碍传输文件(虽然用VMwaretools可传,但总感觉麻烦,而且速度欠佳) 首先,同安装qemu一样,在安装之前要确定你的系统apt列表已 ...

  9. Ubuntu 下安装 nfs

    1先安装sudo apt-get install nfs-kernel-server(安装nfs-kernel-server时,apt会自动安装nfs-common和portmap) 分开看就是1.服 ...

随机推荐

  1. keras callback中的stop_training

    keras这个框架简洁优美,设计上堪称典范.而tensorflow就显得臃肿庞杂,混乱不清.当然,keras的周边部件比如callbacks.datasets.preprocessing有许多过度设计 ...

  2. GO语言中的几个关键思想

    GO语言的设计理念与C++,Java,Python之流大相径庭. 一.没有函数重载 GO语言里面没有函数重载,Java.C#.C++三位大牛都是支持函数重载的,Python虽然不支持函数重载,但是支持 ...

  3. Debug 路漫漫-02

    重现标准 BTL Model ,using MATLAB: 1. 错误使用 cat要串联的数组的维度不一致.出错 cell2mat (line 83) m{n} = cat(1,c{:,n}); —— ...

  4. Docker Dockerfile简述

    原文地址:https://www.cnblogs.com/cuimiemie/p/6442677.html 作用 Dockerfile的内容是一坨可以执行的代码(或者说是指令)(docker的DSL) ...

  5. php,perl计算crc

    PHP版: <?php echo getCrc32("/var/www/html/resource/koc_data/2013_03/01/1ck65e.koc") ; # ...

  6. iphone app的非appstore发布方法及其免越狱安装方法

    iphone app的非appstore发布方法及其免越狱安装方法   本文包含两项内容, 1.开发者如何将app导出为可供普通用户在外部安装的ipa文件. 2.用户使用itools来安装ipa格式的 ...

  7. oracle中exists和in的比较

    exists 是Oracle sql中的一个函数.表示是否存在符合某种条件的记录.如 select * from A,B where A.id=B.id and exists (SELECT * FR ...

  8. java时区转化相关工具方法

    import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.Date;import java. ...

  9. Fast Algorithm To Find Unique Items in JavaScript Array

    When I had the requirement to remove duplicate items from a very large array, I found out that the c ...

  10. hive splict, explode, lateral view, concat_ws

    hive> create table arrays (x array<string>) > row format delimited fields terminated by ...