No Idea Why Autofs Not Working

Posting on behalf of another user.

Updated to 2021.08 version of OSMC on Vero 4K+.
auto.master and auto.shares missing so I did a fresh install.

Installed autofs based on this tutorial - https://discourse.osmc.tv/t/mounting-network-shares-with-autofs-alternative-to-fstab/74228

autofs didn’t work. Whenever I try to do …

ls -lah /mnt/4KHDR1

I would get …

ls: cannot open directory '/mnt/4KHDR1': No such file or directory

Here’s the log after boot up - https://paste.osmc.tv/aqudiyonor

I also did the …

sudo systemctl stop autofs
sudo automount -f -v -d

on one terminal and did another …

ls -lah /mnt/4KHDR1

on another terminal. And this is the output from the 1st terminal …

expire_cleanupst_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 4103074896 path /-
expire_cleanup: got thid 4103074896 path /- stat 0
expire_cleanup: sigchld: exp 4103074896 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-

NAS is using SMB/CIFS protocol, so I also tried adding vers=2.0 and then when it didn’t work, used vers=3.0. Both didn’t work.

Please help. Thank you.

Please share the autofs configs.

also try smbclient -L <IP of NAS>

1 Like

Do you mean the auto.master & auto.shares?

Yes, that’s what we will need to see.

1 Like

/etc/auto.master

#
# Sample auto.master file
# This is a 'master' automounter map and it has the following format:
# mount-point [map-type[,format]:]map [options]
# For details of the format look at auto.master(5).
#
#/misc  /etc/auto.misc
#
# NOTE: mounts done from a hosts map will be mounted with the
#       "nosuid" and "nodev" options unless the "suid" and "dev"
#       options are explicitly given.
#
#/net   -hosts
#
# Include /etc/auto.master.d/*.autofs
# The included files must conform to the format of this file.
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# Note that if there are entries for /net or /misc (as
# above) in the included master map any keys that are the
# same will not be seen as the first read key seen takes
# precedence.
#
+auto.master
/- /etc/auto.shares --timeout 15 browse

/etc/auto.shares

/mnt/4KHDR1 -fstype=cifs,rw,credentials=/home/osmc/.credentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://192.168.100.56/4KHDR1
#/mnt/4KHDR2 -fstype=cifs,rw,credentials=/home/osmc/.credentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.100.56/4KHDR2
#/mnt/4KHDR3 -fstype=cifs,rw,credentials=/home/osmc/.credentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.100.56/4KHDR3
#/mnt/4KHDR4 -fstype=cifs,rw,credentials=/home/osmc/.credentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.100.56/4KHDR4
#/mnt/4KHDR5 -fstype=cifs,rw,credentials=/home/osmc/.credentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.100.56/4KHDR5
#/mnt/4KHDR6 -fstype=cifs,rw,credentials=/home/osmc/.credentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.100.56/4KHDR6

smbclient -L 192.168.100.56

mkdir failed on directory /var/run/samba/msg.lock: Permission denied
Unable to initialize messaging context
Enter WORKGROUP\osmc's password:
Anonymous login successful
Sharename       Type      Comment
---------       ----      -------
4KHDR1          Disk
4KHDR2          Disk
4KHDR4          Disk
4KHDR3          Disk
4KHDR5          Disk
4KHDR6          Disk
IPC$            IPC       IPC Service (raspberrypi server)
Reconnecting with SMB1 for workgroup listing.
Anonymous login successful
Server               Comment
---------            -------
Workgroup            Master
---------            -------
WORKGROUP            VERO2

I’ve never managed to get autofs to work with smb using a credentials file. It’s probably less secure, but I include the windows username and password directly in the definition: username=xxx,password=yyy.

Looks all good. Still strange that you don’t the mounting request when you execute the verbose output.
What does ls -lah /mnt/ gives you and what comes from mount

Works fine here on all my devices.

ls -lah /mnt/

total 8.0K
drwxr-xr-x  3 root root 4.0K Aug 21 18:40 .
drwxr-xr-x 20 root root 4.0K Aug 20 15:36 ..
drwxr-xr-x  2 root root    0 Aug 21 18:35 4KHDR1

mount

devtmpfs on /dev type devtmpfs (rw,relatime,size=1015064k,nr_inodes=253766,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,relatime)
/dev/mapper/vero--nand-root on / type ext4 (rw,relatime,stripe=1024,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/debug type cgroup (rw,nosuid,nodev,noexec,relatime,debug)
cgroup on /sys/fs/cgroup/schedtune type cgroup (rw,nosuid,nodev,noexec,relatime,schedtune)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=38,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=281)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
/etc/auto.shares on /mnt/4KHDR1 type autofs (rw,relatime,fd=6,pgrp=2486,timeout=15,minproto=5,maxproto=5,direct,pipe_ino=15230)
/dev/sda1 on /media/PapiMarts1 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=203728k,mode=700,uid=1000,gid=1000)

That all looks correct.
I am still confused why the mounting request is not shown if you do the manual test

sudo systemctl stop autofs
sudo automount -f -v -d

Are you sure what you posted above was all of the output or was it just the end?
Because after the unmounting it will again show

expire_proc: exp_proc = 4099929168 path /-
expire_cleanup: got thid 4099929168 path /- stat 0
expire_cleanup: sigchld: exp 4099929168 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-

Normally that log starts with

Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.02
lookup_nss_read_master: reading master file /etc/auto.master
do_init: parse(sun): init gathered global options: (null)
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

I think just the end. The whole thing just loops. I’ll ask user to try and get the starting text.

Yes after it unmounts it loops. So a few seconds after executing the ls command he should stop the autofs command with Ctrl-C

Is it possible to connect to a samba share with just kodi interface? I think I will recommend the user to try that first before further troubleshooting :sweat_smile:

Check this post

1 Like

Thank you!

confirmed, the same here (with credentials file). I don’t know if it matters but as I had some trouble to do it too is the variable order a problem?
My line has the version prior the credential “fstype=cifs,rw,vers=3.11,credentials=XXXX”
Should not but this is the only difference I spot