Newbie question : autofs is not working

Hello ladies and gents ,

I was following the tutorial from RHCSA RHEL 8 - Using AutoFS with NFS - YouTube , so my setup is : NFS server centos 7, NFS client RockyLinux 9.2
Both have firewall disabled between them , also enforcing is permissive on both .
NFS server IP : 192.168.122.1
NFS client IP : 192.168.122.20

Mounting manually works without a problem .

Trying with autofs is another thing …

Here is the config on NFS client :

/etc/auto.master contents :

+dir:/etc/auto.master.d
+auto.master

/etc/auto.master.d/home.autofs contents :

/home	/etc/autofs.home

/etc/autofs.home contents :

*	-rw	192.168.122.1:/home/&

After i restart the autofs dameon , the “/home” directory is empty

But it looks mounted :

[root@nfs-client etc]# df -h /home
Filesystem        Size  Used Avail Use% Mounted on
/etc/autofs.home     0     0     0    - /home

Daemon does look up and fine :

[root@nfs-client etc]# service autofs status 
Redirecting to /bin/systemctl status autofs.service
● autofs.service - Automounts filesystems on demand
   Loaded: loaded (/usr/lib/systemd/system/autofs.service; disabled; vendor preset: disabled)
   Active: active (running) since Wed 2023-05-24 15:50:58 EEST; 17min ago
 Main PID: 2624 (automount)
   CGroup: /system.slice/autofs.service
           └─2624 /usr/sbin/automount --systemd-service --dont-check-daemon

May 24 15:50:58 nfs-client systemd[1]: Starting Automounts filesystems on demand...
May 24 15:50:58 nfs-client systemd[1]: Started Automounts filesystems on demand.

So i tried to run the autofs manually with “/usr/sbin/automount -dvf” to get more logs out of it :

[root@nfs-client etc]# service autofs stop
Redirecting to /bin/systemctl stop autofs.service
[root@nfs-client etc]# 
[root@nfs-client etc]# /usr/sbin/automount -dvf 
Starting automounter version 5.0.7-116.el7_9.1, master map auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
lookup_read_master: lookup(file): read entry +dir:/etc/auto.master.d
lookup_nss_read_master: reading master dir /etc/auto.master.d
lookup_read_master: lookup(dir): scandir: /etc/auto.master.d
include_file: lookup(dir): include: /etc/auto.master.d/home.autofs
lookup_nss_read_master: reading master file /etc/auto.master.d/home.autofs
do_init: parse(sun): init gathered global options: (null)
lookup_read_master: lookup(file): read entry /home
lookup_read_master: lookup(file): read entry +auto.master
lookup_nss_read_master: reading master files auto.master
do_init: parse(sun): init gathered global options: (null)
lookup_nss_read_master: reading master nisplus auto.master
lookup_nss_read_master: no map - continuing to next source
lookup_nss_read_master: reading master sss auto.master
lookup_nss_read_master: no map - continuing to next source
master_do_mount: mounting /home
automount_path_to_fifo: fifo name /run/autofs.fifo-home
lookup_nss_read_map: reading map file /etc/autofs.home
do_init: parse(sun): init gathered global options: (null)
spawn_mount: mtab link detected, passing -n to mount
spawn_umount: mtab link detected, passing -n to mount
mounted indirect on /home with timeout 300, freq 75 seconds
st_ready: st_ready(): state = 0 path /home
===========================

Someone may help me here ? i am totally lost …

I’ve edited your post to put content in code blocks. You can surround text with three back ticks (```) in order to make blocks like in your post, now.

Ok

Thank you very much Neil

I had the same problem. I solved it by installing mount.nfs

dnf install mount.nfs