NFS and SMB, Neither work well!

Permission denied is strange.
Lets go to the testing. Open a second SSH window

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

And then run again in the other window ls -lah /mnt/Movies and post what comes up in the other window.

Also just to ensure no issue send paste-log /etc/auto.smb.shares

Shouldn’t but might be worse for testing to configure an easier one.

sudo automount -f -v -d
Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.03
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(dir): dir map /etc/auto.master.d missing or not readable
lookup(file): failed to read included master map dir:/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(file): failed to read included master map auto.master
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/Movies with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/Movies
st_ready: st_ready(): state = 0 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-

I’m stuck in a loop of that.

So the ls still reports permission denied?

I tried to ctrl+z out of it but doesn’t work, it just keeps throwing hte last couple of lines.

expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-
^Zstatemachine:1500: got unexpected signal 20!
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-

Use CTRL-C to exit.

Please share this:

paste-log /etc/auto.smb.shares

Thanks that got me out of it.

https://paste.osmc.tv/etucarimuf

OK, that looks fine. For testing, can you comment out all the lines in your fstab (the ones you added staring with 192.) Just put a # in front of them and reboot.

The colons in there may be confusing things and the last line is completely wrong, so lets make sure fstab isn’t causing any problems.

https://paste.osmc.tv/afoheloway

Removed it all, the fstab didn’t work anyway, was just a futile attempt I made myself.

But still failing

sudo automount -f -v -d
Starting automounter version 5.1.2, master map /etc/auto.master
using kernel protocol version 5.03
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(dir): dir map /etc/auto.master.d missing or not readable
lookup(file): failed to read included master map dir:/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(file): failed to read included master map auto.master
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/Movies with timeout 15, freq 4 seconds
do_mount_autofs_direct: mounted trigger /mnt/Movies
st_ready: st_ready(): state = 0 path /-
st_expire: state 1 path /-
expire_proc: exp_proc = 1948251216 path /-
expire_cleanup: got thid 1948251216 path /- stat 0
expire_cleanup: sigchld: exp 1948251216 finished, switching from 2 to 1
st_ready: st_ready(): state = 2 path /-

Ok, stop automount (CTRL-C again) and try manually mounting. This will mount the Movies in /mnt

mount -t cifs 192.168.1.106:/Movies /mnt -o vers=3.0,credentials=/home/osmc/.smbcredentials

If you don’t get an error after running the mount, what does ls -l /mnt show?

sudo mount -t cifs 192.168.1.106:/Movies /mnt -o vers=3.0,credentials=/home/osmc/.smbcredentials
mount.cifs: bad UNC (192.168.1.106:/Movies)

 ls -l /mnt
total 16
dr-xr-xr-x 3 root root 4096 Apr 30 00:11 r:
dr-xr-xr-x 3 root root 4096 Apr 30 00:11 t:
dr-xr-xr-x 3 root root 4096 Apr 30 00:11 u:
dr-xr-xr-x 3 root root 4096 Apr 30 00:11 v:

My bad, try this

Getting a little better, but not there yet I think.

sudo mount -t cifs //192.168.1.106/Movies /mnt -o vers=3.0,credentials=/home/osmc/.smbcredentials
osmc@osmc-~$ sudo ls -l /mnt
ls: reading directory '/mnt': Permission denied
total 0

No error mounting but an error on lsl -l /mnt

Just for fun, try this

sudo umount /mnt
mkdir ~/moviestest
mount -t cifs //192.168.1.106/Movies ~/moviestest -o vers=3.0,credentials=/home/osmc/.smbcredentials
ls -l moviestest

Notice that other than the first command that you will not use sudo.

no sudo on mount will give me
mount -t cifs //192.168.1.106/Movies ~/moviestest -o vers=3.0,credentials=/home/osmc/.smbcredentials
mount: only root can use “–options” option
But as a whole it doesn’t work either, Permission denied.

sudo umount /mnt
osmc@osmc-:~$ mkdir ~/moviestest
osmc@osmc-:~$ mount -t cifs //192.168.1.106/Movies ~/moviestest -o vers=3.0,credentials=/home/osmc/.smbcredentials
mount: only root can use "--options" option
osmc@osmc-:~$ sudo mount -t cifs //192.168.1.106/Movies ~/moviestest -o vers=3.0,credentials=/home/osmc/.smbcredentials
osmc@osmc:~$ ls -l moviestest
ls: reading directory 'moviestest': Permission denied
total 0

Arrg, I forgot that -o would only work for root.

The ‘Permissions denied’ error tells me that the SMB user (osmc) is not able to access the files on the server. Check the file permissions on your Movies directory.

Share is set to “everyone” “Read only”.
I can try setting it to just the user (OSMC)?

Hmm there seems to be an Everyone and a Desktop, no OSMC, while there is a user named OSMC…

You were trying to mount with RW. I don’t know if that could be a problem since it was an RO share. Easiest test would be to allow the OSMC user full control. or mount as RO.

How do I mount as read only? I never need writing privilege for my devices

Going back to the first manual attempts at mounting, try this:

mount -t cifs //192.168.1.106/Movies /mnt -o ro,vers=3.0,credentials=/home/osmc/.smbcredentials

That will mount as RO.