|
Shared directory settings between Linux and Linux
1. [end] to modify the server modify / etc / export file and add:
/ Home / user / source * (rw)
or
/ Home / user / source * (rw, sync, no_wdelay, insecure_locks, no_root_squash)
or
/ Home / wyq / share 192. * (insecure, rw, sync, no_root_squash)
exports Profile Description
/ Home / user / source shared directory
192. * allows the host IP access, If you are unsure, use * (IP represents any time, without starred in Fedora 20 experiments, otherwise nfs not start)
insecure a safe option if nfs service port number less than 1024, you can not add this option, otherwise do not add, it is not accessible. Other host access, then it will be rejected.
Shared directory permissions rw, rw can read and write permissions, read permissions are ro.
sync synchronization options, as well as optional async. sync is no cache, ready to write sync, async is the use of cache.
no_root_squash NFS shared directory service attributes if the user is root, then this will have root directory permissions.
2. [end] server Run the following command to make entry into force of the new share
$ / Etc / rc.d / init.d / nfs restart
[Client] 3. Run the following command to mount shared:
sudo mount -t nfs zxhost001: / home / user / share / u01 / user / mount_point
Or
mount -t nfs -o rw 192.168.10.94:/home/user/source / home / user / target
Note: Open NFS firewall between two hosts
4. [client] unmounted
umount / u01 / user / mount_point
5. [client] automatically mount the boot
If you want to boot without manually mount the shared directory, you need to set the boot automatically mount.
mount_AtoB.sh contents of the file, which is 192.168.10.94 passwordxxx Password:
set fileformat = unix
#! Bin / bash
mount -t nfs -o rw 192.168.10.94:/home/user/source / home / user / target << EOF
passwordxxx
EOF
1), modify the password mount_AtoB.sh
2) the mount_AtoB.sh file into the / home / user directory
3), execute permission to change files, execute the following command:
chmod 777 mount_AtoB.sh
4), the file is added to the startup file:
$ Echo /home/user/mount_94to93.sh >> /etc/rc.d/rc.local |
|
|
|