更新时间:2024-05-08 GMT+08:00
分享

安装NFS服务端和客户端

操作系统

CentOS Linux release 7.2.1511 (Core)

NFS服务端安装

yum install nfs-utils -y

  • 创建共享
    1. 在/etc/exports配置文件中添加以下内容,保存退出;
      /sfs-date/mnt-pro/lab 172.16.79.15/255.255.254.0(rw,sync,no_root_squash)

      或者

      /home 168.170.249.1/24(rw,sync,no_root_squash)

    1. 创建共享目录并给予写的权限
      mkdir /home/ITP/share
      chmod o+w /home/ITP/share

  • 启动NFS服务
    systemctl restart rpcbind
    systemctl restart nfs-server(nfs)
    systemctl enable rpcbind
    systemctl enable nfs-server(nfs)

NFS客户端安装

yum install nfs-utils -y

  1. 创建挂载目录
    mkdir -p /mnt/lab

  1. 挂载NFS共享
    mount -t nfs 59.68.143.78:/home/ITP/share /home/ITP/share

  1. 查看客户端挂载信息
    df -h
分享:

    相关文档

    相关产品