Welcome! Log In Create A New Profile

Advanced

Zyxel NAS326 Installation Instruction

Posted by bodhi 
Dzanar
Re: Zyxel NAS326 Installation Instruction
April 26, 2020 01:36PM
Hello,

After updating to rootfs Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 and kernel linux-5.5.3-mvebu-tld-1-bodhi.tar.bz2 the second hard drive (sdb) not running correctly.

The boot log was here https://justpaste.it/3mlu2.

In the Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 it works fine. The hard disk is initialized correctly.

Is any chance to fix it on Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 and kernel linux-5.5.3-mvebu-tld-1-bodhi.tar.bz2?

I will check it on initv and systemd.
Re: Zyxel NAS326 Installation Instruction
April 26, 2020 05:07PM
Dzanar,

This has been fixed, but I forgot to update the kernel installation. Go to this post:

https://forum.doozan.com/read.php?2,99689,99699#msg-99699

Download the attached file armada-380-zyxel-nas326.dtb to /tmp, and

cd  /boot/dts
cp -a armada-380-zyxel-nas326.dtb armada-380-zyxel-nas326.dtb.orig
cp -a /tmp/armada-380-zyxel-nas326.dtb .

And remake the uImage with this new DTB.

Quote

cd /boot
cp -a zImage-5.5.3-mvebu-tld-1 zImage.fdt
cat dts/armada-380-zyxel-nas326.dtb >> zImage.fdt
mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.5.3-mvebu-tld-1 -d zImage.fdt uImage
sync

And reboot.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
May 23, 2020 09:22AM
Hi!

Is there a way to downgrade the stock firmware? I'm trying to install Debian via the USB non serial method, but it looks like the newest firmware (V5.21(AAZF.8)) removed fw_printenv and fw_setenv. (-sh: fw_printenv: command not found)
Re: Zyxel NAS326 Installation Instruction
May 23, 2020 05:00PM
Can you install u-boot-tools?
Re: Zyxel NAS326 Installation Instruction
May 23, 2020 06:24PM
rocketbucket,

> Is there a way to downgrade the stock firmware?
> I'm trying to install Debian via the USB non
> serial method, but it looks like the newest
> firmware (V5.21(AAZF.8)) removed fw_printenv and
> fw_setenv. (-sh: fw_printenv: command not found)

u-boot-tools (as renojim mentioned) is also available on the USB rootfs, try running it directly. Assuming the USB is mounted at /media/sdb1,

/media/sdb1/usr/bin/fw_printenv

Alternatively, you can also use the binpack, download it and you can run them directly:

https://forum.doozan.com/read.php?3,27280

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
May 24, 2020 02:04AM
Thank you bodhi, I was able to use fn_setenv and fn_printenv via the rootfs binaries.

I set everything up, rebooted the nas with the usb plugged in in the front USB, but it cannot boot into debian at all. It's powered on, but I cannot ping debian.local, and cant even find the ip with a router, so i believe it's stuck.

printenv before: https://pastebin.com/8cgZ1Y9P

printenv now: https://pastebin.com/e6xAqHGi

Extra info: The first 3 LEDS are turned on.



Edited 2 time(s). Last edit at 05/24/2020 02:18AM by rocketbucket.
Re: Zyxel NAS326 Installation Instruction
May 24, 2020 02:44AM
rocketbucket,

Quote

Extra info: The first 3 LEDS are turned on.

It is stuck at u-boot prompt, and cannot proceed booting. Did you use the tarball Debian-4.9.0-mvebu-tld-12-rootfs-bodhi.tar.bz2 as the instruction stated?

=====

Sounds like you don't have serial console, so it is hard to tell what was wrong.

Can you connect serial console? this box header is factory installed. So you just need a serial module converter.

https://forum.doozan.com/read.php?8,13263

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
May 24, 2020 02:58AM
I tried to install debian 5.0, i will try installing 4.9 now.
Re: Zyxel NAS326 Installation Instruction
May 24, 2020 03:18AM
It works! Thank you!



Edited 1 time(s). Last edit at 05/24/2020 04:15AM by rocketbucket.
Re: Zyxel NAS326 Installation Instruction
May 24, 2020 05:57AM
rocketbucket Wrote:
-------------------------------------------------------
> It works! Thank you!

Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
July 09, 2020 01:53AM
New Zyxel NAS326 Installation for rootfs Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 is now up in the first post.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
October 31, 2020 07:38PM
Hi,

I have a Nas326 and I installed Debian using your tutorial. I decided to go back to stock firmware. After that I reset the NAS to factory defaults pressing the reset button(3 beeps). After that I noticed the firmware were a version earlier!! So I updated the firmware again. After that I SSH it to check the fw_printenv and I received the message:
Error opening lock file /var/lock/fw_printenv.lock

What happened?
Re: Zyxel NAS326 Installation Instruction
October 31, 2020 09:34PM
nickba,

