Linux-server B mounts the disk of server
Environment:CentOS 1, 7.0
1. Server B in centos mounts the disk of server
Server A: 101,. 10.0.1
Server B: 101.10.12.1
Prerequisites: ensure that the server A and server B have/ifs/data/folders.
Objective: To mount the/ifs/data/folder of server A to your/ifs/data/folder on server B.
Step 1. Edit the/etc/exports file of server.
# vi/etc/exports
Add the following content to allow it to add trust to server B
/ifs/data 101.10.12.1 (rw,no_root_squash,no_all_squash,sync)
Enter the following command to make the configuration take effect
exportfs -r
Step 2. Attach a shared disk to server B
Mount the disk of server A on server B and run the following command:
Mount the file by using the mount command. It takes effect only once and is invalid after restart. The command is as follows:
mount -t nfs 101.10.0.1:/ifs/data /ifs/data
If you want to take effect after restart, You need to modify the/etc/fstab file of server B.
vi /etc/fstab
Add the following content
101.10.0.1:/ifs/data /ifs/data nfs defaults 0 0
After saving and exiting wq, you can run the mount-a command to check whether the mount is successful.