Vero V with AutoFS --> unifi NAS

Hello

Sorry for the bother but i’m trying to get Autofs to work with a NAS specifically the Unifi nas Pro using SMB. I have connected to the NAS using SMB multiple times from both Mac and PC using Mac Finder/Windows file explorer. I have also tested that the credentials im using work on other devices. I have followed this document (Mounting network shares with autofs (alternative to fstab) - General - OSMC) but still have no luck i am wondering if i need to specify a version or im doing something else wrong. Any advice would be much appreciated

CONTENTS of my

etc/auto.master file

#

# 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

# To add an extra map using this mechanism you will need to add

# two configuration items - one /etc/auto.master.d/extra.autofs file

# (using the same line format as the auto.master file)

# and a separate mount map (e.g. /etc/auto.extra or an auto.extra NIS map)

# that is referred to by the extra.autofs file.

#

+dir:/etc/auto.master.d

#

# If you have fedfs set up and the related binaries, either

# built as part of autofs or installed from another package,

# uncomment this line to use the fedfs program map to access

# your fedfs mounts.

#/nfs4 /usr/sbin/fedfs-map-nfs4 nobind

#

# 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.smb.shares --timeout 15 browse

Contents of my /etc/auto.smb.shares file

/mnt/unifi/videos -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.1.38/Fun_Jumpers/

Contents of my .smbcredentials file

password=**********************

username=osmc

If i try to LS that directory after i restart the service using systemctl i get the following

osmc@SkydiveDanielsonOSMC:/mnt/unifi$ ls -larth

total 8.0K

drwxr-xr-x 3 root root 4.0K May 18 10:28 ..

drwxr-xr-x 3 root root 4.0K May 18 10:44 .

drwxr-xr-x 2 root root 0 May 19 09:14 videos

osmc@SkydiveDanielsonOSMC:/mnt/unifi$ cd videos/

-bash: cd: videos/: No such file or directory

osmc@SkydiveDanielsonOSMC:/mnt/unifi$

Output of automount after stopping the autofs using systemctl

Starting automounter version 5.1.7, 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

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_read_master: lookup(file): read entry /-

master_do_mount: mounting /-

automount_path_to_fifo: fifo name /var/run/autofs.fifo--

lookup_nss_read_map: reading map file /etc/auto.smb.shares

do_init: parse(sun): init gathered global options: (null)

mounted direct on /mnt/unifi/videos with timeout 15, freq 4 seconds

do_mount_autofs_direct: mounted trigger /mnt/unifi/videos

st_ready: st_ready(): state = 0 path /-

Hi Bryan

Thanks for your post. Congratulations on being the first (and hopefully last) person to post on our forums and get accidentally banned. I do apologise.

Sometimes our moderation system will flag a post particularly for new users: in your case it was because it thought you typed to fast. I suspect you pre-typed the post somewhere else and copied and pasted it here or you just type fast…

The same flag came up on this new post.

I have manually adjusted your trust level on your account so you shouldn’t have such restrictions in the future.

1 Like

Can you try reboot, then give us the output of systemctl status autofs?

Sam

I always forget, but I think on some versions of autofs you actually have to mkdir the target directory you plan to mount over, e.g. you should mkdir -p /mnt/unifi/videos.

below is the output of systemctl status autofs
Also sorry but i did make the directory /mnt/unifi/videos but when autofs is running even though i can see the directory using ls i cannot access it with cd or view its contents with ls

as shown by these commands as i was able to run

osmc@SkydiveDanielsonOSMC:~$ cd /mnt/unifi/videos/
-bash: cd: /mnt/unifi/videos/: No such file or directory
osmc@SkydiveDanielsonOSMC:~$ systemctl stop autofs
osmc@SkydiveDanielsonOSMC:~$ cd /mnt/unifi/videos/
osmc@SkydiveDanielsonOSMC:/mnt/unifi/videos$

