Linux/NetApp: NFS (NetApp) Fstab Mount

The following details how to map an NFS point, this case to a Netapp, using fstab

Edit the fstab file.  In this example, 192.168.1.100 is the NFS, the NFS export to be mounted is /vol/dir1, and local directory to be mapped to is /dir1.  Next is the mount point type.  For details on the rest of the options, use ‘man nfs’ from the command line.
# vi /etc/fstab
192.1.1.100:/vol/dir1  /dir1                   nfs     rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,nfsvers=3,timeo=600,actimeo=0 0 0

Create the local directory
# mkdir /dir1/

Mount always searches /etc/fstab if just a label (/dir1) is passed to it.  Here, it found the entry in fstab and mounted it.
# mount /dir1/

Using df to verify that mount did connect the NFS point
# df -h | grep dir
192.1.1.100:/vol/dir1
32G   96K   32G   1% /dir1

Move into the mount point
# cd /dir1

In this example, the local group luser needs to have full access to the share.  Below shows the changing of ownership from root to luser.
# chgrp luser .

Switch to the user luser1, who is also in the luser group
# su – luser1

Move into the new NFS mount point
[luser1@x ~]$ cd /dir1/

Create an empty file to test write access
[luser1@x dir1]$ touch asdf

Use ls to make sure the file exists.
[luser1@x dir1]$ ls
asdf

Logout of luser since testing is done.
[luser1@x  /]$ exit
logout

Note: The title of this is NFS (NetApp) Fstab Mount because technically this should work for any NFS mount point, not just a NetApp one.

~ by Kevin Goodman on November 12, 2008.

Leave a Reply