1. Introduction to autofs service When we use Linux, if we want to access hardware resources, we need to use the mount command to mount the hardware resources and correspond them to a directory before we can access and use the storage medium. If you use samba or NFS services, you also need to mount the remote storage device. Mounting is a necessary step to use external storage media or file systems. However, if too many resources are mounted, it will cause a certain load on network resources and server resources, thereby reducing server performance. 2. Autofs installation and deploymentAutofs can be installed using yum. The installation command is as follows: yum install -y autofs The main configuration file of the autofs service is /etc/auto.master. After opening it, you need to write the format in the main configuration file: Destination mount directory Sub-configuration file of the mount directory For example, if we want to mount /dev/cdrom to the /mnt directory, we need to write the following content: The red line part is the newly written content. Then create the /etc/cdrom.misc file and write the following content: iso -fstype=iso9600,defaults :/dec/cdrom Among them, iso represents the sub-mount directory under this directory. After completing all the above operations, start the autofs service. Sometimes the autofs service is configured to start automatically. The autofs startup command is as follows: systemctl start autofs The autofs startup command is as follows: systemctl enable autofs 3. Autofs effect verificationNext, let's verify the effect of the previously configured autofs. The verification idea is as follows: When it is not mounted, try to access the mount directory to see whether the autofs system process mounts automatically. The verification process is as follows: It can be seen that the system did not mount /dev/cdrom originally, but when we accessed the /meida/iso directory, the system automatically mounted it. Obviously, the autofs service ran successfully! This is the end of this article about the Linux Autofs automatic mounting service installation and deployment tutorial. For more relevant Linux Autofs automatic mounting service content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Div exceeds hidden text and hides the CSS code beyond the div part
>>: How to use the debouce anti-shake function in Vue
Six effectsImplementation Code html <h1>CSS...
<br />Although there are many web page creat...
Discuz! Forum has many configuration options in th...
Table of contents The creation and confusion of n...
Preface I recently installed MySQL 5.7 and found ...
@vue+echarts realizes the flow effect of China ma...
1. Uninstall the JDK that comes with centeros fir...
Table of contents 2. Comma operator 3. JavaScript...
Effect picture (the border color is too light, pu...
Table of contents 3 ways to deploy projects with ...
Swarm Cluster Management Introduction Docker Swar...
Problem [root@zh ~]# [root@zh ~]# [root@zh ~]# yu...
Introduction to MySQL logical architecture Overvi...
Everyone knows that data in MySQL needs to be wri...
1. Download https://dev.mysql.com/downloads/mysql...