Tuesday, July 27, 2010

Nfs


Introduction.
The Network File System (Network File System)or NFS is a protocol for application level, according to the OSI model. It is used for distributed file systems in a computer network environment of local area. It enables different systems connected to the same network to access remote files as if they were local. Originally developed in 1984 by Sun Microsystems, with the aim of which is independent of the machine, the operating system and protocol for transport, this was possible because the protocols are implemented on XDR (presentation) and ONC RPC (meeting) . The NFS protocol is included by default in OS UNIX distributions andLinux.
  • NFS consists of at least two main parts: a server and one or more clients. Customers remotely access the data stored on the server.
  • Local workstations use less disk space because the data is centralized in one place but can be accessed and modified by multiple users, so it is not necessary to replicate the information.
  • Users do not need to have a home directory on each machine of the organization. Home directories could be set up on the NFS server and then access them from any machine via the network infrastructure.
  • Can also be shared through the network storage devices such as floppy drives, CD-ROM and ZIP drives. This can reduce investment in these devices and improve use of existing hardware in the organization.
All file operations are synchronous. This means that the operation returns only when the server has completed all work related to that operation. If a write request, the server will write data physically on disk, and if necessary, update the directory structure before returning a response to the client. This ensures the integrity of files.
Required Packages
nfs-utils
portmap
Configuration
# Mkdir / mnt / nfs
Edit the file / etc / exports, this file is controlling the nfs server connections
# Vi / etc / exports
/ Mnt / nfs 192.168.1.1 (rw, sync)
/ Mnt / nfs 192.168.1.199 (rw, sync)
The first line indicates that the folder / mnt / nfs will be shared at the address 192.168.1.1 in write mode. The sync option causes all writes to disk from the NFS client are synchronous and therefore provides greater security against system crashes, but can also reduce performance.
Other options:
root_squash: is trying to keep the uid and gid, so that interprets each user's client is also the same server with their user IDs and group. But if the client user is root, the uid and gid with which to work on the server will be the anonymous user, nobody.
no_root_squash: The same behavior that root_squash, but not apply the change to root user access and therefore also works as root on the server.
all_squash: Not trying to maintain user and group IDs, but they are always changing the anonymous user.
After this, restart the services:
# / Etc / init.d / nfs restart