linxu如何创建NFS共享文件系统

服务端搭建nfs服务器

  1. yum -y install nfs-utils #yum安装nfs共享文件系统包

  2. 修改配置文件 vim /etc/exports
    /data 172.18.1.0/24(rw,no_root_squash,no_all_squash,sync) #允许哪些网段的人访问

    /data 172.18.4.0/24(rw,no_root_squash,no_all_squash,sync) #允许哪些网段的人访问

  3. 重启nfs服务
    systemctl restart nfs
    systemctl enable nfs

  4. 查看共享文件夹
    客户端操作
    1 yum -y install nfs-utils #安装nfs软件服务包
    2 mount -t nfs 172.18.1.228:/data /data 临时挂载
    3.永久挂载 写入/etc/fstab
    172.18.1.228:/data /data nfs rw,soft,intr 0 0

  5. mount -a 开始挂载&& df -h 查看有没有挂载成功
    在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43546282/article/details/83503551
今日推荐