[HOWTO] Update samba (to 3.6.25) using Entware-ng

Marvell Kirkwood based
Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

[HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by Mijzelf » Tue Nov 07, 2017 4:17 pm

Install
Install Entware-ng the normal way, as zypkg or as self-containing USB stick, doesn't matter.

Then open a root shell, and execute

Code: Select all

opkg update
opkg install zyxel-samba-replacement
chmod a-x /opt/etc/init.d/S08samba
/opt/etc/init.d/S09ZyXELSambaReplacement start
That's it.

How it works
The package zyxel-samba-replacement is dependent on samba36-server, which is automatically installed either (if it wasn't installed yet).

The startscript
  • Stops the firmware samba by executing '/etc/init.d/samba.sh stop'
  • Replaces the firmware script /etc/init.d/samba.sh by a script which starts Entware-ng samba, with /opt/etc/samba/ZyXELSambaReplacement.conf as configuration file.
  • Starts the Entware-ng samba daemon by executing '/etc/init.d/samba.sh start'
  • Creates a symlink /var/run/smbs.pid and -/nmbd.pid, which points to the pid files of the new samba daemon, so the the firmware knows where to sent it's HUP signal when the configuration changes.
The configuration file /opt/etc/samba/ZyXELSambaReplacement.conf only contains

Code: Select all

[Global]
max protocol = SMB2

include = /etc/samba/smb.conf
'max protocol = SMB2' enables the SMB2 protocol (the very reason you want this, I guess), and it includes the firmware config file, which is dynamically generated.
Of course you can add your own configuration lines, if you want.

Reverting
Basically

Code: Select all

/opt/etc/init.d/S09ZyXELSambaReplacement stop
chmod a-x /opt/etc/init.d/S09ZyXELSambaReplacement
will stop the daemon, start firmware samba, and disable the startscript, so it won't startup on reboot.

But of course uninstalling Entware-ng will do the job either.

Firmware 5+
Although the script runs fine on firmware 5+, I didn't add it to the armv7 repository. Firmware 5+ already runs samba 4.1.7, so installing 3.6.25 would be a downgrade.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by barmalej2 » Tue Nov 07, 2017 4:35 pm

You are reading my minds. I am planning to do the same for ffp after finishing toolchain update.
This topic is worth to be sticky.

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by Mijzelf » Wed Nov 08, 2017 7:03 am

barmalej2 wrote:You are reading my minds.
I'm sorry. You are thinking so loud, I couldn't help it.
I am planning to do the same for ffp
Good plan. For FFP a new samba is available, I guess?

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by MrDini » Sun Dec 10, 2017 12:51 pm

Hi,

First of all, thanks for all your hard work Mijzelf. Much appreciated. :)

However, there is a little typo in the tutorial. The SambaReplacement start command should be the following:

Code: Select all

/opt/etc/init.d/S09ZyXELSambaReplacement start
Otherwise it throws a not found error logically, because there is no ZyXELSambaReplacement file.

And one more thing. On start it gives me this:

Code: Select all

Stopping Samba daemons: nmbd smbd.
mv: cannot stat '/opt/var/lock/*': No such file or directory
And there is a small mistype in the start script itself. Because it says starting on stop and stopping on start.

Code: Select all

root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement stop 
Starting Samba daemons: nmbd smbd.
root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement start
Stopping Samba daemons: nmbd smbd.
Anyways, it works well. Many thanks. :)
Last edited by MrDini on Sat Dec 23, 2017 11:27 pm, edited 1 time in total.
Thanks nas-central the lot of help! :)

Mijzelf
Posts: 6226
Joined: Mon Jun 16, 2008 10:45 am

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by Mijzelf » Sun Dec 10, 2017 1:39 pm

MrDini wrote: However, there are a little typo in the tutorial. The SambaReplacement start command should be the following:

Code: Select all

/opt/etc/init.d/S09ZyXELSambaReplacement start
Thanks. Changed it.
And there is a small mistype in the start script itself. Because it says starting on stop and stopping on start.

Code: Select all

