AutoFS is the automatic Mount tool, used to mount the file system, when starting the Linux system, the AutoFS will also automatically run, the following small series will give you the RHEL5 use of AutoFS mount file method.
Mount the disk/dev/sdb to the/DATA/ABC directory with AutoFS.
Add a new disk and reboot.
[root@localhost~]# reboot
You need to edit two files to implement a trigger mount. Edit the/etc/auto.master file to refer to the system default trigger Mount Editor in the file. First write the parent directory of the Mount directory, that is,/data and then write another file name to edit, this file name is created for yourself, usually stored in the/etc directory, the file name according to their own needs to define.
[root@localhost~]# Vim/etc/auto.master
/misc/etc/auto.misc
/mytest/etc/auto.mytest
Edit/etc/auto.mytest. This file does not exist, you need to create a new one. The format first writes a subdirectory of the disk mount, just write the subdirectory file name, and this subdirectory does not need to be created by itself. The second is the file system type. Finally write:/dev/sdb, that is: plus the name of the device to be mounted.
[root@localhost~]# Vim/etc/auto.mytest
ABC-FSTYPE=EXT3:/dev/sdb
View the/mytest file, there is no content, but continue to enter the ABC directory to enter, and then switch back to the/mytest directory to see the ABC directory. The system defaults to uninstall automatically when 300 seconds do not operate on this directory.
[root@localhostdata]# cd/mytest/
[root@localhostmytest]# ls
[root@localhostmytest]# CD ABC
[root@localhostmytest]# ls
Abc
It's RHEL5. Using the AutoFS mount file, once the AutoFS is run, the file system can be mounted and unloaded automatically, and the boot automatically runs.