Believe it or not, this isn’t actually clearly documented anywhere. Due to my issues with the way NFSv4 works on Linux, I’ve had to disable NFSv4 on SLES10 and RHEL4 in order for my Linux mounts to play nicely with Solaris 10’s automountd.

Doing this on SLES was very easy, just change ‘NFS4_SUPPORT="yes"‘ to ‘NFS4_SUPPORT="no"‘ in /etc/sysconfig/nfs. However, this doesn’t work on RHEL. It reads the file, but doesn’t do anything with this variable.

A quick bit of script reading revealed how to do it. /etc/init.d/nfs passes the contents of $RPCNFSDARGS to rpc.nfsd when it starts it. This variable isn’t declared anywhere, so we’ll use it to disable NFSv4 as follows:

# echo "RPCNFSDARGS='--no-nfs-version 4'" >> /etc/sysconfig/nfs
# service nfs --full-restart

That’s it. Now NFSv4 on RedHat Enterprise Linux will be disabled, and it’ll apply on future reboots too.

I suspect the same procedure will apply to Centos 4 and possibly later releases of RHEL. I’ve not checked these though.


6 Responses to “HOWTO: Disable NFSv4 on RedHat Enterprise Linux 4”  

  1. 1 François

    That’s just another proof that Linux isn’t one but is many. Each distro has its own way of doing things, you can’t learn them all because one day you are gonna end up a different way to do things. These days, most commercial software needs to be distro compatible, not Linux compatible.

    Can I say that I really hate that!

  2. 2 Colin

    I can see how that would piss off a lot of developers, especially when it comes to things like documented interfaces and backwards compatibility (or should I say lack there of).

  3. 3 Martin

    Thanks, this tip solved my problem (I’m useing CentOS).

  4. 4 Dude

    Thanks! Had an issue with Solaris connecting to linux nfs server. Error message when mounting was “Not Owner”.

    Turns out they were trying to use v4. Now it’s off and things work fine.

  5. 5 Jack

    This saved me from changing some thirty odd solaris 10 machines client side with a single server side fix. Thanks.

  1. 1 HOWTO: Multi-boot Solaris, RHEL, SLES and Nevada :: Col’s Tech Stuff

Speak Your Mind    cocomment icon