Can't mount smb share in Ubuntu 16.04

  • Hi, hope someone can help I tried to get this working yesterday but just can't get it to work! The mount has worked fine for a few years now so don't understand, I see that 8.2 has a major update to samba and this is obviously causing my problem. I can connect from Windows 10 and Mac High Sierra with no problems no matter what I set the Libreelec server too.

    Ubuntu 16.04, Samba version 4.3.11

    I got it working in the Ubuntu GUI by adding a couple of lines to smb.conf as suggested by Chewitt in another thread. And someone else elsewhere:

    min client protocol = SMB2

    max client protocol = SMB3

    But I still can't get it mount on boot! My fstab entry:

    //10.19.64.3/Movies /media/OpenelecMovies cifs guest,uid=1000,users 0 0

    //10.19.64.3/TV\040Shows /media/OpenelecTVShows cifs guest,uid=1000,users 0 0

    returns error: mount error(95): Operation not supported

    I tried adding vers=3.0 to the options, then I get error: mount error(2): No such file or directory

    I have also tried setting up username and password on server and then a corresponding credentials file, i get the same error: mount error(2): No such file or directory

    also tried adding username and password direct into fstab file but same error!

    Anyone spot where I'm going wrong?

    Cheers,

    Tim

  • fstab uses kernel mounts not smbclient and in Ubuntu 16.04 this is probably SMB1 by default, but it also might not work with SMB3 (depends on what Ubuntu's kernel allows) so try adding vers=2.0, e.g.

    Code
    mount -t cifs //10.19.64.3/Movies /media/OpenelecMovies -o vers=2.0,user=libreelec,pass=libreelec

    Working?

  • Hi Chewitt, thanks for your response! Yes I tried setting vers=2.0 nothing worked, so I experimented further and discovered that on my Mac that whilst I could see the shared folders most of them were empty! Also the Movies folder wasn’t showing at all! So I think I was hung up on it being an fstab problem when it’s looking like a permissions problem? I’ve gone back to 8.0.2 for the weekend and it’s all working again! Anything you can think of that would make 8.2 change the permissions? Or do you think something else is going on?

    Donbrew, thanks but as it works in 8.0.2 I’m quite sure it’s not a caps issue.

    Cheers,

    Tim

  • 1) CIFS != Samba.

    2) The default LibreELEC Samba server doesn't support CIFS vers=2.0 because the server min protocol is SMB2 which is an alias for SMB2_10, so vers=2.1 will work but not vers=2.0.

    3) The following should work:

    Code
    mkdir /media/pismb
    sudo mount -t cifs //192.168.0.18/Videos /media/pismb -o vers=3.0,guest

    192.168.0.18 is an RPi3 running LibreELEC, and Videos is one of the default shares. Samba authentication is not enabled so "guest" (or user=,pass=) can be used. Note the "-o" which is missing from @chewitts post #2.

    4) In terms of your fstab settings, I think the following should work for you:

    Code
    //10.19.64.3/Movies  /media/OpenelecMovies  cifs  vers=3.0,guest,uid=1000,users  0  0
    //10.19.64.3/TV\040Shows  /media/OpenelecTVShows  cifs vers=3.0,guest,uid=1000,users  0  0


    5) The kernel in Ubuntu 16.04 will by default connect with CIFS vers=1.0 (aka SMB1) which is no longer supported by default by the LibreELEC Samba server (default: minimum protocol is SMB2 aka SMB2_10, and max protocol is SMB3 aka SMB3_11). So when using CIFS you need to include a minimum of vers=2.1, but vers=3.0 and vers=3.02 will also work and give better performance (and security).

    vers=3.11 will not work as the kernel does not support the SMB3_11 protocol.

    Note that with kernel 4.13.y (eg. Ubuntu 17.10) the default version for CIFS is now vers=3.0, however with kernel 4.14.y the default CIFS version will be dropped to vers=2.1 to ensure increased out-of-the-box compatibility with most Samba servers.

  • Hi Milhouse and Chewitt,

    Thanks for all your help and I need to apologise! It seems my problem was with samba.conf on my Libreelec machine, I checked it to see if anything obvious jumped out at me when I noticed that it said OpenELEC at the top. So I thought I wonder if the sample had different settings it of course did so I copied them accross to the working file and hey presto it works!! I noticed that it actually says that in the release notes!!!! Don't no how I missed it!! ?(

    Thanks again and sorry for wasting your time!

    Cheers,

    Tim:)

  • 3) The following should work:

    Code
    sudo mount -t cifs //192.168.0.18/Videos /media/pismb -o vers=3.0,guest
    ...

    4) In terms of your fstab settings, I think the following should work for you:

    Code
    //10.19.64.3/Movies  /media/OpenelecMovies  cifs  vers=3.0,guest,uid=1000,users  0  0
    //10.19.64.3/TV\040Shows  /media/OpenelecTVShows  cifs vers=3.0,guest,uid=1000,users  0  0

    Hi Milhouse,

    thank you for your help. I have a similar problem and managed to mount my LibreELEC smb share to my Lubuntu system with your explaination using sudo mount ...

    Code
    sudo mount -t cifs //192.168.178.40/hddrive2go /media/LibreELECshare -o vers=3.0,username="myuser",password="mypassword"

    However, I still fail to automatically mount the share using fstab. My fstab entry is similar to the one you explained above, but I use a password authentification:

    Code
    //192.168.178.40/hddrive2go  /media/LibreELECshare cifs  uid=1000,vers=3.0,username="myuser",password="mypassword",users 0 0

    In the Lubuntu File Manager PCManFM the fstab mounted share appears, but doesn't seem to be mounted as there is not "Unmount button" next to it. When I try to access the share there is an error Message

    Code
    mount error(13): Permission denied
    Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

    As explained, the manual mount works fine, so where is the error in my fstab entry?

  • Remove the double quotes from username and password options in fstab - it doesn't like them. So use:

    Code
    //192.168.178.40/hddrive2go  /media/LibreELECshare cifs  uid=1000,vers=3.0,username=myuser,password=mypassword,users 0 0