NSA325v2 - Entware-ng - SAMBA - no samba after hot NAS restart

aldapooh
aldapooh Posts: 66  Ally Member
First Comment Friend Collector Second Anniversary Community MVP

Hi dear ZyXEL NAS community,

i have NSA325v2 with enabled Entware-ng with SAMBA running.

Everything worked for 6 months with no problems.

And then yesterday I did a hot restart of my NSA325v2 via front button "Power" as I could not reach out neither NAS web interface nor Twonky web-page.

After that I noticed that SAMBA does not work anymore. But web-interface and Twonky work fine.

This is what I see in Entware-ng logs every time I try to restart my NAS.

Opened logfile at Sat Jun 15 13:59:51 CEST 2024
Flushing memory buffer
    Starting up
    rm /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.9.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.8.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.9.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.7.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.8.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.6.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.7.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.5.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.6.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.4.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.5.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.3.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.4.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.2.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.3.gz
    mv /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.1.gz /usr/local/zy-pkgs/opt/var/log/Entware-ng.log.2.gz
Flushing done
[13:59:51] Create symlink /opt -> /usr/local/zy-pkgs/opt
[13:59:51] Execute /opt/etc/init.d/rc.unslung start
[13:59:53]     Stopping Samba daemons: nmbd smbd.
[13:59:53] Done /opt/etc/init.d/rc.unslung start
Closed logfile at Sat Jun 15 13:59:54 CEST 2024

any help and advise is more than welcome!

-A

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,790  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary
    Answer ✓

    it seems there were two files blocking start of SAMBA in /opt/var/run

    I mentioned that files in this post. And yes, these prevent the Entware samba from starting, after having stopped firmware samba.

    Please note - those two files above survived the factory reset.

    That's right. Of course the 'factory' doesn't know anything about Entware, and will not reset anything. It only disables Entware in it's entirety.

    Surprisingly in Win 11 Explorer when connecting via SAMBA to the mapped
    drive I can see shares both directly on NAS root and under volume1. I am
    not sure if this supposed to work this way.

    you must clearly distinguish 'shares' and 'directories' (or 'maps' in MS lingo). A share is something which is shared by a network filesystem. A directory is a 'normal' filesystem thing. In explorer you see all shares, directly under NSA325. The subdirectories in 'Volume1' are subdirectories. not shares.

    Those subdirectories happen to be shared either, but that is just a coincidence. If you 'unshare' one of the user made shares, they are still in 'Volume1'.

    The 'Volume1' share is a share which spans the whole disk, and is for that reason only accessible by admin. The reason for this share is (I think) to be able to move data fast between shares. When you move a file from one subdirectory to another within the same share, it's only administrative. If you would move the same file between two shares, it will be downloaded and uploaded. The client has no way to see that both shares are in the same filesystem (or even on the same computer).

«1345

