I'm using Debian but got the same issue, in particular with using the next stable release "Trixie" (now Debian13/testing) as client together with a current stable "Bookworm" (Debian12/stable) server. I think to understand the problem will also help for fedora.
My installation uses Kerberos. Default used NFS protocol is version 4.2. The NFS client on Debian12 falls back to protocol version 3 automatically if it cannot establish a connection with version 4. This can be tested with mount
. Please note the command prompt server12:~$
, client12:~$
, or client13:~$
.
These exports does not conform to NFS4 to have an exported root directory with only nested directories exported. But it can be mounted with NFS3.
server12:~$ cat /etc/exports
/home 192.168.24.0/24(sec=krb5p,rw,async,no_subtree_check)
/srv/nfs 192.168.24.0/24(sec=krb5p,rw,async,no_subtree_check,fsid=0,crossmnt)
server12:~$ sudo exportfs -rv
exporting 192.168.24.0/24:/home
exporting 192.168.24.0/24:/srv/nfs
client12:~$ sudo showmount --exports server
Export list for server:
/home 192.168.24.0/24
/srv/nfs 192.168.24.0/24
client12:~$ sudo mount -vvv -t nfs4 -o sec=krb5p server:/srv/nfs /mnt/server
mount.nfs4: timeout set for Mon Jan 1 14:38:33 2024
mount.nfs4: trying text-based options 'sec=krb5p,vers=4.2,addr=192.168.24.125,clientaddr=192.168.24.65'
mount.nfs4: mount(2): No such file or directory
mount.nfs4: trying text-based options 'sec=krb5p,addr=192.168.24.125'
mount.nfs4: prog 100003, trying vers=3, prot=6
mount.nfs4: trying 192.168.24.125 prog 100003 vers 3 prot TCP port 2049
mount.nfs4: prog 100005, trying vers=3, prot=17
mount.nfs4: trying 192.168.24.125 prog 100005 vers 3 prot UDP port 51678
The mount
shows that the connection attempts to start with default vers=4.2
and falls back to vers 3
with success. You can see that it is connected with vers=3
:
client12:~$ findmnt /mnt/server
/mnt/server server:/srv/nfs nfs rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=tcp, ...
But on Debian13 the NFS client does not fall back to NFS3 anymore. This caused me problems when upgrading to "Trixie". You have to specify now what NFS version to use:
client13:~$ sudo mount -vvv -t nfs4 -o sec=krb5p server:/srv/nfs /mnt/server
mount.nfs4: timeout set for Mon Jan 1 16:21:13 2024
mount.nfs4: trying text-based options 'sec=krb5p,vers=4.2,addr=192.168.24.125,clientaddr=192.168.24.83'
mount.nfs4: mount(2): No such file or directory
mount.nfs4: mounting server:/srv/nfs failed, reason given by server: No such file or directory
client13:~$ # But specifying vers=3 as additional option then it connects:
client13:~$ sudo mount -vvv -t nfs4 -o sec=krb5p,vers=3 server:/srv/nfs /mnt/server
mount.nfs4: timeout set for Mon Jan 1 16:29:31 2024
mount.nfs4: trying text-based options 'sec=krb5p,vers=3,addr=192.168.24.125'
mount.nfs4: prog 100003, trying vers=3, prot=6
mount.nfs4: trying 192.168.24.125 prog 100003 vers 3 prot TCP port 2049
mount.nfs4: prog 100005, trying vers=3, prot=17
mount.nfs4: trying 192.168.24.125 prog 100005 vers 3 prot UDP port 51678
Assuming a successful configured NFS server, here are my exports and mounts for a valid NFS4 configuration for completeness.
server12:~$ cat /etc/exports
# Only for testing fallback to NFS3
#/home 192.168.24.0/24(sec=krb5p,rw,async,no_subtree_check)
#/srv/nfs 192.168.24.0/24(sec=krb5p,rw,async,no_subtree_check,fsid=0,crossmnt)
#
# Valid NFS4 configuration
/srv/nfs gss/krb5p(rw,async,no_subtree_check,fsid=0,crossmnt)
/srv/nfs/home gss/krb5p(rw,async,no_subtree_check)
server12:~$ cat /etc/fstab
PARTLABEL=rootfs / ext4 errors=remount-ro 0 1
PARTLABEL=swap none swap sw 0 0
/dev/vdb /media ext4 errors=remount-ro 0 1
/media /srv/nfs/media none bind 0 0
/home/ingo /srv/nfs/home/ingo none bind 0 0
/home/mary /srv/nfs/home/mary none bind 0 0
/home/common /srv/nfs/home/common none bind 0 0
client13:~$ cat /etc/fstab
# Your local mounts ..., then for NFS4 mounts
server:/ /mnt/srv nfs4 sec=krb5p 0 0
server:/home /mnt/home nfs4 sec=krb5p 0 0
client13:~$ ls /mnt/srv
home/ media/
client13:~$ ls /mnt/home
common/ ingo/ mary/
$ mount -t nfs4 nina:/misc/fedora-home ~/tmp/mnt mount.nfs4: failed to apply fstab options
I get the same error without the '-t nfs4'mount.nfs4: mounting nina:/misc/fedora-home failed, reason given by server: No such file or directory
. Without the-t nfs4
I get a good mount (but nfs3)/misc/fedora-home
,/misc/fedora-backup
or/home
?