Mount NetApp volumes on Linux over NFSv4

Quick-n-durty HOWTO mount NetApp volumes on Linux using NFSv4i (as simpliest as possible).

Reasons to use NFSv4 ? Performance ? Security ? Read internet resources for that. However, almost all forums agreed that if you do not required v4, do not use it, v3 is good enough. Mine application has only NFSv4 in supported matrix, thus I was enforced to use it.

Netapp setting

NFSv4 support is off by default on NetApp systems. You have to turn it on. DANGEROUS !!! Most of modern OSes use v4 as default NFS protocol if NFS server support it. It is mean that they will mount volumes using NFSv4 once it enabled on NetApp.

Go over your NFS clients to verify that they have nfsvers=3, vers=3 in /etc/fstab, /etc/filesystems, /etc/vfstab. Double check RedHat 6+, AIX 6+, Solaris 10+.

netapp> options nfs.v4
nfs.v4.acl.enable            off        (value might be overwritten in takeover)
nfs.v4.enable                off        (value might be overwritten in takeover)
nfs.v4.id.domain                        
nfs.v4.read_delegation       off        (value might be overwritten in takeover)
nfs.v4.write_delegation      off        (value might be overwritten in takeover)
netapp> options nfs.v4.id.domain your.local.domain
netapp> options nfs.v4.enable on

Repeat on partner head.

Create volume and export it as usual:

netapp> vol create test_nfsv4 aggr0 1g
netapp> exportfs -p sec=sys,rw=clientIP,root=clientIP /vol/test_nfsv4

Client Settings

# grep nfs4 /etc/fstab
netapp:/vol/test_nfsv4       /mnt/nfs4       nfs4    rw,rsize=65536,wsize=65536,hard,intr,proto=tcp,timeo=600,retrans=3,sec=sys 0 0
# mkdir /mnt/nfs4
# mount /mnt/nfs4

As you can see nothing different with NFSv3. This is because of "sec=sys" while exporting FS. However, you will see difference listing NFSv4 content. Allmost all files/directories belongs to nobody user and group. NFSv3 speak using UID/GID, while v4 use username/goupname

Making it work

You have to add all relevant users and groups to NetApp's /etc/passwd and /etc/group files. GIDs and UIDs are not important, but they have to be unique per name.

netapp> rdfile /etc/group
root:*:0:root
dba:*:500:
netapp> rdfile /etc/passwd
root::0:1::/:
oracle::500::::

Fill the files with all users/groups that use NFSv4 volume. Other (recommended by NetApp) option is use NIS/LDAP for it. But then this HOWTO will be not quick-n-durty.


Updated on Wed Aug 22 16:04:25 IDT 2012 More documentations here