Welcome! Log In Create A New Profile

Advanced

Zyxel NSA325v2 - uBoot flashed but Debian not booting

Posted by barkingbarky 
Zyxel NSA325v2 - uBoot flashed but Debian not booting
July 30, 2020 03:53PM
Dear experts,

I have a problem with my Zyxel NSA325v2 after uBoot Update to "U-Boot 2017.07-tld-1"

After the flash-procedure and after rebooting the device I always get the message "Unknown command 'host'":


U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:42:03 -0700)
ZyXEL NSA325 2-Bay Power Media Server
SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
WARNING: Caches not enabled
NAND:  128 MiB
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
Unknown command 'host' - try 'help'
Unknown command 'host' - try 'help'

and debian is not booting.

Environment Data via printenv:
arcNumber=4495
baudrate=115200
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=host1 host0
bootcmd=run distro_bootcmd
bootcmd_host0=setenv devnum 0; run host_boot
bootcmd_host1=setenv devnum 1; run host_boot
bootdelay=2
bootm_size=0x10000000
devnum=0
distro_bootcmd=setenv scsi_need_init; for target in ${boot_targets}; do run bootcmd_${target}; done
eth1addr=00:00:11:22:33:45
eth3addr=00:00:11:22:33:46
eth5addr=00:00:11:22:33:47
ethact=egiga0
ethaddr=xx:xx:xx:xx:xx:xx (address cleared by me)
fdt_addr_r=0xc00000
host_boot=if host dev ${devnum}; then setenv devtype host; run scan_dev_for_boot_part; fi
ipaddr=1.2.3.4
kernel_addr_r=0x1000000
mtdparts=orion_nand:1M(u-boot),4M(uImage),32M(rootfs),-(data)
pxefile_addr_r=0x2000
ramdisk_addr_r=0x2000000
sata_boot=if sata dev ${devnum}; then setenv devtype sata; run scan_dev_for_boot_part; fi
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x1000
scsi_boot=run scsi_init; if scsi dev ${devnum}; then setenv devtype scsi; run scan_dev_for_boot_part; fi
scsi_init=if ${scsi_need_init}; then setenv scsi_need_init false; scsi scan; fi
stderr=serial
stdin=serial
stdout=serial
virtio_boot=if virtio dev ${devnum}; then setenv devtype virtio; run scan_dev_for_boot_part; fi

Environment size: 2437/131068 bytes

If I enter the following instructions:
usb start  
 ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr  
 source 0x800000  
 printenv  
 setenv devices 'usb ide'  
 setenv dtb_file '/boot/dts/kirkwood-nsa325.dtb'  
 setenv ethaddr xx:xx:xx:xx:xx:xx   (address cleared by me)
 boot

debian is booting and I can login:

Debian GNU/Linux 10 debian ttyS0

debian login: root
Password: 
Last login: Wed Dec 31 16:01:16 PST 1969 on ttyS0
Linux debian 5.2.9-kirkwood-tld-1 #1 PREEMPT Sat Aug 17 15:00:56 PDT 2019 armv5tel

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Check of USB Stick (Ubuntu Terminal):

ls -lart

drwxr-xr-x  11 root root     4096 Jan  1  1970 var
drwxr-xr-x   2 root root     4096 Jan  1  2011 sys
drwxr-xr-x   2 root root     4096 Jan 22  2012 proc
drwxr-xr-x   2 root root     4096 Jan 22  2012 home
drwx------   2 root root    16384 Feb 24  2012 lost+found
drwxr-xr-x  10 root root     4096 Feb 24  2012 usr
drwxr-xr-x   2 root root     4096 Feb 24  2012 srv
drwxr-xr-x   2 root root     4096 Feb 24  2012 opt
drwxr-xr-x   5 root root     4096 Feb 24  2012 dev
drwxr-xr-x   2 root root     4096 Feb  8  2013 run
drwxr-xr-x   2 root root     4096 Feb 10  2015 mnt
drwxr-xr-x   2 root root     4096 Aug 25  2019 bin
drwxr-xr-x   2 root root     4096 Aug 25  2019 sbin
drwxr-xr-x  13 root root     4096 Aug 25  2019 lib
drwxr-xr-x   3 root root     4096 Jul 29 13:18 boot
drwx------   5 root root     4096 Jul 29 21:46 root
-rw-r--r--   1 root root  1048576 Jul 29 21:48 mtd0
-rw-r--r--   1 root root  4194304 Jul 29 21:48 mtd1
-rw-r--r--   1 root root 33554432 Jul 29 21:48 mtd2
-rw-r--r--   1 root root 95420416 Jul 29 21:48 mtd3
-rw-r--r--   1 root root     2298 Jul 29 21:49 current_envs.txt
drwxr-xr-x  21 root root     4096 Jul 29 22:04 .
drwxr-xr-x   3 root root     4096 Jul 29 22:29 media
drwxrwxrwt   2 root root     4096 Jul 30 22:39 tmp
drwxr-xr-x  57 root root     4096 Jul 30 22:39 etc
drwxr-x---+  4 root root     4096 Jul 30 22:45 ..


