RHEL5 How to use the Automatic Mount tool AutoFS to mount files

Source: Internet
Author: User
Tags parent directory

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.

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.