一、安装
yum install autofs
二、配置目录的配置文件map
修改/etc/autofs.master
# 标记/var/ftp/pub目录的配置文件为/etc/auto.vsftpd # Sample auto.master file # This is an automounter map and it has the following format # key [ -mount-options-separated-by-comma ] location # For details of the format look at autofs(5). # #/misc /etc/auto.misc /var/ftp/pub /etc/auto.vsftpd
三、创建目录配置文件/etc/auto.vsftpd
vim /etc/auto.vsftpd #添加一行 iso6 -fstype=iso9660,ro,loop :/home/admin/Downloads/CentOS-6.5-x86_64-bin-DVD1.iso
注1:man 5 autofs获得帮助
注2:前述格式为:
A B C
mount到的目录 文件格式 被mount的(镜像)文件目录
四、重启服务
service autofs restart
转载于:https://blog.51cto.com/bananalighter/1426941