All Replies

  • aldapooh
    aldapooh Posts: 66  Ally Member
    First Comment Friend Collector Second Anniversary Community MVP

    opsie… it looks like my problem is even more serious than Samba missing.

    when logging via WinSCP I cannot see any folder on NAS325v2. I land in empty root folder…

    the same is even true when I use File Browser from Zyxel itself. I can see only name of my shares but they seem to be empty…

    what interesting is that Twonky is still showing all folders and content.

    the same - i can see my files - when logging via Putty under admin

    I have no idea what I have done

  • Mijzelf
    Mijzelf Posts: 2,790  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary

    Hm. Fishy. If you can see your files in an ssh shell, they are there. For the File Browser I'd think there is a corruption, somewhere. You know, in the File Browser you don't see the whole filesystem, only a subset, just like in Samba. For Samba that subset is defined in /etc/samba/smb.conf, for File Browser I don't know. But it is somehow generated from stored user settings.

    WinSCP is supposed to show the whole filesystem. Which ssh server are you using? The ZyXEL package?

    Does the webinterface look normal, especially the shares menu?

  • aldapooh
    aldapooh Posts: 66  Ally Member
    First Comment Friend Collector Second Anniversary Community MVP

    Hello Mijzelf, and thank you for your comments and thoughts.

    I double checked the Share in Web Admin Interface and they are there. If I click from Shares screen "Share Browser" I can see content. But not from File Browsers or WinSCP.

    Speaking of ssh server, I do not recall installing anything additional. I only installed Entware-ng and Samba replacement a half year ago and it worked fine.

  • aldapooh
    aldapooh Posts: 66  Ally Member
    First Comment Friend Collector Second Anniversary Community MVP

    this is how the log of starting NAS look like after restart.

    49

    2024-06-15 14:01:01

    built-in-service

    info

    Auto daylight saving setting: SUCCESS

    50

    2024-06-15 14:01:01

    system

    info

    NTP updates successfully from de.pool.ntp.org

    51

    2024-06-15 13:59:47

    system

    info

    Modify Auto Power-On Setting: SUCCESS

    52

    2024-06-15 13:59:46

    system

    notice

    An external USB hub device is plugged.

    53

    2024-06-15 13:59:33

    built-in-service

    notice

    FTP server starts with TLS mode

    54

    2024-06-15 13:59:33

    system

    info

    NTP updates successfully from de.pool.ntp.org

    55

    2024-06-15 13:59:29

    built-in-service

    info

    FTP port has changed to 21

    56

    2024-06-15 13:59:29

    built-in-service

    info

    Auto daylight saving setting: SUCCESS

    57

    2024-06-15 13:59:28

    built-in-service

    notice

    The NTP service is enabled

    58

    2024-06-15 13:59:28

    built-in-service

    info

    Clock timezone is set to GMT+0100

    59

    2024-06-15 13:59:28

    built-in-service

    notice

    NTP server is set to 'de.pool.ntp.org'

    60

    2024-06-15 13:59:28

    interface

    notice

    Network port is disabled

    61

    2024-06-15 13:59:26

    interface

    notice

    Network Config setting is changed

    62

    2024-06-15 13:59:23

    system

    notice

    DNS server address is changed to be given from DHCP server

    63

    2024-06-15 13:59:23

    system

    notice

    DNS server setting is changed

    64

    2024-06-15 13:59:21

    system

    notice

    Hostname is set to <servername>.

    65

    2024-06-15 13:59:12

    built-in-service

    notice

    FTP server stops

  • aldapooh
    aldapooh Posts: 66  Ally Member
    First Comment Friend Collector Second Anniversary Community MVP

    when I am looged via Putty and switch to su user

    i try to execute :

    ~ # /etc/init.d/samba.sh restart
    sh: can't kill pid 27489: No such process
    sh: can't kill pid 27492: No such process

    but when I run ~ # /etc/init.d/samba.sh start
    no errors returned

    could it be that something stops samba from running?

    I tried to disable and enable Entware-ng

    I run again this script
    su
    opkg update
    opkg install zyxel-samba-replacement # will automatically pull the samba server

    # disable the Entware-ng samba server and script
    /opt/etc/init.d/S08samba stop
    chmod a-x /opt/etc/init.d/S08samba

    # enable and start the replacement script
    chmod a+x /opt/etc/init.d/S09ZyXELSambaReplacement
    /opt/etc/init.d/S09ZyXELSambaReplacement start

    did not help so far

  • Mijzelf
    Mijzelf Posts: 2,790  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary

    could it be that something stops samba from running?

    Yes. If samba thinks it is already running, it won't start. To detect that, it looks at a pid file, which is problably created in /opt/var/, or /opt/var/lock. On termination samba should remove that file, but on a hard reboot it can't.

    Speaking of ssh server, I do not recall installing anything additional. I
    only installed Entware-ng and Samba replacement a half year ago and it
    worked fine.

    The 325 doesn't have an ssh server by default. There are at least three ways to get it, a ZyXEL package (called 'ssh server', when I recall well), a 3th party package 'dropbear', and an Entware package. If it was an Entware package I would have seen that in your log, I suppose. So then remain a ZyXEL or 3th party package. (Of course there are more ways to get an ssh server, but then you would have known that)

    The big difference between those packages is the dropbear is a single binary with an scp server included, while the ZyXEL package is the 'full thing', openssh with a sftp plugin. The plugin somehow can get damaged, I suppose, while the single binary wouldn't start at all.

  • aldapooh
    aldapooh Posts: 66  Ally Member
    First Comment Friend Collector Second Anniversary Community MVP

    Hmm…

    1) do I need install SSH server (like a dropbear) for further investigation?
    I have dropbear as part of Entware , but I do not know how to install it… any hint as I only have Putty access?

    or

    2) will a factory reset can help?

    Thanks!

    -A

  • Mijzelf
    Mijzelf Posts: 2,790  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary
    1. No. You already have an ssh server installed. Both PuTTY and WinSCP connect to that. I was just trying to find a reason how WinSCP could show up empty.
    2. A factory reset will solve this, unless it is caused by a filesystem error on the data volume. After the reset you'll have to re-enable the Entware package.

  • aldapooh
    aldapooh Posts: 66  Ally Member
    First Comment Friend Collector Second Anniversary Community MVP

    Hi,

    I am not sure that SSH is there on my NAS.

    When using Putty I connect via Telnet. SSH did not work for quite some time. Maybe even never worked before.

    The affected NAS is NSA325v2 with Firmware NSA325_4.81(AAAJ.1)

    PS we had a related thread for SSH back in 2023 and I never install it on NSA325 see:

    And my question would be how to install dropbear of "official" SSH if avialable when currently I only have Telnet available.

    Thanks again, million times.

  • Mijzelf
    Mijzelf Posts: 2,790  Guru Member
    250 Answers 2500 Comments Friend Collector Seventh Anniversary

    how to install dropbear of "official" SSH if avialable

    Do you have MetaRepository installed? In that case dropbear should be in your list of installable packages. If not, install the Entware one:

    su
    opkg install dropbear
    

    Maybe you'll have to enable and start it:

    chmod a+x /opt/etc/init.d/S51dropbear
    /opt/etc/init.d/S51dropbear start

    when currently I only have Telnet available.

    That is still a mystery, isn't it? Where does that telnet come from? If you execute

    su
    netstat -lptn
    

    there will be a line with 0.0.0.0:23 in it. The last column of this line shows the pid/programname of the process having that port open. If you then execute

    cat /proc/<pid>/cmdline
    

    you'll see the full path of the telnet binary, and it's commandline arguments. It might give a hint.

Consumer Product Help Center