zoukankan      html  css  js  c++  java
  • ubuntu 下安装nfs

    1. 安装nfs服务,设置nfs主目录

    tom@ubuntu:/$ sudo mkdir -p /source/rootfs/

    tom@ubuntu:/$ sudo chmod -R 777 /source

     tom@ubuntu:/~$ sudo apt-get install nfs-kernel-server

    2. 编辑/etc/exports ,配置nfs

    tom@ubuntu:/tftpboot$ sudo vim /etc/exports

    1 /etc/exports: the access control list for filesystems which may be exported to NFS clients. See exports(5).
    2 # Example for NFSv2 and NFSv3:
    3 # /srv/homes   hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
    4 # Example for NFSv4:
    5 # /srv/nfs4     gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
    6 # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
    7 /source/rootfs/   *(rw,sync,no_subtree_check,no_root_squash)

    3. 重启nfs服务

    tom@ubuntu:/tftpboot$ 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...                        [ OK ]
     * Starting NFS kernel daemon                                            [ OK ]

    4. 挂载nfs共享目录

    tom@ubuntu:/$ sudo mount -t nfs  192.168.0.108:/source/rootfs ~/nfs

    5. 卸载共享目录

    tom@ubuntu:~$ sudo umount ~/nfs/

  • 相关阅读:
    MySQL数据库设计规范
    Docker安装redis
    Go-用本地时间解析时间字符串
    Docker安装mysql
    docker安装es
    Json官网文档
    leetcode题目和解答集合
    76. 最小覆盖子串
    165. 比较版本号
    958. 二叉树的完全性检验
  • 原文地址:https://www.cnblogs.com/minuse/p/3270816.html
Copyright © 2011-2022 走看看