Linux systems are used in many places, and some Linux NFS settings are also involved for a set-up. NFS is a frequently used service for sharing document directories between linux systems. In fact, the configuration of Linux nfs is very simple. I also use simple square characters to record the configuration points of NFS.
1) server configuration file:/etc/exports
File Format: Directory hostname (options)
Directory is the Directory to be shared;
The domain name/IP Address/IP address segment of the hostname client. It can also be empty. If it is null, it indicates any host;
Optional. If this parameter is not specified, the default option is used. Such as ro, rw, sync, async, etc;
For example:
The following is a code snippet:
/Home 192.168.1. * (rw, async, no_root_squash)
Rw; readable and writable
Async; synchronization, the server only accepts the response from the client to proceed to the next step, to ensure more reliable connection
No_root_squash; Do not compress the permissions of the root user. to be safer, use
On the server side, you can use the exportfs command to output the directories shared by exports;
2) ensure that portmap and Linux NFS are started.
The following is a code snippet:
#/Etc/rc. d/init. d/portmap start (or: #/service portmap start)
#/Etc/rc. d/init. d/nfs start (or: #/serverice nfs start)
Note: You can use netstat & ndash; untlp to check whether the portmap and nfs services are started. Port 2049 is the NFS server and port 111 corresponds to the portmap service, it can be found that both TCP and UDP have corresponding ports;
3) NFS client configuration (mount or fstab file)
The following is a code snippet:
# Mount & ndash; t nfs hostname (orIP):/directory/mountpoint
-T nfs can be omitted;
/Directory is the absolute path;
Or add the mounting records of the NFS file system to the/etc/fstab file.
The following is a code snippet:
NFS serverIP:/directory/mountpoint nfs ults 0 0
In Linux NFS, you can use mount to check the mount point.