Linux Mount remote Directory

Source: Internet
Author: User

Linux mount remote directory Linux mount command is powerful, you can attach the remote machine's directory to the local as a directory exists, you will be like access to the local directory access to remote directory.
There are at least two things that you need to do to achieve this goal:
1. Make NFS settings on the Mount machine
2. Mount settings on the machine where mount is required.

First, let's see how to set up on a Mount machine (pc_a).
This is actually done through NFS (the network file system). In the/etc directory, there is a file exports to define all the directories and settings that are allowed to be shared; The first step is to add an option to this area.
For example: We need to share the/OPT directory, then add
/OPT * (rw, sync)
Here are three sections:
/OPT is a shared directory of commands
* is allowed to access the directory's IP address (some say the domain name, but I tried to set the IP address is not successful)
(Rw,sync): This is a property that sets access, such as RW for read and write, and sync for both memory and disk
For details, see Settings for NFS.
Once this is set up, you need to restart NFS for this work, and the command is:
./nfs Restart
This command is under/ETC/RC.D/INIT.D.
Then see:
Shutting down NFS mountd: [OK]
Shutting down NFS daemon: [OK]
Shutting down NFS services: [OK]
Starting NFS services: [OK]
Starting NFS daemon: [OK]
Starting NFS mountd: [OK]
It means OK.

The second step requires the execution of several commands on the machine that requires mount; This command requires root access and two ways to do it:
1. Add the command in/etc/fstab, as follows:
192.168.215.10:/opt/home/ttt/opt
then save; execute mount-a again.
2. Execute directly at the command line
Mount 192.168.215.10:/opt/home/ttt/opt

If there is no error, then it should be mount succeeded, and then to the specified directory/home/ttt/opt can be found.

Note that/home/ttt/opt needs to be created beforehand.

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.