root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement stop 
Starting Samba daemons: nmbd smbd.
root@NSA320S:~# /opt/etc/init.d/S09ZyXELSambaReplacement start
Stopping Samba daemons: nmbd smbd.
If you disable SambaReplacement, the script starts the firmware samba, and vice versa. That's what you see here.
And one more thing. On start it gives me this:

Code: Select all

mv: cannot stat '/opt/var/lock/*': No such file or directory
That's a one-timer. On start it removes /opt/var/lock/, and creates a symlink to /var/lock instead (which is in initrd, a ramdrive). That is permanent. But before it does so, it first move the content of /opt/var/lock/ to /var/lock. In your case /opt/var/lock/ happened to be empty. That's all.
(BTW, I am aware that it's not safe to move the contents of /opt/var/lock/ to another filesystem. If could break a lock. But it's only one time, and I couldn't find an easy safe way.)

dobosz23
Posts: 9
Joined: Sun Dec 17, 2017 3:47 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by dobosz23 » Wed Dec 20, 2017 8:31 pm

It work`s but i see there is problem with shares - original shares goes on:

/voloume_name and /admin

and in replacement goes on:

/volume_name/admin

File browser not working in playzone or Android Zyxel file browser.

Is anyone fix this - i search for solution but i don`t have any success.

dobosz23
Posts: 9
Joined: Sun Dec 17, 2017 3:47 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by dobosz23 » Sat Dec 23, 2017 2:49 pm

I have a answer on my own problem:

- add new user is a solution for everyfing NSA see it and android manager also.

For admin i have any idea.

keiths
Posts: 3
Joined: Mon Jan 01, 2018 7:20 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by keiths » Mon Jan 01, 2018 7:48 pm

I have a similar problem, and a new one.

I'm using my old NSA310 with Windows 10 PCs. The update successfully changed Samba from 3.5.6 to 3.6.25, and the SMB version from 1.5 to 2.0.2. Alas I could not connect to any user shares, only to Public, even if the user shares were set to public access.

I wondered whether the max protocol = SMB2 addition should be min protocol = SMB2, and certainly could not see it appear in the final .conf file, but get-smbconnection did show it was using SMB2.

Removing Entware-ng restored things back to normal.

Changing access permissions, and adding a new user and a new share seemed to make no difference.

It also refused to let copy files from the original share to the new share in the Share Browser - which I could do when Entware-ng was removed.

As a seperate issue, having proved that it was using SMB2, I removed SMB1 capability for Windows 10 - and ncould not see the NAS.

I'm a Linux novice and learnt a lot while poking around! Thanks for the guide - it took me a while but I got there.

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by barmalej2 » Tue Jan 02, 2018 10:53 am

SMB 2.1 and SMB3 dialects support was added since samba 4.0.0 release, besides the minimum kernel version for SMB3 support is 3.12 (for SMB2.1-kernel version 3.07)required (3.18 prefered), while NSA310 has old 2.6.31.8. AFAIK, samba 3.x.x.x and samba 4.x.x.x configs are not intercompatible, so I believe it was the main reason, why Mijzelf choosen 3.6.25 for ZyXel samba replacement. Conclusion is, that your NAS can't operate at higher than SMB2 dialect (protocol), so changing max protocol = SMB2 to min protocol = SMB2 will have no influence from mine point of view.
I wonder to know, if your problem is Windows 10 related. Particularly, if I clearly remember, anonymous (guest) logins for SMB2 are disabled in Windows 10 smb client (even smb server advertise and allows that) since Fall Creators update, which pissed a lot of Windows 10 users, leaving them to unable to use shared network resources, without user name and password.
If you have ability to connect to NAS shares from Windows 7 or Windows 8, 8.1 (having installed updated samba 3.6.25 on NAS), it would confirm my suspicions.
You can check your current Windows 10 smb client configuration via Powershell:

Code: Select all

Get-SmbClientConfiguration

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by MrDini » Tue Jan 02, 2018 11:01 am

He Can access the public share if I clearly understood him. One of my users also reported that bug. Some Windows clients Can access the secured shares (not just public), while some clients just asks for the passwd again and again.

I think we should disable spnego first:

Code: Select all

client use spnego = no
Thanks nas-central the lot of help! :)

