Welcome to Srini's blog

Monday, March 22, 2010

NFS Server/Client configuration in Linux

NFS : The Network File System (NFS) was developed to allow machines to mount a disk partition on a remote machine as if it were a local disk. It allows for fast, seamless sharing of files across a network.

NFS Server configuration :
1. Create a dir which you want to mount i.e /home/nfs/sharepath.
2. We need to edit the /etc/exports file to add the dir path which you want to mount. add entry like
/home/nfs/sharepath *(rw,no_root_squash,no_all_squash,async,insecure)
here
i.* is to allow all ips
ii.rw -- read/write, ro -- readonly
iii. no_root_squash -- By default, any file request made by user root on the client machine is treated as if it is made by user nobody on the server
iv. no_all_squash -- If only part of a volume is exported, a routine called subtree checking verifies that a file that is requested from the client is in the appropriate part of the volume. If the entire volume is exported, disabling this check will speed up transfers
v. async -- telling a client machine that a file write is complete.
3.Restart nfs service using the cmd service nfs restart
4.Allow nfs port to connnect remotely in iptables or stop the iptables.

NFS client Config :
1. Create dir which you want to mount remote dir. i.e /home/nfs/remote_sharepath
2. Mount the path using the following cmd
mount remote_host_ip:/home/nfs/sharepath /home/nfs/remote_sharepath
3. Now create a sampe text file in NFS client mounted path(/home/nfs/remote_sharepath) and check the NFS server mount path and vise versa.

No comments:

Post a Comment