May someone help me please?



Kind regards
Mark



Edited 2 time(s). Last edit at 07/30/2020 03:56PM by barkingbarky.
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
July 30, 2020 05:29PM
Hi Mark,

You did not flash the env image in Step 8

Quote

8. Flashing default u-boot envs image (if you are upgrading from 2016.05-tld-1 u-boot, you can skip this step 8).

But you have got around that by loading the correct envs script in serial console. Which is equivalent to flashing it to NAND during installation.

So at serial console, when you do these commands:

usb start  
 ext2load usb 0:1 0x800000 /boot/uboot.2016.05-tld-1.environment.scr  
 source 0x800000  
 printenv  
 setenv devices 'usb ide'  
 setenv dtb_file '/boot/dts/kirkwood-nsa325.dtb'  
 setenv ethaddr xx:xx:xx:xx:xx:xx   (address cleared by me)

Do a saveenv before booting.

saveenv
boot

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
July 31, 2020 01:48PM
Dear bodhi,

thanks a lot for your fast reply. I'm pretty sure that I flashed the environment data. But something went wrong.
After "saveenv" debian boots. Thanks for this "workaround". I was uncertain how to fix it and if I need to reflash the device. Thus I raised this topic in the forum.

One issue is left:

I get 6 times the message:

## Unknown partition table type 0

just before
loading envs from USB 0 ....

How can I fix it?

One general question to the usage of USB memory sticks:
I want to install open media vault and I heard about the recommendation to use an SSD drive instead of a normal memory stick (due to the high amount of write access). What's your experience?

Kind regards and thanks a lot!
Mark



Edited 1 time(s). Last edit at 07/31/2020 01:49PM by barkingbarky.
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
July 31, 2020 05:13PM
Mark,

> ## Unknown partition table type 0
>

