Disable nfs version4 in proxmox 8.xx

phanos

Renowned Member
Oct 23, 2015
24
0
66
Hi I am attempting to disable nfs server version 4 on my proxmox VE 8.xx environment. I followed this guide here

Code:
https://unix.stackexchange.com/questions/205403/disable-nfsv4-server-on-debian-allow-nfsv3

and tried to update both the
Code:
/etc/default/nfs-kernel-server
and the
Code:
/etc/init.d/nfs-kernel-server
directly but with no luck. After restarting and doing
Code:
cat /proc/fs/nfsd/versions
I get
Code:
+3 +4 +4.1 +4.2

Also when I try to view the process rpc.mount by running ps -ef |grep rpc.mount I see the process does not show any parameters next to it

Code:
root        1883       1  0 15:43 ?        00:00:00 /usr/sbin/rpc.mountd
root        4069    2486  0 15:49 pts/0    00:00:00 grep rpc.mount

Does anyone has any idea why this is happening and if there is a way to disable nfs 4 on proxmox 8.xx?

Thanks
 
That bug report is 9 years old and supposedly the bug didn't affect systemd (only sysv-init). Are you sure you used the right syntax?

RPCMOUNTDOPTS="--no-nfs-version 4"
RPCNFSDOPTS="--no-nfs-version 4"

WITH the quotes? The file /etc/default/nfs-kernel-server is a shell script fragment so you need them. I use that setting to disable NFSv3 on a regular Debian server and it works fine. I don't see it in the output of ps either but cat /proc/fs/nfsd/versions is correct.

There is also /etc/nfs.conf but I've never touched that.
 
I am not aware of any situation why this should be switched off on the server. The easiest way is to set this on the nfs client.
Here is an example of the FSTAB:

Code:
mynfsserver:/yourNFS-share /your_local_mountpoint nfs     nfs     defaults,nfsvers=3 0       0

For the WebUI in Proxmox this can be set very simple:

Screenshot_20241008_153014.png
 
  • Like
Reactions: waltar
That bug report is 9 years old and supposedly the bug didn't affect systemd (only sysv-init). Are you sure you used the right syntax?

RPCMOUNTDOPTS="--no-nfs-version 4"
RPCNFSDOPTS="--no-nfs-version 4"

WITH the quotes? The file /etc/default/nfs-kernel-server is a shell script fragment so you need them. I use that setting to disable NFSv3 on a regular Debian server and it works fine. I don't see it in the output of ps either but cat /proc/fs/nfsd/versions is correct.

There is also /etc/nfs.conf but I've never touched that.
Hi I used

1) RPCNFSDCOUNT="8 --no-nfs-version 4"
or
2) RPCMOUNTDOPTS="--manage-gids --no-nfs-version 4"
or
3) RPCMOUNTDOPTS="--no-nfs-version 4"

but separate not together in one boot. Every time I reboot I see
cat /proc/fs/nfsd/versions
+3 +4 +4.1 +4.2

Should I use what you are suggesting above?

RPCMOUNTDOPTS="--no-nfs-version 4"
RPCNFSDOPTS="--no-nfs-version 4"

Will the command cat /proc/fs/nfsd/versions

that +3 -4 -4.1 -4.2 instead of +3 +4 +4.1 +4.2
or it does not matter what it produces? Will the version 4 be disabled?
 
I am not aware of any situation why this should be switched off on the server. The easiest way is to set this on the nfs client.
Here is an example of the FSTAB:

Code:
mynfsserver:/yourNFS-share /your_local_mountpoint nfs     nfs     defaults,nfsvers=3 0       0

For the WebUI in Proxmox this can be set very simple:

View attachment 75943
Where is this option? The nfs server is running on proxmox and the nfs clients are VMs that run on this machine as well. I am using /etc/fstab to mount the nfs. This was working fine in previous proxmox version but in version 7.xx and 8.xx I notice crashes on the nfs server on proxmox and the only way to recover is with a full reboot of the server.


I tried in a client to mount with nfs version 3 in /etc/fstab and thinks did got better but instead of mounting every single VM with nfs version 3 I prefer to disable nfs version 4 and see if that fixes my issue. But I am not sure if what I did above did had any effect.
 
To disable on server side edit /etc/nfs.conf with shown defaults to the versions with y or either n and restart nfs server,
vers4=n should disable all v4 variants and v3 is still default on.
...
[nfsd]
# debug=0
# threads=8
# host=
# port=0
# grace-time=90
# lease-time=90
# udp=n
# tcp=y
# vers3=y
# vers4=y
# vers4.0=y
# vers4.1=y
# vers4.2=y
# rdma=n
# rdma-port=20049
vers4=n
...
 
To disable on server side edit /etc/nfs.conf with shown defaults to the versions with y or either n and restart nfs server,
vers4=n should disable all v4 variants and v3 is still default on.
...
[nfsd]
# debug=0
# threads=8
# host=
# port=0
# grace-time=90
# lease-time=90
# udp=n
# tcp=y
# vers3=y
# vers4=y
# vers4.0=y
# vers4.1=y
# vers4.2=y
# rdma=n
# rdma-port=20049
vers4=n
...
Thanks your suggestion worked. Now I get

+3 -4 -4.0 -4.1 -4.2

We will see if this fixes the issue with the crashes
 
I also found this bug from May 2024: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1071562

Seems like it might be similar to what you are seeing. I'm using a stock Debian 12 VM as the server, so it has kernel 6.1.0-26-amd64. The client VM's using the server are likewise Debian, although one has (had, it is no longer in use) the 6.9.7 kernel from backports.
My running kernel is 6.8.12-2-pve

Back when I was running proxmox 4.xx with the same hardware my system was rock solid. It could take months to reboot the server and when I did it was because I needed the updates or because I needed to make some maintenance on my machine.

When I tried proxmox 7.xx I could not even get a running system and there was kernel panics even a few minutes after boot so I had to revert back to proxmox 4.xx back then.

After proxmox 8.xx came out it seemed stabled enough but after I installed it I notice that there were nfs crashes every one a month or so. But now with the latest updates I get one every few days. Not sure what to make of it. When nfs server is crashed (I see the error in dmesg -wH) all the shares in the vms become unresponsive. The vms and server does run however but it useless since no data is accessible to my vms and the only way to get a working system is to reboot my machine.

I hope nfs v3 makes it more stable. We will see. Thanks for the help.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!