Wednesday, February 10, 2010

NFS : Important Interveiw Questions !!

Here I would like to share few of NFS Questions generally asked in the Interview.

1. What RPM you need for NFS server?

rpm -qa nfs*
nfs-utils-1.0.9-33.el5
nfs-utils-lib-1.0.8-7.2.z2

2. What daemon is need for NFS to start?

NFS depends on the portmapper daemon, either called portmap or rpc.portmap. It will need to be started first. It should be located in /sbin but is sometimes in /usr/sbin. Most recent Linux distributions start this daemon in the boot scripts, but it is worth making sure that it is running before you begin working with NFS (just type ps aux | grep portmap)

3.What daemons takes care of NFS serving?

NFS serving is taken care of by five daemons:

rpc.nfsd, which does most of the work;

rpc.lockd and rpc.statd, which handle file locking;

rpc.mountd, which handles the initial mount requests, and

rpc.rquotad, which handles user file quotas on exported volumes.

Starting with 2.2.18, lockd is called by nfsd upon demand, so you do not need to worry about starting it yourself. statd will need to be started separately. Most recent Linux distributions will have startup scripts for these daemons.

The daemons are all part of the nfs-utils package, and may be either in the /sbin directory or the /usr/sbin directory.

If your distribution does not include them in the startup scripts, then then you should add them, configured to start in the following order:

rpc.portmap
rpc.mountd, rpc.nfsd
rpc.statd, rpc.lockd (if necessary), and rpc.rquotad

4.You made some changes in /etc/exports. Does it show effect immediately?

No.
You should run the command exportfs -ra to force nfsd to re-read the /etc/exports file. If you can't find the exportfs command, then you can kill nfsd with the -HUP flag (see the man pages for kill for details).

If that still doesn't work, don't forget to check hosts.allow to make sure you haven't forgotten to list any new client machines there

5.What software you need for NFS Client setup running? ( Very Important)

To begin using machine as an NFS client, you will need the portmapper running on that machine, and to use NFS file locking, you will also need rpc.statd and rpc.lockd running on both the client and the server.

With portmap, lockd, and statd running, you should now be able to mount the remote directory from your server just the way you mount a local hard drive
with the mount command

6.How to get NFS File Systems to Be Mounted at Boot Time?

An Entry in /etc/fstab is enough

master.foo.com:/home /mnt nfs rw 0 0

7.What is Hard Mounting and Soft Mounting in NFS terminology?

There are some options you should consider adding at once. They govern the way the NFS client handles a server crash or network outage. One of the cool things about NFS is that it can handle this gracefully. If you set up the clients right. There are two distinct failure modes:

soft

If a file request fails, the NFS client will report an error to the process on the client machine requesting the file access. Some programs can handle this with composure, most won't. We do not recommend using this setting; it is a recipe for corrupted files and lost data. You should especially not use this for mail disks --- if you value your mail, that is.
hard

The program accessing a file on a NFS mounted file system will hang when the server crashes. The process cannot be interrupted or killed (except by a "sure kill") unless you also specify intr. When the NFS server is back online the program will continue undisturbed from where it was.

8. Whats the solution for NFS then?

We recommend using hard,intr on all NFS mounted file systems.

Picking up the from previous example, the fstab entry would now look like:

# device mountpoint fs-type options dump fsckord
...
master.foo.com:/home /mnt/home nfs rw,hard,intr 0 0

9.How to do NFS performance optimization?

Follow the link http://www.linux.org/docs/ldp/howto/NFS-HOWTO/performance.html for better understanding.

Hope it helps you attending overall important interview questions.
Read this space again. I will add up more in future.

1 comment:

  1. VERY NICE N USEFUL FOR LINUX ADMINS

    ReplyDelete