Samba broken

Hi, All

I have ancient and shitty NAS at my home LAN
with ancient samba server. (D-Link 315)
There is no new firmware for it.

I always use vers=1.0 option while mount.

At PC i use autofs.service
At Notebook I ise scripts like this:

$ cat bin/moumix.sh


#!/bin/sh
sudo mount -t cifs //10.160.1.108/mix /mnt/dl315m/mix -o vers=1.0,rw,_netdev,noperm,uid=1000,gid=1000,file_mode=0666,iocharset=utf8,users,credentials=/etc/samba/smbcr_a

Yesterday all worked fine
And today I got:

$ moumix.sh

mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

journalctl says:

May 15 23:23:24 DELLV kernel: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
May 15 23:23:24 DELLV kernel: CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
May 15 23:23:24 DELLV kernel: CIFS: Attempting to mount \\10.160.1.108\mix
May 15 23:23:24 DELLV kernel: CIFS: VFS: cifs_mount failed w/return code = -5

I really need access to very old server.
And I said: vers=1.0

What’s wrong?

If it worked yesterday and there is nothing changed in the software it might be some problem on the NAS. I’ve a very old little NAS connecting to F38. I remember to have added ā€œclient min protocol=NT1ā€ to Fedora’s /etc/samba/smb.conf, but this could be for smbclient and GUI’s using libsmb, but not used for mount.cifs.
Anyhow, since smbclient is fairly good in error messages you can try to connect with it as diagnosis, of course with ā€œ-m NT1ā€, so start with
ā€œsmbclient -L 10.160.1.108 -U yourusername -m NT1ā€ and
ā€œsmbclient //10.160.1.108/mix -U yourusername -m NT1ā€ and see what it tells you.
You need package samba-client on Fedora.

1 Like

At my Androd-phone to access NAS I use TotalCommander + LAN_plug-in
and it still works.

so NAS is ok.

$ smbclient -L 10.160.1.108 -U archer  -m NT1
lp_load_ex: Max protocol NT1 is less than min protocol SMB2_02.
protocol negotiation failed: NT_STATUS_INVALID_PARAMETER_MIX

…

$ smbclient //10.160.1.108/mix -U archer -m NT1
lp_load_ex: Max protocol NT1 is less than min protocol SMB2_02.
sudo sed -i -e "
/^\s*client min protocol =/d
/^\[global\]$/a \\\tclient min protocol = NT1
" /etc/samba/smb.conf

For smbclient. ā€œclient min protocol = NT1ā€ MUST be specified in /etc/samba/smb.conf.
In Fedora 38, mount.cifs seems to work with vers=1.0 even if the client min protocol is not specified.

1 Like

I have the same problem and same error. Mounting an old NAS box using vers=1.0. It happens only with one of the two old NAS units I’m mounting. The error is only with the Netgear ReadyNAS. An old WD MyCloud mounts without error. The problem appears with the new kernel update, 6.2.15-300.fc38.x86_64. Booting with the previous kernel 6.2.14-300.fc38.x86_64 still works correctly.

ok

$ grep -B 1 "client min protocol = NT1" /etc/samba/smb.conf
[global]
        client min protocol = NT1
$ smbclient -L 10.160.1.108 -U archer  -m NT1
Password for [SAMBA\archer]:

        Sharename       Type      Comment
        ---------       ----      -------
        kino            Disk
        H-Foto          Disk
        mix             Disk
$ smbclient //10.160.1.108/mix -U archer -m NT1
Password for [SAMBA\archer]:
Try "help" to get a list of possible commands.
smb: \> dir
  .                                   D        0  Fri Mar 24 19:54:50 2023
  ..                                  D        0  Mon Sep 24 19:05:58 2018
  BackUp                              D        0  Tue Apr 19 15:16:11 2022
  My_HardWare                         D        0  Wed Apr 19 01:00:01 2023
  books                               D        0  Fri May 12 23:00:48 2023

but

$ moumix.sh
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

dmesg says:

[   56.524276] Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers

[   56.524281] CIFS: VFS: Use of the less secure dialect vers=1.0 is not recommended unless required for access to very old servers
[   56.524292] CIFS: Attempting to mount \\10.160.1.108\mix
[   56.582732] CIFS: VFS: cifs_mount failed w/return code = -5

What need I edit in my moumix.sh ?

You are not doing anything wrong. The problem is with the new kernel update. If you boot the previous kernel, it will still work. It’s not an Samba problem. It’s mount.cifs and/or the kernel cifs module that is the problem.

It looks you’re right, smbclient works fine but mount.cifs does not.
Samba version on NAS is 2.2.7b-ja-1.0

You can mount the share via gvfsd-smb with
gio mount smb://server/share and find the result below /run/user/1000/gvfs

1 Like
gio mount smb://10.160.1.108/mix
gio: smb://10.160.1.108/mix/: АГреса не є Š¼Š¾Š½Ń‚Š¾Š²Š°Š½Š¾ŃŽ

I do not know how it put in english
maybe
The address is not mountable

Think, it’s time meets with nfs.

I’m not sure why that didn’t work for you. Do you use gnome? Try in Files (which is nautilus), left side ā€œ+ Other Locationsā€. Then on the right, ā€œConnect to Serverā€ box, enter server address as smb://server/share. If it’s the first time connecting it should ask you for username and password.

If your NAS provides nfs, it should work and is Linux-native

for gvfs, you need some gnome infrastructure, ā€œ/usr/libexec/gvfsdā€ is the supervisor and launches gvfsd-smb if smb:// is accessed.
There is an user systemd service for it, probably launched from GUI or dbus.

Packages to be present are gvfs and gvfs-smb.
If you are running kde or console-only they might not be present.

A very important thing I forgot to mention: gio mounts have to done as user, not via sudo or as root!

@kdowling Confirmed. I cannot mount also a newer samba version (3.6.25,2015) anymore with vers=1.0 and the very latest kernel.

1 Like

Can you try ā€œvers=1.0,nodfsā€ as option to the mount command?

No magic, the server log shows a failed attempt to follow dfs.
It seems to work on my system.

2 Likes

I use LXQt

NAS provides nfs but I never try nfs.
Need to read manuals :slight_smile:

nodfs works, at least for manual mounting.

Need test autofs

Yes, nodfs works. Thanks for finding that!

That would explain it. As h.janssen mentioned, you need the gvfs system installed for it to work. It is installed by default with gnome.

Lucky shot. Since you need an option to switch ā€œdfs followingā€ off it should always have been on. So this is only a workaround for a glitch in the 6.2.15-300 cifs kernel module.

The PCManFM-qt filemanager from LxQT appears to borrow the gvfs system from gnome. May be the gvfs-smb package was missing, or gvfsd was not autostarted, or an attempt was made to mount as root what definitively does not work.

1 Like

Hello

This works here. Thanks!