> I have a Nas326 and I installed Debian using your
> tutorial. I decided to go back to stock firmware.
> After that I reset the NAS to factory defaults
> pressing the reset button(3 beeps). After that I
> noticed the firmware were a version earlier!! So I
> updated the firmware again. After that I SSH it to
> check the fw_printenv and I received the message:
> Error opening lock file
> /var/lock/fw_printenv.lock
>
> What happened?

I'm not familiar with stock FW, so have no idea about that message.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
October 31, 2020 10:14PM
Thanks for replying. Even with the error, the Nas326 is working with stock firmware now, but the fw_printenv only return this error. Do you know if the fw_setenv commands are stored in a file?
Before installing Debian, I used the fw_printenv command and I saved all parameters in a file. Is there a way to restore it? Or it is not needed?
Re: Zyxel NAS326 Installation Instruction
October 31, 2020 10:56PM
nickba,

> Before installing Debian, I used the fw_printenv
> command and I saved all parameters in a file. Is
> there a way to restore it? Or it is not needed?

No need too.

In stock OS, check the file

/etc/fw_env.config

See if you have changed it during Debian installation. If you did, then restore stock version of this file.

And you can delete the lock file too, if you login as root.

rm /var/lock/fw_printenv.lock

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



Edited 2 time(s). Last edit at 10/31/2020 10:59PM by bodhi.
Re: Zyxel NAS326 Installation Instruction
November 01, 2020 11:07AM
Thanks again for replying.

I deleted the /var/lock/fw_printenv.lock, but after a reboot, it is there again! And the /etc/fw_env.config just have this:

# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, in this case the redundant
# environment sector is assumed present.
# Notice, that the "Number of sectors" is ignored on NOR and SPI-dataflash.
# Futhermore, if the Flash sector size is ommitted, this value is assumed to
# be the same as the Environment size, which is valid for NOR and SPI-dataflash

# NOR example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd1 0x0000 0x4000 0x4000
#/dev/mtd2 0x0000 0x4000 0x4000

# MTD SPI-dataflash example
# MTD device name Device offset Env. size Flash sector size Number of sectors
#/dev/mtd5 0x4200 0x4200
#/dev/mtd6 0x4200 0x4200

# NAND example
/dev/mtd1 0x0000 0x80000 0x20000 16




Before everything, my fw_printenv command resulted in a big list.



Edited 1 time(s). Last edit at 11/01/2020 11:10AM by nickba.
Re: Zyxel NAS326 Installation Instruction
November 01, 2020 04:29PM
OK it looks like the right one:

/dev/mtd1 0x0000 0x80000 0x20000 16

So no idea why you cannot use it.

Are you logging as root, or a normal user? if you were not root, then try log in as root.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
November 02, 2020 12:24AM
Thanks again for replying! You were completely right!! After I went back to stock I was not logging as root!! Problem solved! Sorry for the trouble.

Congratulations for your great tutorial, it works great!

Thank you very much!
Re: Zyxel NAS326 Installation Instruction
November 05, 2020 04:49PM
Hello again,

I decided to install Debian again and I installed Open Media Vault. I noticed the Samba transfer speed is about 40MB/s read and write and the stock firmware is about 100MB/s read and write. Is there a tweak that I can make to approach the stock speeds? Do you think it could be because I am booting from an USB Flash Drive?
Re: Zyxel NAS326 Installation Instruction
November 05, 2020 09:22PM
nickba,

> I decided to install Debian again and I installed
> Open Media Vault. I noticed the Samba transfer
> speed is about 40MB/s read and write and the stock
> firmware is about 100MB/s read and write. Is there
> a tweak that I can make to approach the stock
> speeds? Do you think it could be because I am
> booting from an USB Flash Drive?

With OMV you will need to have the rootfs on HDD. USB drive will slow it down quite a bit.

For Samba settings, you could look at the Wiki thread:

Quote

Samba

Samba smb.conf for a simple set up
HowTo setup Samba/CIFS shares

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
November 06, 2020 10:51AM
Bodhi,

Thank you! I will try booting directly from HDD and use your suggested Samba config!!



Edited 1 time(s). Last edit at 11/06/2020 10:51AM by nickba.
Re: Zyxel NAS326 Installation Instruction
November 06, 2020 08:05PM
Hi again,

Tried to boot from HDD, but the NAS get stuck. If I remove the HDD, it falls back to stock firmware. I tried with only one HDD installed and with both. I checked the envs and tried a lot of times and always get the same result. Do you know if there is a partition size limit? It is a 8TB HDD. I tried with the HDD formatted as EXT3 and also tried it as EXT4. Should it work with EXT4 too?
Re: Zyxel NAS326 Installation Instruction
November 06, 2020 09:01PM
nickba,

> Tried to boot from HDD, but the NAS get stuck. If
> I remove the HDD, it falls back to stock firmware.
> I tried with only one HDD installed and with both.
> I checked the envs and tried a lot of times and
> always get the same result. Do you know if there
> is a partition size limit? It is a 8TB HDD.

This is stock u-boot, so it is best that you do this.

With only the HDD rootfs in the slot, power up, interrupt serial console and

