|
auto自动挂载
autofs与mount/umount不同之处:他是一种守护进程,当用户访问了未挂载的目录,会自动挂载
安装autofs服务:
[iyunv@CnBlogs ~]# yum -y install autofs
Installed:
autofs.x86_64 1:5.0.7-40.el7
Dependency Installed:
hesiod.x86_64 0:3.2.1-3.el7
Complete!
启动服务并且加入到开机启动项:
[iyunv@CnBlogs ~]# systemctl start autofs
[iyunv@CnBlogs ~]# systemctl enable autofs.service
ln -s '/usr/lib/systemd/system/autofs.service' '/etc/systemd/system/multi-user.target.wants/autofs.service'
[iyunv@CnBlogs ~]#
修改autofs主配置文件:
(挂载目录 映射配置文件)
[iyunv@CnBlogs ~]# vim /etc/auto.master
/media /etc/iso.misc
编辑挂载配置文件参数(映射文件):
[iyunv@CnBlogs ~]# vim /etc/auto.misc
iso -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
重新启动服务:
[iyunv@CnBlogs ~]# systemctl restart autofs.service
验证:
[iyunv@CnBlogs ~]# cd /media/iso
[iyunv@CnBlogs iso]# df -hT
/dev/sr0 iso9660 3.5G 3.5G 0 100% /media/iso
|
|
|
|
|
|
|