Can't mount smb share to LE

  • Hi!

    using latest LE on RPI3

    I'm trying to mount a shared smb location with the cifs.sample file stored in /storage/.config/system.d

    I also tried to mount using the "mount" command but I get an "Invalid argument" error.

    I can't tell what's wrong... on another ubuntu pc I can mount just fine using the same command:

    Code
    mount -t cifs //192.168.31.1/Data /storage/networktest/ -o guest

    the share is from a usb drive connected to my Xiaomi router.

    I have no problem to access it from inside kodi with smb to view video files but i can't mount this share permanently.

    I want to mount it so I can record TVHEADEND onto it.

    anyone's got a suggestion?

    I read somewhere that maybe I need to install cifs-utils but I couldn't do it on LE.

  • Code
    mount -t cifs //192.168.31.1/Data /storage/networktest/ -o vers=1.0,guest

    In LE 8.2 the default connection will be SMB2 and most routers appear to be crap and only supporting SMB1, so try adding vers=1.0 to the options. If that still doesn't work also add sec=ntlm so it's not trying to use NTLMv2.

  • I'm having the same issue and I did use the "new way". I've changed to a new NAS that doesn't support SMB1 anymore (unless really forced, which I do not want to do given version 1 is sooo insecure).

    So I've had this before:

    Changed it to:

    Code
    Options=username=<username>,password=<password>,rw,vers=3.0

    NAS is reachable

    Code
    KODI:~ # ping 10.10.0.10
    PING 10.10.0.10 (10.10.0.10): 56 data bytes
    64 bytes from 10.10.0.10: seq=0 ttl=63 time=0.355 ms
    64 bytes from 10.10.0.10: seq=1 ttl=63 time=0.755 ms

    but at boot up, the mount fails. Any idea how to fix this?

    When I create a new "location" in Kodi the SMB share connects OK and I can browse/access all files. But that's not what I need. I want the mount to happen before Kodi starts. It used to work before but now fails and I have no clue why.

    Any tips are welcome.

    UPDATE: tried with vers 2.0 and 2.1 as well - same thing. When I try 1.0 which is not permitted by the NAS I see a "warning" in the NAS logs, so a connection to the NAS is not the issue:

    Edited once, last by RAspiDave (August 17, 2021 at 12:56 PM).

  • Code
    Options=username=<username>,password=<password>,rw

    What happens if you remove the version forcing and let things negotiate normally?

    Same thing: fail to mount

    UPDATE: I have a Liberelec running on a generic (Intel) pc and a Pi 4. I've done your suggestion on both and turns out that removing the version forcing on the Pi4 works just fine and logs in as SMB3 on the NAS. But on the PC it still fails and refuses to mount...

    UPDATE 2: I have tried on a Pi2 with LE9.6.2 (Rpi2.arm) to do the same but on that one it fails again. So it works on a RPi4.arm, but not on another image :/ :/

    UPDATE 3: found out that the issue is not happening on a Pi3 or Pi4 but is a problem on x86_64 or on a Pi2. they all are running on LE9.2.6 ...

    Edited 5 times, last by RAspiDave: Update of tests (August 18, 2021 at 9:00 AM).

  • As a temporary test I've forced the NAS to accept vers=1.0 and gave it a try. It works them without a glitch. So it does not seem to be a connectivity issue between the LibreElec and the NAS.


    Code
    HQMB-MMCMS-01:~ # mount
    ...
    //10.10.0.10/Multimedia on /storage/multimedia type cifs (rw,relatime,vers=1.0,cache=strict,username=<username>,uid=0,noforceuid,gid=0,noforcegid,addr=10.10.0.10,soft,unix,posixpaths,serverino,mapposix,acl,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

    UPDATE: this post is then obsolete as the Pi4 connects over SMB3 ok, but the Intel PC doesn't. they both run on LE9.2.6

    Edited once, last by RAspiDave: Update (August 18, 2021 at 8:21 AM).

  • I updated the documentation, pls have a look if you can spot a problem at your config.

    https://wiki.libreelec.tv/how-to/mount_network_share

    UPDATE: tried with vers 2.0 and 2.1 as well - same thing. When I try 1.0 which is not permitted by the NAS I see a "warning" in the NAS logs, so a connection to the NAS is not the issue:

    I would bet that you somehow still connect with smb1 - did you check that the files does not use dos file endings ?

  • Sorry, it took ages before I could try again. And still no luck. But I did some research and found that I can have more debug info with

    Code
    smbclient -L 10.10.0.10 -m SMB2 -U <username> -d 256

    Found out that it looks like it indeed still tries using version 1.0, but I can't figure out why as the mount clearly states vers=2.1

    Code
    smbXcli_negprot_smb1_done: No compatible protocol selected by server.
    protocol negotiation failed: NT_STATUS_INVALID_NETWORK_RESPONSE
    Failed to connect with SMB1 -- no workgroup available

    Any idea why this happens?

    Edited once, last by RAspiDave (August 30, 2021 at 8:54 PM).

  • Did some further testing. Turns out that the following works fine:

    Code
    smbclient '\\10.10.0.10\multimedia' <password> -U <username> --option='client min protocol=SMB3'

    also SMB2 works fine:

    Code
    smbclient '\\10.10.0.10\multimedia' <password> -U <username> --option='client min protocol=SMB2'

    as I get in both cases the smbclient prompt and have checked with ls to see if I really was connected. But the

    Is it possible that LE x86_64 version ignores the vers= option? If so, how can that be changed?

  • Is it possible that LE x86_64 version ignores the vers= option? If so, how can that be changed?

    I had similar problems at ubuntu, my systemd mount file was borked.

    Iirc there are even differences in the order of the commands. So some commands do not work at the end.

    If it works at smbclient it does not mean it works with systemd, it uses mount to do it.

    You can check with the mount command what is actually done.

    mount

    then have a look what is shown there at the path - pls post here maybe we can spot the problem

  • I've compared a LE x86_64 with a RPi4, both with the same mounting options

    output of mount on RPi4:

    Code
    ...
    debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
    tmpfs on /var type tmpfs (rw,relatime)
    configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
    tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
    //10.10.0.10/Multimedia on /storage/multimedia type cifs (rw,relatime,vers=default,cache=strict,username=<username>,uid=0,noforceuid,gid=0,noforcegid,addr=10.10.0.10,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,echo_interval=60,actimeo=1)

    Output of mount on x86_64:

    Code
    ...
    debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
    tmpfs on /var type tmpfs (rw,relatime)
    mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
    configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
    tmpfs on /tmp type tmpfs (rw,nosuid,nodev)

    As you can see nothing is found on x86_64...

  • Development notice: we should use the CIFS debug default. It is a PIA without:

    Code
     config CIFS_DEBUG
    	bool "Enable CIFS debugging routines"
    	default y
    	depends on CIFS
    	help
    	  Enabling this option adds helpful debugging messages to
    	  the cifs code which increases the size of the cifs module.
    	  If unsure, say Y.