run sata_init
ext2ls scsi 0:1 /boot
And post the entire log here.

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



Edited 1 time(s). Last edit at 11/06/2020 09:02PM by bodhi.
Re: Zyxel NAS326 Installation Instruction
November 07, 2020 12:20PM
Hello and thanks for replying again.
I will try to find the FTDI RS232 TTL adapter I have to connect it to serial console. As I already formatted the HDD with the rootfs, could you tell if it should work with ext4 too? I am asking that because ext3 takes a long time to format.


Update1: I uploaded a picture of the NAS326 board, as I saw you only have a picture of the NAS325.

Update2: I had to use the Serial console anyway, as in the last test I messed with the envs and I had to fix them using the serial console!! :-)

Update3: Got it working. The problem was the USB to SATA adapter I was using on PC to create and format the partition. It was messing with something.

So the only remaining question: Would Ext4 filesystem work too?



Edited 3 time(s). Last edit at 11/07/2020 03:59PM by nickba.
Attachments:
open | download - NAS326_MB.jpg (931.7 KB)
Re: Zyxel NAS326 Installation Instruction
November 07, 2020 05:15PM
nickba,

> I will try to find the FTDI RS232 TTL adapter I
> have to connect it to serial console. As I already
> formatted the HDD with the rootfs, could you tell
> if it should work with ext4 too? I am asking that
> because ext3 takes a long time to format.

It should work. But I've forgot a lot about this device (it's been a while, I have moved on concentrate on several other boxes since then). You can always verify it yourself by using a USB thumb drive.

- Format the USB thumb drive as Ext4.
- Make sure you format the Ext4 with the option to finalize the file system immediately.

The reason you see Ext4 formatting goes so quickly is the formatting process is default to "lazy" (meaning it is not completely formatted), and there will be a background process that continuing the formatting while you are using it on the Linux host system that you do the format. The total time it takes to format as Ext3 or Ext4 are actually about the same.

The Ext4 drive being used as rootfs is expected to be removed from the Linux host system. So it must be finalized before you can use it as the boot drive on the NAS326.

Disable the lazy option while formatting it:

mkfs.ext4 -E lazy_itable_init=0


======

After the format has done and you have create the rootfs on this USBt, bring it to the NAS326. power up and interrupt serial console,

usb reset
ext4ls usb 0:1 /boot

If the USB drive partition is recognized, and you can see the list of files on /boot, then it is working.

Now you can format the HDD the same way on the Linux host system.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
November 07, 2020 07:47PM
Hi, Thanks for all the info. I hope the picture I sent in my last post could be useful. I tested the HDD boot a little bit more and seems it is not reliable. Sometimes it boots and sometimes it doesn't. Seems the problem is the quirk you already described. If I interrupt the serial console and run sata_init and wait for the HDD to be detected and issue a reset command, it works every time!!

For testing purposes I installed the OMV in the HDD and tested the Samba transfer speed with the parameter in your smb.conf. The transfer was about 50 - 60MB/s. It got a little better than before, but way slow than the 100MB/s from the stock firmware.

Again, thank you very much!!
Re: Zyxel NAS326 Installation Instruction
November 07, 2020 08:37PM
nickba,

Glad you got it working!

> Seems the problem is the quirk you
> already described. If I interrupt the serial
> console and run sata_init and wait for the HDD to
> be detected and issue a reset command, it works
> every time!!
>

It might help to insert a sleep period here:

fw_setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init; sleep 3'

And thanks for the picture! I'll include it in the 1st post.

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



Edited 1 time(s). Last edit at 11/07/2020 08:40PM by bodhi.
Re: Zyxel NAS326 Installation Instruction
December 25, 2020 05:09AM
Hello,

I've read several time the steps to perform in order to install Debian in my Zxel NAS326. However, there's this still simple doubt. Currently, my NAS326 has two HDs set as JBOD (no RAID, the two HDs make one single "virtual" HD). So, if I go on and set up Debian as in the steps and then install eg. Open Media Vault, would my two HDs setting as JBOD still be detected? Or would all data stored be lost? That is my main concern.

Thank you for your attention in advance.

Cheers,
Re: Zyxel NAS326 Installation Instruction
December 25, 2020 03:47PM
mixpc,

If you are going to install Debian and OMV on the HDD, then yes, you should back up all your files before installation.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
December 26, 2020 03:59AM
bohdi, sorry for not being as detailed as needed. My goal is having Debian installed in a USB flash drive(32GB) plugged to the NAS326 USB port. So basically, that is option rootfs Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 on USB. As well, "inside stock OS and without serial console (section B for USB rootfs)".

So in that scenario, my doubt is what I mentioned? Do you think Debian installed in the USB flash drive is supposed two detect the two HDs in JBOD in the NAS326 and so be able to read/write there? Because if JBOD is OS-dependent then I assume a new OS (Debian) would render the previous HDs config usless, no contents would be kept and I would have to config both HDs again after having installed OMV. Of course, the risk is always on my side. I appreciate you hard work in this project. Awesome! Thumbs up!

Regards,
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: