Mount the disk/dev/sdb with autofs to the/data/abc directory. Add a new disk and restart it. [Root @ localhost ~] # To trigger mounting, reboot requires editing two files. Edit the/etc/auto. master file. You can refer to the system's default trigger Mount editing in the file. First, write the parent directory of the mounted directory, that is,/data, and then write another file name to be edited. The file name is created by yourself. Generally, store it in the/etc directory, and the file name is based on your needs.
Mount the disk/dev/sdb with autofs to the/data/abc directory.
Add a new disk and restart it.
[Root @ localhost ~] # Reboot
To trigger mounting, You need to edit two files. Edit the/etc/auto. master file. You can refer to the system's default trigger Mount editing in the file. First, write the parent directory of the mounted directory, that is,/data, and then write another file name to be edited. The file name is created by yourself. Generally, store it in the/etc directory, and the file name is defined as needed.
[Root @ localhost ~] # Vim/etc/auto. master
/Misc/etc/auto. misc
/Mytest/etc/auto. mytest
Edit/etc/auto. mytest. This file does not exist. You must create a new file. First, write the subdirectory to which the disk is mounted. You only need to write the subdirectory file name. This subdirectory does not need to be created by yourself. The second is the file system type. Finally, write/dev/sdb, that is, add the name of the mounted device.
[Root @ localhost ~] # Vim/etc/auto. mytest
Abc-fstype = ext3:/dev/sdb
Check the/mytest file. There is no content in it, but you can continue to enter the abc directory and switch back to the/mytest directory to view the abc directory. By default, this directory is automatically uninstalled when no operation is performed on this directory in 300 seconds.
[Root @ localhostdata] # cd/mytest/
[Root @ localhostmytest] # ls
[Root @ localhostmytest] # cd abc
[Root @ localhostmytest] # ls
Abc
For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10