This is OK. The combination of envs disks and devices results in the number of partitions that u-boot will scan to find the kernel files to load. It will report that these partitions are not found. But the error messages are not very accurate (it's that way in the code).
devices=usb ide
disks=0 1 2 3
If you want to make it less noisy, change the disks env to a smaller number. But I would not do that, in case you have multiple drives plugged in, you will even need to increase this number to make sure u-boot find the kernel files successfully.

> just before
>
> loading envs from USB 0 ....
>

This is u-boot scanning the USB drive to find uEnv.txt. It is useful for rescue purpose (when you don't have serial console connected). That's activity from the env bootcmd_uenv.

Again, it will not be a problem to see it fails to find the uEnv.txt. But it you want to reduce the noise, then you can no-op it by setting it to some thing like this:

setenv bootcmd_uenv 'echo Not loading uEnv.txt'

> One general question to the usage of USB memory
> sticks:
> I want to install open media vault and I heard
> about the recommendation to use an SSD drive
> instead of a normal memory stick (due to the high
> amount of write access). What's your experience?

Definitely. Using SDD is preferred, especially with OMV.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
August 06, 2020 01:58PM
Dear bodhi,

thanks a lot for your help. I've already learned a lot during this project. Debian and OMV is running now on a SSD and I'm happy about my new NAS. :-)

Only the samba performance is pretty bad. I only have a transfer rate of ~ 27MByte/sec.

1Gbit Ethernet is set up and the internal WD RED drive has a higher transfer rate. Do you have a hint for me how to raise the performance?

Kind regards
Mark
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
August 06, 2020 10:36PM
Mark,

"1Gbit Ethernet is set up and the internal WD RED drive has a higher transfer rate. Do you have a hint for me how to raise the performance? "

Eventhough you know it is Gbit ethernet, and WD Red. Still you should run these 2 tests to confirm that they are OK.

1. iperf test

https://forum.doozan.com/read.php?2,33321,33547#msg-33547

2. dd tests

https://forum.doozan.com/read.php?2,28829,28830#msg-28830

3. And then check your smb.config against my version (pay attention to the TCP parameters). It might not be the best, but it should help.

https://forum.doozan.com/read.php?8,23223,23293#msg-23293

Quote

# You may want to add the following on a Linux system:

socket options = IPTOS_LOWDELAY TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=131072 SO_SNDBUF=131072
use sendfile = yes
write cache size = 2097152

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
August 11, 2020 03:02PM
Dear bodhi,

sorry for the late reply. My Backup HDD (Samsung HD204UI) crashed and I had to mount the WD RED NAS drive to my computer in order to perform a backup of my data first.

Some information about my PC:
Ubuntu machine:

uname -ar:

Linux administrator-P5E-VM-HDMI 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

ethtool -a eth0:

Pause parameters for eth0:
Autonegotiate:	on
RX:		on
TX:		on


First iperf test

Zyxel NSA:
iperf -s

Ubuntu PC:
iperf -c 192.168.1.239

First Test Result on Ubuntu machine:
[  3] local 192.168.1.185 port 35074 connected with 192.168.1.239 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec   844 MBytes   707 Mbits/sec

Second iperf test:


Ubuntu PC:
iperf -s

Zyxel NSA:
iperf -c 192.168.1.185

Second Test Result on Ubuntu machine:
[  4] local 192.168.1.185 port 5001 connected with 192.168.1.238 port 54844
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-10.0 sec   838 MBytes   702 Mbits/sec

The "dd tests" and the "smb.conf tuning" are the next tests. I will perform these tests in the next days.

Thanks a lot for your support!

Kind regards
Mark
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
August 15, 2020 02:58PM
Update:

Bigfile (512mB) Ubuntu <==> SMB-Share:

Orignal smb.conf

Push:
real 0m15,420s
user 0m0,004s
sys 0m1,033s


Pull:
real 0m12,168s
user 0m0,000s
sys 0m1,213s


Update of smb.conf according to your proposal:

Push:
real 0m12,663s
user 0m0,000s
sys 0m0,764s


Pull:
real 0m7,401s
user 0m0,008s
sys 0m1,346s

Additional question from my side:
Since the installation of OMV I have 2 IP addresses for my NAS:

eth0: 192.168.1.238
eth0: 192.168.1.239

If I enter the first IP address in my browser the German Config Page of OMV is opened and when using the second address the English Config Page is opened.

My current /etc/network/interfaces

# This file is auto-generated by openmediavault (https://www.openmediavault.org)
# WARNING: Do not edit this file, your changes will get lost.

# interfaces(5) file used by ifup(8) and ifdown(8)
# Better use netplan.io or systemd-networkd to configure additional interface stanzas.

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto eth0
iface eth0 inet dhcp

Directory interfaces.d is empty....

Any idea why I have 2 IP addresses?



Edited 2 time(s). Last edit at 08/15/2020 03:57PM by barkingbarky.
Re: Zyxel NSA325v2 - uBoot flashed but Debian not booting
August 15, 2020 04:22PM
Hi Mark,

Benchmarks looks very good, apparently a big improvement!

This box has only 1 ethernet port. You should have only one IP address. I'm not familiar with OMV, so not sure if that was because of OMV or not.

However, you could post the entire serial boot log here, so I can see if there is anything peculiar or not. The entire serial boot log mean from the U-Boot banner, until the Debian login prompt.

Quote

U-Boot 2017.07-tld-1 (Sep 05 2017 - 00:42:03 -0700)
...

debian:

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: