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/

  • 相关阅读:
    SpringBoot(一)_快速实战搭建项目
    maven入门 (二)_私服安装与上传下载
    maven入门(一)
    Ionic 2 开发(一)_安装与目录结构
    echarts添加点击事件
    win下 git gui 使用教程
    安装centos6.3
    PAT甲级题分类汇编——图
    PAT甲级题分类汇编——树
    PAT甲级题分类汇编——理论
  • 原文地址:https://www.cnblogs.com/minuse/p/3270816.html
Copyright © 2011-2022 走看看