What is the NFS server



Short for Network File System.NFS is the development of the company by the Sun, launched in 1984, NFS is an RPC service, it enables us to achieve file sharing, it is designed to use different systems, so it is with the host protocol design and operationsystem independent. When the user wants to use a remote file as long as the "mount" the remote file system can be mounted under its own file system, making use of remote files and local machine file Meiliang Yang.

If we in the machine A, machine B on the make / usr / man attached to the machine A in the / usr / man as long as the following mount machine_name: / usr / man / usr / home can mount over. And we can not justmount directory is a file is also possible. in the attached file then we can only do reading (or writing) the action, not in remote machie this file or directory on the move, delete out, but it should be noted that asWe mount / usr, you can not re-mount / usr directory below, otherwise an error will occur

Servers on NFS file is prompted by other machines mount, to achieve resource sharing, access to these files can be called a machine Client, a client can mount a file from the server or on a directory level (file hierarchies).But the fact that any machine can do NFS server or NFS client, even while the NFS server and NFS client can be.

NFS server export out of the files or directories are recorded in the / etc / exports file this one, when we start the NFS server when / etc / rc.local for this script will automatically start exportfs this program to search / etc/ exports this file exists, and give the correct permissions to all export out of the file hierarchies.

It should be noted that only export out of the path of the server, NFS client can mount, start the client when the same, the system will automatically mount all the server export to the path, and mount to all of the paths will be recorded in / etc /fstab, the fstab file like the following

/ Dev/sd0a / 4.2 rw 1 1

/ Dev/sd0h / tmp 4.2 rw 1 3

/ Dev/sd0g / usr 4.2 rw 1 2

/ Dev/fd0 / pcfs pcfs rw, noauto 0 0

sparc20: / swap / swap nfs rw, intr, bg, soft 0 0a

sparc17: / home / home nfs rw, intr, bg, soft 0 0

sparc17: / home3 / home3 nfs rw, intr, bg, soft 0 0

sparc14: / home4 / home4 nfs rw, intr, bg, soft 0 0

sparc20: / home2 / home2 nfs rw, intr, bg, soft 0 0

sparc20: / var / spool / mail / var / spool / mail nfs rw, intr, bg, soft 0 0

rs970: / home1 / home1 nfs rw, intr, bg, soft 0 0

When the client mount to a path, not saying that this copy server on the path to the local machine, we can use to cd into the path of this mount, just as is the use of the same local directory