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.