Setting the default nfs version for automounted directories

I have a ZS3 appliance which was all setup to allow root access to shares using the network exceptions.

When I mounted the filesystem explicitly and said to use nfs version 3 (-o vers=3) this was working fine, but for some reason automount was picking up nfs version 4 when I did a cd /net/192.168.10.15

You can see this by using the nfsstat command with the -m flag /mnt1 is the mountpoint where the version has been specified at mount time.

 

root@ssccn1:/net/192.168.1.15/export/ssc# nfsstat -m
/mnt1 from 192.168.1.15:/export/ssc/solaris
 Flags: vers=3,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=32768,wsize=32768,retrans=5,timeo=600
 Attr cache: acregmin=3,acregmax=60,acdirmin=30,acdirmax=60
/net/192.168.1.15 from 192.168.1.15:/
 Flags: vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache: acregmin=3,acregmax=60,acdirmin=30,acdirmax=60
/net/192.168.1.15/export from 192.168.1.15:/export
 Flags: vers=4,proto=tcp,sec=sys,hard,intr,link,symlink,acl,mirrormount,rsize=1048576,wsize=1048576,retrans=5,timeo=600
 Attr cache: acregmin=3,acregmax=60,acdirmin=30,acdirmax=60

 

You can change the default mount options for the automounter by

vi /etc/auto_master and add -o vers=3 on the entry for /net

#
# Copyright (c) 1992, 2011, Oracle and/or its affiliates. All rights reserved.
#
# Master map for automounter
#
+auto_master
/net -hosts -nosuid,nobrowse,vers=3
/home auto_home -nobrowse
/nfs4 -fedfs -ro,nosuid,nobrowse

 

Refresh and restart the autofs service and now you should be able to mount your directory as version 3.

# svcadm refresh /system/filesystem/autofs
# svcadm restart /system/filesystem/autofs

 

Advertisements

One thought on “Setting the default nfs version for automounted directories

  1. Thanks for your article. But i face a critical problem on nfs4 where all my home directories having nfs3 and 4 mixed together. My RHEL works fine where as solaris hosts are giving ACL errors after aumount the home directories.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s