Automatic mounting of autofs files

Source: Internet
Author: User

For your convenience, you have used the ISO file to create your own rhel6.4 Yum source. Each time you manually mount it, it is inconvenient.

 

Later, the mount command was written in/etc/rc. Local, which is much more convenient.

 

After a long time, I found that a new problem occurred. The commands in RC. Local were not working, and I could not find the cause.

 

I occasionally heard people in the group ask questions about autofs and found that this software can solve my problems very well.

========================================================== ========================================================== ====================================

 

The difference between autofs and mount/umount is that it is a guard program. If it detects that the user is attempting to access a file system that has not been attached, it will automatically detect the file system. If it exists, autofs will automatically hook it.

 

On the other hand, if it detects that a mounted file system is not used for a period of time, autofs will automatically uninstall it. Therefore, after running autofs, you no longer need to manually mount and uninstall the file system.

Certificate -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Autofs is easy to configure and consists of two files

/Etc/auto. Master// This file is uniform and unique. System configuration file, which indicates the automatically mounted root directory and application configuration file

/Media/etc/auto. Media -- timeout 300

/Media indicates the root directory of the mounted file. Auto. Media indicates the applied configuration file-Timeout 300 indicates the system timeout, in seconds.

/Etc/auto. Media// This file is customized. It corresponds to the configuration file in the master, which indicates the actual Mount directory, mount parameters, and mount item location.

Rhel6.4-fstype = iso9660, loop, RO:/ISO/rhel6p4. ISO

Rhel6.4 indicates that the file is mounted at/Media/rhel6.4-fstype = iso9660. For the disc loop, the file simulation block device is mounted to the local RO = readonly:/ISO/rhel6p4. ISO is the Image Location/ISO

 

After the configuration is complete, under service autofs restart

[[Email protected] ~] # Service autofs restart
Stopping automount: [OK]
Starting automount: [OK]

OK prompt.

 

Attention: Ls/media is displayed as null, and the actual autofs has taken effect. You can use mkdir-P/Media/hi to verify it. The prompt is displayed.

Mkdir: cannot create directory 'Hi': Permission denied

A read command is required to activate the mounted file. Generally, ls/Media/rhel6.4 can be used.

The yum SEARCH command cannot be activated, but the yum install command can. It may be a read operation that has a practical significance (it does not seem to work either)

 

Feature: Some versions of RHEL are available in/etc/sysconfig/AutoFS.Disable_directConfiguration

You need to change it to disable_direct = 0 to successfully mount (unconfirmed)

 

 

 

 

 

 

Automatic mounting of autofs files

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.