Mounting SMB via fstab - Help

Hi, I am trying to following the following guide to mount SMB share via fstab, but having no luck.

I tried with guest, and with specific username/password, but still getting ‘No such device’ error.

I am on Windows 10 (latest - creators update) and folder is shared with ‘Everyone’.

I posted logs here: https://paste.osmc.tv/ehofaremoj

Also tried this : smbclient -L 192.168.1.2 -U my_username, and it listed all the shares (so it is connecting), but I received this message:
Connection to 192.168.86.27 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
NetBIOS over TCP disabled – no workgroup available

Any help would be appreciated.

Also… this is the line I added to fstab:
//192.169.86.27/Samplefiles /mnt/samplefiles cifs x-systemd.automount,noauto,rw,iocharset=utf8,guest,workgroup=workgroup,uid=osmc,gid=osmc,file_mode=0770,dir_mode=0770,vers=1.0 0 0

Also tried with replacing ‘guest’ with 'username=, password-, but no luck.

Have a look through this: File sharing with a NAS, media server, windows share or other device

I don’t think it’s necessary to enable NETBIOS over TCP.

I will take a look at NETBIOS setup on my Windows 10 machine, but I didn’t change anything specifically here from default settings.

Unfortunately, the link you provided above just links back to the same guide I was using for fstab setup.

Hi,

The link provided by grahamh is a different guide to fstab one you mentioned.

Its worth a read.

Thanks Tom.

Out of ideas… followed that other link, but wasn’t much additional info there. The section ‘OSMC as a client – using fstab’ does actually point to the same guide I was following.

Nothing I try seems to help. Maybe someone can review my log to see if they have any ideas?

I can successfully connect using ‘smbclient -L <server_name> -U my_username’ without errors and see the shares. So OSMC can see them fine…

Hi,

please provide the output of:

mount -v /mnt/samplefiles

So we can work out whats going on.

Thanks Tom.

Here is what I get…

osmc@osmc:/mnt$ mount -v /mnt/samplefiles
mount: only root can mount //Attic-PC/Samplefiles on /mnt/samplefiles

Prefix the command with sudo.

i.e. mount becomes

sudo mount

1 Like

osmc@osmc:/mnt$ sudo mount -v /mnt/samplefiles
Couldn’t chdir to /mnt/samplefiles: No such device

Here are logs as well: https://paste.osmc.tv/aliwobuvot

Did you create the mountpoint? Please show the output of the following commands:

mount
ls -l /mnt
ping -c4 Attic-PC

For creating the mount, I followed these steps completely: Configuring fstab based Samba share mounts

Maybe there is something additional I need to do to create mountpoint?

Here are the results. Not sure why ‘Attic-PC’ was not pingable but IP was. I used ‘Attic-PC’ with ‘smbclient -L <server_name> -U my_username’ command, and it showed all the Windows shares properly.

osmc@osmc:/$ mount
devtmpfs on /dev type devtmpfs (rw,relatime,size=371168k,nr_inodes=92792,mode=755)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /run type tmpfs (rw,relatime)
/dev/mmcblk0p6 on / type ext4 (rw,noatime,stripe=1024,data=ordered)
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)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
systemd-1 on /mnt/g type autofs (rw,relatime,fd=36,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
configfs on /sys/kernel/config type configfs (rw,relatime)
/dev/mmcblk0p5 on /boot type vfat (rw,noatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)
/dev/mmcblk0p1 on /media/RECOVERY type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0111,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,errors=remount-ro,uhelper=udisks)
/dev/mmcblk0p3 on /media/SETTINGS type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=75256k,mode=700,uid=1000,gid=1000)
systemd-1 on /mnt/samplefiles type autofs (rw,relatime,fd=28,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
osmc@osmc:/$ ls -l /mnt
total 4
dr-xr-xr-x 2 root root 4096 Apr 20 17:51 G
drwxr-xr-x 2 root root 0 Apr 20 18:16 g
drwxr-xr-x 2 root root 0 Apr 20 20:24 samplefiles
osmc@osmc:/$ sudo ping -c4 Attic-PC
ping: bad address ‘Attic-PC’
osmc@osmc:/$ sudo ping -c4 192.168.86.27
PING 192.168.86.27 (192.168.86.27): 56 data bytes
64 bytes from 192.168.86.27: seq=0 ttl=128 time=0.745 ms
64 bytes from 192.168.86.27: seq=1 ttl=128 time=0.903 ms
64 bytes from 192.168.86.27: seq=2 ttl=128 time=0.768 ms
64 bytes from 192.168.86.27: seq=3 ttl=128 time=0.813 ms

— 192.168.86.27 ping statistics —
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.745/0.807/0.903 ms

Try replacing the name in the fstab file with the IP. Or try Attic-PC.local as the name may also work (try pinging that)

I originally tried using IP address in fstab, but no luck. Same error.

Attic-PC.local was pingable as you suggested.

Any other thoughts?

At this point I may give up. I am expecting my Vero 4K early next week, so maybe I will wait and try again with that device.

Looks like I got it working. May have been a noob mistake. I tried again with a new mount name. However, I realized previously that I had not made the directory beforehand for the other mounts I tried. I did this time and it worked.

Mounted //Attic-PC.local/G to /mnt/media
Created /mnt/media dir before steps in guide to setup in fstab.

Seems strange since a dir listing showed the mounts I tried preciously and it appeared to be a directory, but I guess there was something different.

If this was the issue, tutorial should be updated to reflect this.

Thanks everyone for the help.

Let me know how you think this could be improved.

This step should not have been needed, if you followed my tutorial. To make sure, I just created a new mount via fstab, and the directory was created for me.

IIRC there can be some timing problems during boot when a mountpoint doesn’t exist while something expected it to be there. And creating a dir in advance fixed them.

I may be wrong.

Thanks grahamh, bmillham.

Not sure why it eventually worked for me if creating dir isn’t really necessary. Important point (for me at least) is that it is now working.