How Does It Work?
Well, beyond the business of filehandles, there is the entire protocol of how the NFS clients and servers actually talk to each other. The main parts of the communication between the client are the nfs client software, and the portmapper, the mountd and the NFSd on the server. There are four main steps to getting an NFS mount to happen. Lets say that there is an NFS server that is exporting /users/jey/, and that we are looking for /users/jey/linux.doc:
1. The client software asks the server's portmapper, "Hello NFS server, what port number can I find mountd at?" To which the server replies, "Hello NFS client, please ask on port number 923." Now, the NFS client knows that if it wants to mount (use an NFS share) something, it will need to ask the mountd on port 923 for it.
2. The NFS client then asks the mountd "Hello NFS mountd, what is the filehandle for export: /users/jey?" The server responds with the filehandle.
3. With this filehandle, the client then asks the portmapper for the NFS port "Hello portmapper, what is the NFSd that is to be used with /users/jey?" The server responds with the port number assigned to it.
4. The NFS client then contacts the server's NFSd on the port it received in step 3, and says "Here is the filehandle, and I'm looking for linux.doc" The NFSd replies with the filehandle for the object.
The remote NFS system can now talk with the NFSd and can perform file operations using the provided filehandle.
The Stateless File system:
What makes NFS such a powerful file protocol is that it is stateless. Being stateless means that at no time do either the client or server go into a state that depends on further information. This means that either the NFS client or the NFS server can physically reboot, and once restarted, the communications can happen again.
Reference:
#man 8 rpcd.mountd
#man 8 rpcd.nfsd
#man exportfs
#man exports
Export options:
root_squash : Map requests from root user to anonymous user
no_root_squash : Dont root_squash
all_squash : Map all users to anonymous users
Tuesday, January 24, 2012
Subscribe to:
Posts (Atom)