osmc@SkydiveDanielsonOSMC:~$ systemctl status autofs

  • autofs.service - Automounts filesystems on demand
    Loaded: loaded (/lib/systemd/system/autofs.service; enabled; vendor preset>
    Active: active (running) since Tue 2025-05-20 19:23:04 EDT; 59s ago
    Docs: man:autofs(8)
    Process: 2516 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /var/run/au>
    Main PID: 2546 (automount)
    Tasks: 4 (limit: 3659)
    Memory: 4.5M
    CGroup: /system.slice/autofs.service
    `-2546 /usr/sbin/automount --pid-file /var/run/autofs.pid

May 20 19:23:03 SkydiveDanielsonOSMC systemd[1]: Starting Automounts filesystem>
May 20 19:23:04 SkydiveDanielsonOSMC systemd[1]: Started Automounts filesystems>
lines 1-13/13 (END)…skipping…

  • autofs.service - Automounts filesystems on demand
    Loaded: loaded (/lib/systemd/system/autofs.service; enabled; vendor preset: enabled)
    Active: active (running) since Tue 2025-05-20 19:23:04 EDT; 59s ago
    Docs: man:autofs(8)
    Process: 2516 ExecStart=/usr/sbin/automount $OPTIONS --pid-file /var/run/autofs.pid (code=exited, status=0/SUCCESS)
    Main PID: 2546 (automount)
    Tasks: 4 (limit: 3659)
    Memory: 4.5M
    CGroup: /system.slice/autofs.service
    `-2546 /usr/sbin/automount --pid-file /var/run/autofs.pid

May 20 19:23:03 SkydiveDanielsonOSMC systemd[1]: Starting Automounts filesystems on demand…
May 20 19:23:04 SkydiveDanielsonOSMC systemd[1]: Started Automounts filesystems on demand.

@bryandlong , I cleaned your posting. If you want to post some logs or configs it is best to use the “Preformatted Text” button </> or you can use the Code block marker “````”

For your problem maybe we start with something easy. On the Vero run
sudo apt install smbclient and the run the command:
smbclient -U osmc -L 192.168.1.38

1 Like

Thank you For the feedback i appreciate it and will make sure to use the </> button going forward. if i should format it in any other way going forward let me know and sorry for the inconvenience

here is the output of the smbclient -U osmc -L 192.168.1.38 command

osmc@SkydiveDanielsonOSMC:~$ smbclient -U osmc -L 192.168.1.38
Enter WORKGROUP\osmc's password: 

	Sharename       Type      Comment
	---------       ----      -------
	Fun_Jumpers     Disk      
	Corporate       Disk      
	Personal-Drive  Disk      UniFi Drive Personal-Drive
	IPC$            IPC       IPC Service (UniFi Samba Server 4.13.13-Debian)
SMB1 disabled -- no workgroup available

Well this looks good.
Let’s got for trouble shooting.

Please open two SSH sessions, in the first start
sudo systemctl stop autofs
sudo automount -f -v -d

In the second do ls -lah /mnt/unifi/videos

And post the output from the first session

osmc@SkydiveDanielsonOSMC:~$ sudo automount -f -v -d
Starting automounter version 5.1.7, 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
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_read_master: lookup(file): read entry /-
master_do_mount: mounting /-
automount_path_to_fifo: fifo name /var/run/autofs.fifo--
lookup_nss_read_map: reading map file /etc/auto.smb.shares
do_init: parse(sun): init gathered global options: (null)
mounted direct on /mnt/unifi/videos with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/unifi/videos
st_ready: st_ready(): state = 0 path /-
handle_packet: type = 5
handle_packet_missing_direct: token 5, name /mnt/unifi/videos, request pid 3917
attempting to mount entry /mnt/unifi/videos
lookup_mount: lookup(file): looking up /mnt/unifi/videos
lookup_mount: lookup(file): /mnt/unifi/videos -> -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.1.38/Fun_Jumpers/
parse_mount: parse(sun): expanded entry: -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc ://192.168.1.38/Fun_Jumpers/
parse_mount: parse(sun): gathered options: fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc
parse_mount: parse(sun): dequote("://192.168.1.38/Fun_Jumpers/") -> ://192.168.1.38/Fun_Jumpers/
parse_mount: parse(sun): core of entry: options=fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc, loc=://192.168.1.38/Fun_Jumpers/
sun_mount: parse(sun): mounting root /mnt/unifi/videos, mountpoint /mnt/unifi/videos, what //192.168.1.38/Fun_Jumpers/, fstype cifs, options rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc
do_mount: //192.168.1.38/Fun_Jumpers/ /mnt/unifi/videos type cifs options rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc using module generic
mount_mount: mount(generic): calling mkdir_path /mnt/unifi/videos
mount(generic): calling mount -t cifs -o rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc //192.168.1.38/Fun_Jumpers/ /mnt/unifi/videos
>> mount error(95): Operation not supported
>> Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)
mount(generic): failed to mount //192.168.1.38/Fun_Jumpers/ (type cifs) on /mnt/unifi/videos
dev_ioctl_send_fail: token = 5
failed to mount /mnt/unifi/videos

Ok, thats odd. Can you try adding the version. Just try running these commands (disable the automount for this test):
sudo mkdir -p /mnt/unifi/videos

sudo mount -t cifs -o rw,vers=3.0,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc //192.168.1.38/Fun_Jumpers/ /mnt/unifi/videos

Looks like that worked sir.

shall i just try restarting autofs?

sudo mkdir -p /mnt/unifi/videos
osmc@SkydiveDanielsonOSMC:~$ sudo mount -t cifs -o rw,vers=3.0,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc //192.168.1.38/Fun_Jumpers/ /mnt/unifi/videos
osmc@SkydiveDanielsonOSMC:~$ cd /mnt/unifi/videos/
Documents/ .DS_Store  Videos/    
osmc@SkydiveDanielsonOSMC:~$ cd /mnt/unifi/videos/Videos/
Compilations/ .DS_Store     Other/        People/       
osmc@SkydiveDanielsonOSMC:~$ cd /mnt/unifi/videos/Videos/People/
Bryan/            Ivy/              Nick LoBianco/    Philip Tancreade/
Dan Eisnor/       Melissa/          Nicky Lee/        Sean Caruso/
.DS_Store         Nathaniel/        Pat V/            Sort/
osmc@SkydiveDanielsonOSMC:~$ cd /mnt/unifi/videos/Videos/People/

First you need to sudo unmount /mnt/unifi/videos/
Then add vers=3.0 to /etc/auto.smb.shares then restart autofs

1 Like

Your an absolute Genius Sir my problem has been solved after restarting autofs i can now see the NAS share. i am doing all this over a VPN so i cant confirm visually but would the gui need any configuration for the share to show up when file browsing?

Also if anyone is curious this is the final /etc/auto.smb.shares

/mnt/unifi/ -fstype=cifs,rw,credentials=/home/osmc/.smbcredentials,iocharset=utf8,uid=osmc,gid=osmc,vers=3.0 ://192.168.1.38/Fun_Jumpers/

Well you could install the VNC server if you want to manage the GUI remotely.
Settings → MyOSMC → App Store

It will show up in the File Browser but if you want to watch Videos from there you would add it as a Source
https://kodi.wiki/view/Adding_video_sources

1 Like