Error backup to Windows share (CIFS)

NethServer Version: 7.4.1708
Hello,

I want to backup to a Windows 10 machine and I setup the share on the Windows machine and I setup the backup(data) on Nethserver.
I received an error notification from the backup service:

Extract from log file /var/log/backup-data.log:

2017-12-08 01:00:01 - START - Backup data started
2017-12-08 01:00:04 - ERROR - Error while mounting 192.168.18.4:router : mount error(112): Host is down Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
2017-12-08 01:00:05 - ERROR - Event pre-backup-data failed - 1

I investigated the problem and I was not able to mount the share with this command:
mount -t cifs -o username=user,password=password //192.168.18.4/router /mnt/backup/gw
But I was able to mount the share with this command:
mount -t cifs -o username=user,password=password,vers=3.0 //192.168.18.4/router /mnt/backup/gw

How can I make this work from Nethserver?

Istvan

Hi @adv,

Is the IP correct? Windows firewall? Your windows 10 share is called router? Can you reach the share from another machine? Did you try if the mount really works? Create file? I remember a case where mount gave out no error but couldn’t mount properly.

This is also working for me with Windows 10:
mount -t cifs //192.168.1.115/test /mnt/backup -o username=markus,nounix

I have to use username/pasword in backup settings for Windows 10 backup test share tough I gave everyone network and file rights on the share but it’s working.

Sorry for German screenshot…

It’s dirty because updates may erase your changes but the file to change is /etc/e-smith/events/actions/mount-cifs:

$err = qx(/bin/mount -t cifs "//$smbhost/$smbshare" $mntdir -o credentials=$tmp,nounix 2>&1);

On the Windows side everything is fine. After the succesfull mount I’m able to create and see files both on Windows and Nethserver.
This “vers=3.0” is the only difference. Can I make Samba to to use this “vers=3.0” by default?

Istvan

windows 10 dropped support for smb protocol v.1, so you must use the v.3

You may play with client/server min protocol…just an idea…but as I said I can backup to a Windows 10 share from Nethserver without any hack - do you have the latest updates on Nethserver?

https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#CLIENTMAXPROTOCOL

Does backup-data work with this workaround I mentioned in the last thread?

$err = qx(/bin/mount -t cifs “//$smbhost/$smbshare” $mntdir -o credentials=$tmp,**vers=3.0,**nounix 2>&1);

You can start backup manually by just running “backup-data” on command line.

http://docs.nethserver.org/projects/nethserver-devel/en/v7/nethserver-backup-data.html

But how can I prevent overwriting the configuration in case of an update?

Nethserver is writing the config files with templates:

http://docs.nethserver.org/projects/nethserver-devel/en/v7/templates.html

You may create custom templates which are used when rewriting config files.

I will do this. Thank you!

You’re welcome. Please share your custom templates, it may help others.

Meantime I found a way how can be SMB1 enabled in Windows 10. Start PowerShell as Admin:
For SMB v1 Protocol
Detect: Get-WindowsOptionalFeature –Online –FeatureName SMB1Protocol
Disable: Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
Enable: Enable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol
SMB v2/v3 Protocol
Detect: Get-SmbServerConfiguration | Select EnableSMB2Protocol
Disable: Set-SmbServerConfiguration –EnableSMB2Protocol $false
Enable: Set-SmbServerConfiguration –EnableSMB2Protocol $true

More details here: https://support.microsoft.com/en-sg/help/2696547/how-to-detect-enable-and-disable-smbv1-smbv2-and-smbv3-in-windows-and

1 Like