Welcome! Log In Create A New Profile

Advanced

Zyxel NAS326 - Debian / Boot from USB?

Posted by Kirsch 
Re: Zyxel NAS326 - Debian / Boot from USB?
May 08, 2017 06:55PM
pengu Wrote:
-------------------------------------------------------
> SAMBA performance .. it needs some tweaking on Kir
> kwood boxes ... here .. one line is enough ...
>
>
> min receivefile size = 128k
>
>
> 103 mb/s read ... 98 mb/s write ... (windows 10)
> a little more on my Gentoo Linux box
>
Unfortunately does not make any difference for me.
Re: Zyxel NAS326 - Debian / Boot from USB?
May 08, 2017 11:56PM
Re: Zyxel NAS326 - Debian / Boot from USB?
May 08, 2017 11:58PM
Re: Zyxel NAS326 - Debian / Boot from USB?
May 09, 2017 06:15AM
Johannes,

Looks like you've missed several fw_setenv commands:

Instruction:
fw_setenv curr_bootfrom 1
fw_setenv next_bootfrom 1
fw_setenv load_dtb_addr 0x1000000
fw_setenv load_initrd_addr 0x2900000
fw_setenv load_image_addr 0x02000000
fw_setenv usb_init 'mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start'
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
fw_setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
fw_setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
fw_setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'
fw_setenv bootcmd_custom 'if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
fw_setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
fw_setenv change_boot_part 1

You did not execute these:
fw_setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
fw_setenv bootcmd_stock_2 'run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
fw_setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/zImage; ext2load usb 0:1 $load_dtb_addr /boot/dts/armada-380-zyxel-nas326.dtb; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootz $load_image_addr $load_initrd_addr $load_dtb_addr'

You have 2 options:

1. Connect serial console.

2. Request the FW restore tarball from Zyxel. Hopefully, you can format a USB drive and put the restore script and binaries on that. Power up with the restore USB plugged in. See if this rescue mechanism works. We have not tried this option before, so it is good thing that you can find out one way or the other!

Further thought:

If you can't get a restore USB tarball from Zyxel, and can't connect serial console, I will need to look in to my saved tarball and see if I can find something might perform the rescue.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 05/09/2017 06:17AM by bodhi.
Re: Zyxel NAS326 - Debian / Boot from USB?
May 09, 2017 06:26AM
Hi bodhi!

Thanks, I will try the serial console later on. I have to setup either the Atmel STK500 or my raspberry as UART 3.3V<->Serial converter first but both should work.

And I will try to be more careful with the commands next time...

Regards,
Johannes
Re: Zyxel NAS326 - Debian / Boot from USB?
May 09, 2017 06:35AM
> have to setup either the Atmel STK500 or my raspbe
> rry as UART 3.3V<->Serial converter first but both
> should work.

It's the best way to have full control!

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
May 09, 2017 11:58AM
bodhi Wrote:
-------------------------------------------------------
> Then pengu should post his smb.conf.



as I said .. it only needs that line in the smb.conf:

min receivefile size = 128k

All other stuff makes it worse
Re: Zyxel NAS326 - Debian / Boot from USB?
May 09, 2017 12:25PM
Re: Zyxel NAS326 - Debian / Boot from USB?
May 10, 2017 04:16PM
Hi bodhi!

Thanks for your help. I connected the serial console throw the stk500 (be sure to set vtarget to 3.3V) and followed the instructions. Linux is now booting...

Thanks,
Johannes
Re: Zyxel NAS326 - Debian / Boot from USB?
May 10, 2017 04:26PM
gonzales Wrote:
-------------------------------------------------------
> Hi bodhi!
>
> Thanks for your help. I connected the serial conso
> le throw the stk500 (be sure to set vtarget to 3.3
> V) and followed the instructions. Linux is now boo
> ting...
>
> Thanks,
> Johannes

Cool :)

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
May 11, 2017 07:14PM
pengu Wrote:

> as I said .. it only needs that line in the smb.co
> nf:
>
>
> min receivefile size = 128k
>
>
> All other stuff makes it worse

This option not make much difference in my case. As example I used the trimmed down smb.conf from the wiki.
See the attached screenshots for the results in a usage scenario with my Win8.1 desktop PC and a testfile of 10GB size.



Edited 1 time(s). Last edit at 05/11/2017 07:15PM by sebr.
Attachments:
open | download - toNAS.jpg (50.3 KB)
open | download - toPC.jpg (50.2 KB)
Re: Zyxel NAS326 - Debian / Boot from USB?
May 12, 2017 12:33AM
sebr,

> This option not make much difference in my case. A
> s example I used the trimmed down smb.conf from th
> e wiki.
> See the attached screenshots for the results in a
> usage scenario with my Win8.1 desktop PC and a tes
> tfile of 10GB size.

So using the Wiki simple smb.conf, the xfer speed for 10GB file is 85MB/s and 92MB/s?

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
May 12, 2017 08:12AM
Exactly, and the same with some additional Tweaks that I tried while testing
socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
read raw = yes 
write raw = yes 
max xmit = 65535 
dead time = 15
getwd cache = yes

Also very strange that there are frequent heavy drops in the speed while copying the testfile.
bodhi, what speeds do you get?
Re: Zyxel NAS326 - Debian / Boot from USB?
May 12, 2017 08:34AM
sebr,

> Also very strange that there are frequent heavy dr
> ops in the speed while copying the testfile.
> bodhi, what speeds do you get?

It's been so long ago since I ran the tests, I can't remmember exactly but somewhat comparable to yours (on NSA325v2 and a quad-core MacBook Pro Windows 7 VM). I have not tested with the NAS326.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
May 15, 2017 05:01PM
Hi bodhi!

