Mount autofs in RHEL5

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.