keiths
Posts: 3
Joined: Mon Jan 01, 2018 7:20 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by keiths » Tue Jan 02, 2018 8:29 pm

SMB Client Config
ConnectionCountPerRssNetworkInterface : 4
DirectoryCacheEntriesMax : 16
DirectoryCacheEntrySizeMax : 65536
DirectoryCacheLifetime : 10
DormantFileLimit : 1023
EnableBandwidthThrottling : True
EnableByteRangeLockingOnReadOnlyFiles : True
EnableInsecureGuestLogons : True
EnableLargeMtu : True
EnableLoadBalanceScaleOut : True
EnableMultiChannel : True
EnableSecuritySignature : True
ExtendedSessionTimeout : 1000
FileInfoCacheEntriesMax : 64
FileInfoCacheLifetime : 10
FileNotFoundCacheEntriesMax : 128
FileNotFoundCacheLifetime : 5
KeepConn : 600
MaxCmds : 50
MaximumConnectionCountPerServer : 32
OplocksDisabled : False
RequireSecuritySignature : False
SessionTimeout : 60
UseOpportunisticLocking : True
WindowSizeThreshold : 8

I will dig out an old Win 7 pc and try and will report back.

Where does the spnego command go - in the amended .conf file (with the include...)?
I confirm that I can connect to Public shares but not to User shares (no matter what access rights are set). No username/password combination appears to be accepted.

Thanks for the guidance!

User avatar
MrDini
Posts: 651
Joined: Mon Dec 21, 2015 7:21 pm
Contact:

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by MrDini » Tue Jan 02, 2018 8:34 pm

Append that line under the [global] for example in the ZyXELSambaReplacement.conf file.

And restart the samba.
Thanks nas-central the lot of help! :)

barmalej2
Posts: 2395
Joined: Sun Apr 29, 2012 5:24 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by barmalej2 » Wed Jan 03, 2018 6:06 am

keiths wrote:EnableInsecureGuestLogons : True
You don't have Fall Creators update installed, either way it would be set to False. So, that is not the case I suspected.

dobosz23
Posts: 9
Joined: Sun Dec 17, 2017 3:47 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by dobosz23 » Wed Jan 03, 2018 9:28 pm

I have that same configuration with Get-SmbClientConfiguration and on my Windows 10 and Samba works fine - I think that this may be the setting of your network cause. Have you checked your advanced settings for forwarding networks, files, printers - do you see everything?

keiths
Posts: 3
Joined: Mon Jan 01, 2018 7:20 pm

Re: [HOWTO] Update samba (to 3.6.25) using Entware-ng

Post by keiths » Sun Jan 07, 2018 6:21 pm

Ok ... I have tried all suggestions above to no avail. I've added the client use spnego = no in the ZyXELSambaReplacement.conf file, rebooted and no effect.
With Windows 7 I get Error code 0x800704b3 The network path was either typed incorrectly or does not exist or the network provider is not currently available. Please try retyping the path or contact your network administrator.

With Windows 10 (several PCs) the error is 0x80070043 The network path name can not be found.

\\NSA310\Public connects on both, browsing to (or connecting as a shared drive, even with alternative account) the indiviual user share gives the error. The share was Keith - I changed it to keith to match other share names - no difference, so it is not case-sensitive.

Reverting the Samba update as described above restored the ability to connect. I'm a career computing tester and have an inbuilt ability to trip over bugs (I wish I coud switch it off), so this will be something obscure!

Network is via a BTHub6, non-domain, no workgroup, indivual local accounts on PCs using identical credentials to the user set up on the NSA310. Attempting to connect using the admin account behaves the same. Turning off Norton Firewall on Windows 10 made no difference - Windows 7 didn't have it.

All Windows 10 PCS are latest and greatest(?) versions.

Thanks for trying! Any further ideas...? Thanks, Keith

Post Reply