nfs自动挂载配置
[root@desktop01 auto.master.d]# cat demo.autofs 挂载配置第一步
/shares /etc/auto.demo 自动挂载 目录在client不存在 指定起始目录/shares
/- /etc/auto.direct 直接挂载 目录在client必须存在 指定起始目录/
[root@desktop01 ~]# cat /etc/auto.direct 第二步直接挂载配置
/mnt/public -rw,sync 172.21.10.36:/shares/public 直接挂载
/mnt/xxx -rw,sync 172.21.10.36:/shares/public1 直接挂载
[root@desktop01 work]# !v 第二步间接挂载配置
vim /etc/auto.demo
work -rw,sync 172.21.10.36:/shares/work 允许进入/shares/work
* -rw,sync 172.21.10.36:/shares/& 允许进入/shares/下的所有目录
服务器加载配置 exportfs -rv
客户端重启autofs
systemctl restart autofs
测试
showmount -e 172.21.10.36
showmount -e 172.21.10.36
Export list for 172.21.10.36:
/shares/public1 172.21.10.0/24
/shares/work1 172.21.10.0/24
/shares/public 172.21.10.0/24
/share