NFS server on Almalinux 9

I switched from AL8 to AL9 and my NFS server stopped working.
I’ve been digging around on Google for a few days now and still nothing, still nothing, still nothing.
Is there an instruction manual somewhere to get NFS up and running on the AL9?
On the AL8, everything - installation and start-up - went intuitively by itself.

BTW: So, for instance THIS does not work: (nfs service does not exists)

That is true:

$ systemctl status nfs.service
Unit nfs.service could not be found.
$ systemctl status nfs-server.service
● nfs-server.service - NFS server and services
     Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; preset: disabled)

Where does the other unit file come from:

$ dnf provides */nfs-server.service
nfs-utils-1:2.5.4-20.el9.x86_64 : NFS utilities and supporting clients and daemons for the kernel NFS server
Repo        : @System
Matched from:
Filename    : /usr/lib/systemd/system/nfs-server.service

What other units does package nfs-utils provide?

$ dnf rq -l nfs-utils | grep service

On EL7 the nsf.service is a mere symlink:

$ ls -l /usr/lib/systemd/system/nfs.service
lrwxrwxrwx. 1 root root 18 Jan 12  2022 /usr/lib/systemd/system/nfs.service -> nfs-server.service

Neither AL8 nor AL9 has (file or symlink) /usr/lib/systemd/system/nfs.service.

In other words, one should have used “nfs-server” already in EL7, but the guide does use the old alias “nfs”.

Red Hat describes how to deploy a NFS server on EL9 in: Chapter 2. Deploying an NFS server Red Hat Enterprise Linux 9 | Red Hat Customer Portal

nfs-utils is installed in last version.
nfs-server is not found

[rna@nuc24 ~]$ sudo dnf install nfs-server
Last metadata check: 2:55:10 ago Thu Jan 18 2024 07:59:05.
No match for argument: nfs-server
Error: Could not find match: nfs-server

…Red Hat describes how to deploy a NFS server on EL9 in…
That does not work,
First thing - nfsd cannot be foud:

[rna@nuc24 ~]$ sudo dnf search nfsd
Last metadata check: 2:58:20, ago Thu 18. Jan 2024, 07:59:05.
No match for argument: nfsd


If true, then what do you get with:

rpm -V nfs-utils
systemctl status nfs-server
[rna@nuc24 ~]$ sudo rpm -V nfs-utils
[sudo] passwd for rna: 
S.5....T.  c /var/lib/nfs/etab
[rna@nuc24 ~]$ sudo systemctl status nfs-server
○ nfs-server.service - NFS server and services
     Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; preset: disabled)
    Drop-In: /run/systemd/generator/nfs-server.service.d
     Active: inactive (dead)
[rna@nuc24 ~]$

See? You do have the nfs-server.service.

You just have to enable (and start) it, provided that you have the /etc/exports already set up and that you have updated your firewall to allow the clients to connect.

It looks more better, I will try it asap.

[rna@nuc24 ~]$ sudo systemctl start nfs-server
[rna@nuc24 ~]$ sudo systemctl status nfs-server
● nfs-server.service - NFS server and services
     Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; preset: disabled)
    Drop-In: /run/systemd/generator/nfs-server.service.d
     Active: active (exited) since Thu 2024-01-18 17:30:46 CET; 5s ago
    Process: 934867 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCESS)
    Process: 934868 ExecStart=/usr/sbin/rpc.nfsd (code=exited, status=0/SUCCESS)
    Process: 934884 ExecStart=/bin/sh -c if systemctl -q is-active gssproxy; then systemctl reload gssproxy ; fi (code=exited, status=0/SUCCESS)
   Main PID: 934884 (code=exited, status=0/SUCCESS)
        CPU: 17ms

led 18 17:30:44 nuc24 systemd[1]: Starting NFS server and services...
led 18 17:30:46 nuc24 systemd[1]: Finished NFS server and services.
[rna@nuc24 ~]$ showmount --exports
Export list for
[rna@nuc24 ~]$

It works!

na@rna-aop:~$ df -h
Souborový systém        Velikost Užito Volno Uži% Připojeno do
tmpfs                       3,2G  1,7M  3,2G   1% /run
/dev/sda3                    48G  9,8G   35G  22% /
tmpfs                        16G     0   16G   0% /dev/shm
tmpfs                       5,0M  4,0K  5,0M   1% /run/lock
/dev/sda4                   771G   39G  693G   6% /home
/dev/sda2                   512M  6,1M  506M   2% /boot/efi
/dev/sdb1                   3,7T  1,1T  2,6T  29% /hdd1
/dev/sdc1                   3,7T  1,5T  2,2T  40% /hdd2
tmpfs                       3,2G  124K  3,2G   1% /run/user/1723     1,9T   70G  1,8T   4% /nfs/nuc
rna@rna-aop:~$ ll /nfs/nuc
celkem 12
drwxrwxr-x 2 rna uucp   64 led 18 17:59 .
drwxrwxr-x 3 rna adm  4096 led 18 17:48 ..
-rw-r--r-- 1 rna rna     6 led 10 12:45 pokus.txt
-rw-r--r-- 1 rna rna     6 led 18 17:59 this_is_a_shared_dir_on_nuc24.txt

Thank you very much.
I don’t understand where the error was, I guess I was trying to run something like nfs or nfsd. And it should be nfs-server.
This is the case when one works on different distributions, RedHat, Mint, Raspbian…
Then I don’t have a mess in my head.

You better also:

sudo systemctl enable nfs-server

Because merely starting a service only starts it now,
while enabling it sets it to start on (every) boot.

1 Like

Of course.
After trying it, I enabled it permanently.