I have some more questions:
* How can I bind the power-button to shutdown the NAS? At the moment, if I press the power button nothing happens.
* How can I help with Wake-on-LAN-testing? My AVM Fritzbox seems to have a WOL feature but I have not much idea how to debug it

Thanks,
Johannes
Re: Zyxel NAS326 - Debian / Boot from USB?
May 16, 2017 01:46AM
Johannes ,

> I have some more questions:
> * How can I bind the power-button to shutdown the
> NAS? At the moment, if I press the power button no
> thing happens.

See the Wiki thread:
http://forum.doozan.com/read.php?2,23630

Section:

Quote

Key daemon (button control)

Multimedia keyboard daemon for Linux


> * How can I help with Wake-on-LAN-testing? My AVM
> Fritzbox seems to have a WOL feature but I have no
> t much idea how to debug it

- Enable WOL

ethtool -s eth0 wol g

- Shutdown the box ith WOL enable

shutdown -h now


- And then on another Linux box in the network:

etherwake xxxxxxx

where xxxxx is the MAC address of the box

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
May 18, 2017 04:36AM
bodhi Wrote:
-------------------------------------------------------

> So using the Wiki simple smb.conf, the xfer speed
> for 10GB file is 85MB/s and 92MB/s?

this were the rates without the mentiond line.
I cannot do more on this atm because my NAS326 is gone ...
After changing the Stick and successfully booting Debian again, I decided to upgrade the kernel as usual.
All good I thought .. but the "beep" seys that ZyXEL OS is up and booting debian was unsuccessful.
So I pressed the power button and wait till it was down ...
since that .. it never comes up ... connecting the serial .. gives me nothing ... only the Power LED is lighting up with full brightness
no U-Boot .. nothing ...

for now .. the J1800 has to to the job ...
Re: Zyxel NAS326 - Debian / Boot from USB?
May 18, 2017 04:51AM
pengu Wrote:
-------------------------------------------------------
> bodhi Wrote:
> --------------------------------------------------
> -----
>
> > So using the Wiki simple smb.conf, the xfer spee
> d
> > for 10GB file is 85MB/s and 92MB/s?
>
> this were the rates without the mentiond line.
> I cannot do more on this atm because my NAS326 is
> gone ...
> After changing the Stick and successfully booting
> Debian again, I decided to upgrade the kernel as u
> sual.
> All good I thought .. but the "beep" seys that Zy
> XEL OS is up and booting debian was unsuccessful.

So it was booting stock at this point.

> So I pressed the power button and wait till it was
> down ...

Bad move! You should have logged into stock OS first, before doing anything more.


> since that .. it never comes up ... connecting th
> e serial .. gives me nothing ... only the Power LE
> D is lighting up with full brightness
> no U-Boot .. nothing ...
>
> for now .. the J1800 has to to the job ...

Given it is this bad, it's time to try the USB key_func restore approach to see if the original FW can restored.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
July 07, 2017 12:16PM
I've had NAS326 for a while now and it's been working quite well
but as it's cumbersome to update stuff on it I've been thinking on
trying to install somekind of own system on it.

So are you guys still trying to figure these things out and if so do
you need more reports on these LED statuses and WOL etc.?
Or is this project 'done?'
Re: Zyxel NAS326 - Debian / Boot from USB?
July 07, 2017 05:15PM
Re: Zyxel NAS326 - Debian / Boot from USB?
August 06, 2017 03:38AM
Hi guys,

you all did a great job.
Currently I use a NSA325 on Debian Stretch/ Kirkwood kernel 4.x and want to upgrade to NAS326.
Do you think it is possible to change the kernel to MVEBU, do the installation stuff with kwboot,
change the hdd's and everything is done.
Or is there a reason to setup a completely new System from bodhi's rootfs?

Thx

Otto
Re: Zyxel NAS326 - Debian / Boot from USB?
August 06, 2017 03:46AM
Otto,

> Or is there a reason to setup a completely new Sys
> tem from bodhi's rootfs?

You should use the new rootfs. It is armhf, instead of armel like the Kirwood. You could use the Kirkwood rootfs, but performance will be not as good.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner
Re: Zyxel NAS326 - Debian / Boot from USB?
August 17, 2017 02:42AM
Hi @ All

One question

I build my own Debian RootFS and used bodhi's linux-4.12.4-mvebu-tld-1 package.
All works fine, except for one thing

The ethernet have every boot a different mac-address. Is there a way to fix this?
Except to write an address hardcoded in /etc/network/Interfaces


Thx
Kirsch
Re: Zyxel NAS326 - Debian / Boot from USB?
August 17, 2017 07:22PM
Hi Kirsch,

> Except to write an address hardcoded in /etc/network/Interfaces

That's the only way to do it cleanly right now.

You could also use macchanger to change the MAC address to the real one. But the effect is will take longer to get the network connection (almost same as when the MAC is changing at each boot).

Technical explanation:

This is due to the limitation of stock u-boot. I had to set it up so that the DTB was not updated by stock u-boot. Therefore u-boot does not pass the MAC address to the kernel in the updated DTB blob. Stock u-boot uses a much older version of the FDT handling code, so it corrupts the blob if we let it update and pass to the kernel.

EDIT: typo.

-bodhi
===========================
Wiki
latest Kirkwood kernel builds and rootfs
latest u-boot-kirkwood builds
latest Oxnas kernel builds and rootfs
latest u-boot-oxnas builds
latest MVEBU Armada kernel builds and rootfs
U-Boot & Kernel Booting process
bodhi's u-boot GitHub
bodhi's corner



Edited 1 time(s). Last edit at 08/18/2017 05:27AM by bodhi.
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: