1.nfs

net file system

nfs-utils

2.nfs的启用

yum install nfs-utils -y
systemctl start nfs-server
systemctl enable nfs-server
systemctl stop firewalld

测试

在客户端

showmount -e 172.25.254.123
Export list for 172.25.254.123
服务之--nfs

3.配置共享

vim /etc/exports
本机目录 共享客户端(共享方式)
/nfsdir *(sync) ##所用人(同步)
/nfsdir 172.25.254.0/24(sync) ##网段(同步)
/nfsdir 172.25.254.223(rw,anonuid=1001,anongid=1001,no_root_squash) ##网址(读写权限,uid=1001,gid=1001,随用户uid,gid(前两个失效))
(all_squash )
服务之--nfs

exportfs -rv ##重启服务

4.自动挂载

在客户端

yum install autofs -y
systemctl start autofs
systemctl enable autofs
systemctl stop firewalld

实现半自动挂载
cd /net
cd 172.25.254.123
cd nfsdir
df
服务之--nfs

实现自动挂载
vim /etc/auto.master
8 /mnt /etc/auto.nfs
服务之--nfs
vim /etc/auto.nfs
westos -ro,vers=3.0 172.25.254.123:/nfsdir
服务之--nfs

设置自动取消挂载时间
vim /etc/sysconfig/autofs
TIMEOUT=3
cd ##退出等待取消挂载

相关文章:

  • 2022-01-05
  • 2021-09-07
  • 2021-11-28
  • 2021-10-29
猜你喜欢
  • 2021-11-09
  • 2022-02-11
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案