The so-called trigger mount, in simple terms, is used when it is automatically mounted, when it is not used to mount. It is generally not used for 5 minutes after automatic mounting and will be uninstalled automatically.
Trigger mount depends on the AutoFS service, AutoFS is a daemon, when using a file, automatically support the system, not used is not supported.
still remember The Magical Catalogue CD under the/misc? I believe many beginners will be impressed with it. Now let's unlock the veil and create a "stealth" guy.
To implement trigger mounts, the main thing to know about two of its configuration files:
--/etc/auto.master
--/etc/ auto.xxx (this xxx is the name that he takes)
First,/etc/auto.master.
There are only two items in this file:
1. Parent directory, is the upper directory of the Mount point, also known as the Monitoring point directory;
2. Mount the path to the configuration file, which is the path to the next configuration file.
Next is/etc/auto.xxx (this file path is actually the second content in the last file)
There are three items in this file:
1. Sub-directory, which is the mount point, this directory does not need to be created
2. File system type, which is the file system used for the mounted device
3. Path to mount the device
Example:
1. Format/DEV/SDB2 as a EXT3 file system
[email protected] ~]# MKFS.EXT3/DEV/SDB2
To facilitate subsequent validation of the results, manually mount the partition, create a folder in the partition, and then uninstall
[email protected] ~]# mount/dev/sdb2/opt
[Email protected] ~]# cd/opt
[[email protected] opt]# ls
Lost+found
[Email protected] opt]# mkdir test
[[email protected] opt]# ls
Lost+found Test
[Email protected] ~]# UMOUNT/DEV/SDB2
2. Then the partition/DEV/SDB2 configuration trigger mount (monitoring/access point set to/misc/tools)
[email protected] ~]# Vim/etc/auto.master
/misc/etc/auto.test(This content is written by itself, you can find a line)
[email protected] ~]# vim/etc/auto.test
TOOLS-FSTYPE=EXT3:/dev/sdb2
[[Email protected] ~]# service autofs Restart (restart AutoFS services)
Stop automount: [OK]
Start AutoMount: [OK]
3. Visit/misc/tools to see if there is a document on the partition/DEV/SDB2
[email protected] ~]# Cd/misc
[[email protected] misc]# ls
[Email protected] misc]# CD Tools
[[email protected] tools]# ls
Lost+found Test
4. Check the mounted file system to view the trigger Mount results
[email protected] tools]# Mount | grep sdb2
/DEV/SDB2 on/misc/tools type ext3 (rw)
Note: When writing the configuration file, do not write the wrong letter. When writing the second file, pay attention to the file system type do not forget "-", the device path do not forget ":"
If you do not understand where you can contact me, discuss with each other, but also hope that the great God of criticism, thank you!
Contact information:
qq:532366096
Mail:[email protected]
This article is from the "Genesis Sky" blog, please be sure to keep this source http://erick0608.blog.51cto.com/9089824/1535087