zoukankan      html  css  js  c++  java
  • ubuntu12.04下NFS安装

    1.nfs 安装

    #sudo apt-get install nfs-kernel-server

    2.编辑/etc/exports

    #sudo vi  /etc/exports

    加上下面这句
    /home/fred/nfsroot  *(rw,sync,no_root_squash)

    ps:路径可以自己定

    /home/fred/nfsroot  -- 与客户机共享的目录;
         *        -- 表示允许任意用户使用,也可以使用具体IP;
        (rw,sync,no_root_squash)  -- rw,挂载此目录的客户机对此目录有读写权利;
        sync,……;
        no_root_squash,挂载此目录的客户机享有主机root的权利;

    3.修改挂载点的访问权限
    chmod 777 /home/fred/nfsroot

    4.重启nfs(每一次修改exports都要重启nfs)
    #sudo /etc/init.d/nfs-kernel-server restart
    #sudo /etc/init.d/portmap restart

    #showmount -e 查看挂在目录

    5.测试

    在/home/fred/nfsroot下创建一个文件(空的就是看不见)

    #cd /home/fred/nfsroot

    #touch test

    现在可以在本机上试一下。

    #sudo mount -t nfs 127.0.0.1:/home/fred/nfsroot     /mnt(要挂的地方)

    #sudo ls -l /mnt/

    如果有test的话,就说明成功了。

    离开挂开目录:

    #sudo umount /mnt

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

     # mount  -t nfs 服务器IP:/home/fred/nfsroot    /mnt -o nolock

  • 相关阅读:
    合并ts文件
    Typora
    Typora
    OCMock 3 参考
    git 修改上次提交信息 与 撤销此操作.
    git使用技巧
    python获取软件安装列表2222
    【Dojo 1.x】笔记6 配置对象dojoConfig的用处和真身所在
    【Dojo 1.x】笔记目录
    【Dojo 1.x】笔记5 使用本地引用
  • 原文地址:https://www.cnblogs.com/chengliu/p/3636381.html
Copyright © 2011-2022 走看看