autofs 服务程序是 linux 系统守护进程 , 当检测到用户试图访问一个尚未挂载的文件系统时候 , 将自动挂载该文件系统
yum install -y autofs
systemctl start autofs # 开启服务
systemctl enable autofs # 开机启动
Created symlink from /etc/systemd/system/multi-user.target.wants/autofs.service to /usr/lib/systemd/system/autofs.service.
ll /misc/cd # 光盘内容
total 686
-rw-rw-r--. 1 root root 14 Nov 26 2018 CentOS_BuildTag
drwxr-xr-x. 3 root root 2048 Nov 26 2018 EFI
-rw-rw-r--. 1 root root 227 Aug 30 2017 EULA
-rw-rw-r--. 1 root root 18009 Dec 10 2015 GPL
drwxr-xr-x. 3 root root 2048 Nov 26 2018 images
drwxr-xr-x. 2 root root 2048 Nov 26 2018 isolinux
drwxr-xr-x. 2 root root 2048 Nov 26 2018 LiveOS
drwxrwxr-x. 2 root root 663552 Nov 26 2018 Packages
drwxrwxr-x. 2 root root 4096 Nov 26 2018 repodata
-rw-rw-r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-7
-rw-rw-r--. 1 root root 1690 Dec 10 2015 RPM-GPG-KEY-CentOS-Testing-7
-r--r--r--. 1 root root 2883 Nov 26 2018 TRANS.TBL
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 20G 0 disk
├─sda1 8:1 0 1000M 0 part /boot
└─sda2 8:2 0 18.6G 0 part
├─centos-root 253:0 0 9.8G 0 lvm /
├─centos-swap 253:1 0 2G 0 lvm [SWAP]
└─centos-data 253:2 0 6.9G 0 lvm /data
sr0 11:0 1 4.3G 0 rom /misc/cd # 挂载光盘