Welcome! Log In Create A New Profile

Advanced

Zyxel NSA325v2 brick

Posted by ehorher 
Zyxel NSA325v2 brick
January 24, 2022 03:24PM
Hello community,
I had a NSA325v2 for a while, and after a reboot can´t access it anymore. The box have the power blue led in solid blue, and blinking once every aprox 30 seconds. I´m wondering if you can give me some hints in order to check what going on and see if it a HW issue or something else, may be problem with the boot loader.
Thanks a lot in advance, I really appreciate any help on this.
//Horacio
Re: Zyxel NSA325v2 brick
January 24, 2022 03:46PM
ehorher,

> I had a NSA325v2 for a while, and after a reboot
> can´t access it anymore. The box have the power
> blue led in solid blue, and blinking once every
> aprox 30 seconds.

For stock FW, that sounds like the watchdog running that restarts the box every 30 seconds (if the fan is louder at that time then for sure it is the watchdog). If the HDD LED did not blink during power up then the box did not get to kernel booting. If you can hear the HDD spinning and see its LED blinking, then the kernel is booting and was killed by the watchdog.

So best to connect serial console and run kwboot to boot over UART. If you have not connected serial console before, see this thread for ideas which parts to buy:

The NSA325 hase pre-installed serial header, so no soldering needed.

For UART booting with kwboot, see example here:

https://forum.doozan.com/read.php?3,51739,51919#msg-51919

Download the latest u-boot for NSA325 from the u-boot installation thread:

And use the image uboot.2017.07-tld-1.nsa325.mtd0.kwb

============

After you're successfully run kwboot to boot the new u-boot image, then it is unbricked. So you can either restore stock FW, or install new u-boot and Debian that I released here.

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



Edited 1 time(s). Last edit at 01/24/2022 04:10PM by bodhi.
Re: Zyxel NSA325v2 brick
January 24, 2022 09:08PM
Hello Bodhi, thanks for your answer.
The fan is running, The HDD led did not blink at all. I was able to connect the serial port to my laptop using a USB to TTL adapter (CP2102), but nothing is showing on the console, I setup as 115200, 8 N 1. I´m using secureCRT which is pretty similar to putty. The fan start after 35 seconds.
May be is a HW problem? I tested the voltage between 3.3v pin and GND and it´s OK.
Please let me know your comments.
Thanks again!
Horacio
Attachments:
open | download - NSA325 serial.jpeg (213 KB)
Re: Zyxel NSA325v2 brick
January 24, 2022 11:58PM
Horacio,

> I was able to connect the serial port to my
> laptop using a USB to TTL adapter (CP2102), but
> nothing is showing on the console

Try connecting TX to TX, RX to RX. Most older version of this CP2102 converter already swapped internally (I have one like that).

>The fan start after 35 seconds.

That's when the watchdog starts

> May be is a HW problem?

It is most likely a FW problem, not HW. If the FW is corrupted, then the boot process stuck in u-boot. If the HDD blinks then it stuck in kernel.

When the booting process is stuck some where, either in u-boot or kernel, the watchdog will reset the box. That's when the fan stops, and then about 30 seconds later, the watchdog starts and the fan starts running at that time.

In any case, try UART booting like I mentioned above. But see if swaping TX/RX wires will output anything first.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 25, 2022 11:15PM
Hi Bodhi,
I will buy a new CP2102, I tried to swap TX-RX, tried using putty instead secureCRT and I have nothing on the screen. So, if with the new one still the same, I will ty the UART booting as you mentioned. One thing, I tried to download the u-boot for NSA325 from the link https://bitly.com/2xnfGmv but is not responding at all. Please check and if you have an alternative link let me know.
Thanks!
Horacio
Re: Zyxel NSA325v2 brick
January 25, 2022 11:28PM
Horacio,

> I will buy a new CP2102,
> I will ty the UART booting as you
> mentioned.

Note that you will need a Linux box/Linux VM/Linux Live CD to run kwboot on it.

> One thing, I tried to download the
> u-boot for NSA325 from the link
> https://bitly.com/2xnfGmv but is not responding

It does repond OK for me!

Anyway, here is the dropbox link (where the short link points to):

https://www.dropbox.com/s/t70xqwlqlwsia9v/uboot.2017.07-tld-1.nsa325.bodhi.tar

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 26, 2022 09:45AM
Hello Bodhi,

I was able to download the file from dropbox. Also I have Ubuntu running on VirtualBox, and I installed kwboot on it, so next step is run the command

kwboot -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.nsa325.mtd0.kwb -p

I have a question: I have to download the file on a USB (should be formatted as FAT, ex-FAT, NTFS?) and attach to the NAS, right? if yes, which of the 3 USB ports is the USB0?

This will be my first time that I doing this, so I´m learning step by step......

Thanks
-Horacio
Re: Zyxel NSA325v2 brick
January 26, 2022 04:28PM
> I was able to download the file from dropbox. Also
> I have Ubuntu running on VirtualBox, and I
> installed kwboot on it, so next step is run the
> command
>
> kwboot -t -B 115200 /dev/ttyUSB0 -b
> uboot.2017.07-tld-1.nsa325.mtd0.kwb -p

Correct.

> I have a question: I have to download the file on
> a USB (should be formatted as FAT, ex-FAT, NTFS?)
> and attach to the NAS, right? if yes, which of the
> 3 USB ports is the USB0?

The file uboot.2017.07-tld-1.nsa325.mtd0.kwb is on your Ubuntu.

Connect serial console, start kwboot on Ubuntu system:

kwboot  -t -B 115200 /dev/ttyUSB0 -b uboot.2017.07-tld-1.nsa325.mtd0.kwb  -p


And power up the NSA325.

You should see kwboot starts handshaking with the NSA325 and it transfers the u-boot image uboot.2017.07-tld-1.nsa325.mtd0.kwb over.

It will take a while, with the progress showing. Wait until you see u-boot runs and starts a countdown. Hit any key to interrupt it. And post back here the resultts (post the log of the kwboot session on your Ubuntu terminal).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 26, 2022 10:03PM
Hello bodhi !
Well, first step completed !!
Please check atached log.
Please let me know the next step.....
Thanks!

-Horacio
Attachments:
open | download - NSA325.log (5.2 KB)
Re: Zyxel NSA325v2 brick
January 27, 2022 03:12AM
Horacio,

Looks good!

On another Linux box, create the USB Debian rootfs using Debian-5.2.9-kirkwood-tld-1-rootfs-bodhi.tar.bz2 from the release thread:

https://forum.doozan.com/read.php?2,12096

Scroll down to 26 Sept 2021 section for download link and installation instruction.

Attach the USB Debian rootfs to one of the back USB 2.0 ports. And then kwboot again. This time don't interrupt, just let it boot all the way into Debian.

Once you are in Debian you can proceed to install the new u-boot using the instruction in the u-boot release thread.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 27, 2022 08:49PM
Hello Bodhi,
This is what I did:
I formatted an 8Gb USB with EXT3, and labeled as rootfs, using my ubuntu VM. Then I decompressed the file Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 in there, as indicated on the post. After that, I attached to a USB port in the back of the NAS.
Then I started kwboot, and seem that can´t find any partition table on the USB. check the attached log.
What could be wrong?
Thanks
-Horacio



Edited 1 time(s). Last edit at 01/27/2022 08:56PM by ehorher.
Attachments:
open | download - NAS325v2.log (6.4 KB)
Re: Zyxel NSA325v2 brick
January 27, 2022 09:15PM
Horacio,

On your Ubuntu VM, you should use command line to extract the tarbal. If not being root, it will be not successful.

The GUI runs as a regular user, not root. You can use the GUI to format the drive as Ext3. And then,

Start a terminal shell, and become root user

su -
and then cd to the USB drive top folder. And run the tar command as instructed.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 27, 2022 11:53PM
Bodhi,
This is what I did with the USB format. I cant figure out what I doing wrong......
-Horacio
Attachments:
open | download - ext3format.txt (2.1 KB)
Re: Zyxel NSA325v2 brick
January 28, 2022 03:40AM
Horacio,

This is the problem:
mkfs.ext3 -L rootfs /dev/sdb

/dev/sdb is the whole disk, not the 1st partition.

Should be sdb1, which is the partition name:

mkfs.ext3 -L rootfs /dev/sdb1

And then

mkdir /mnt/sdb1
mount /dev/sdb1 /mnt/sdb1

cd /mnt/sdb1
tar -xjf /var/tmp/NAS325/Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 28, 2022 03:47AM
Hi Bodhi,
Finally, and after found a post here related to the USB format (NSA325v2 u-boot installation problem) https://forum.doozan.com/read.php?3,43549,43619#msg-43619, related to the partition table, and changed from GPT to MBR, I was able to install Debian on my NSA325v2.
Later I will complete the rest of the steps, so far now I can login as root.
Thanks!
-Horacio
Attachments:
open | download - Debian.log (1.1 KB)
Re: Zyxel NSA325v2 brick
January 28, 2022 03:55AM
Cool!

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 28, 2022 12:48PM
Hi Bodhi,
I´m happy that I recovered my NAS325v2.
As this is my first time doing this, want to apologize if I´m asking questions with obvious answers.
There is any way to flash the original firmware in the box? At this point, I understand that I have to follow the procedure to flash the u-boot on md0, but just wondering if it possible to flash with the original firmware because I wan to see if I can recover the information that I have on the raid.
So, please let me know...
I will never stop thanking you for all the help received.
-Horacio
Re: Zyxel NSA325v2 brick
January 28, 2022 12:59PM
Bodhi, I have a warning related to Bad CRC on the fw_printenv:

root@debian:/tools# ./fw_printenv
Warning: Bad CRC, using default environment
bootcmd=bootp; setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off; bootm
bootdelay=5
baudrate=115200

Also, I can see some bad blocks:

root@debian:/tools# dmesg | grep -i 'bad'
[ 8.556768] Scanning device for bad blocks
[ 8.566826] Bad eraseblock 100 at 0x000000c80000
[ 8.577340] Bad eraseblock 200 at 0x000001900000

I can continue in this scenario?

--Horacio
Re: Zyxel NSA325v2 brick
January 28, 2022 01:05PM
Quote

just wondering if it possible to flash with the original firmware because I wan to see if I can recover the information that I have on the raid.

You don't need the original firmware for that. Any decent Linux box can assemble&mount that array, including Debian.
Re: Zyxel NSA325v2 brick
January 28, 2022 03:39PM
Horacio,

As I mentioned above,

Quote

Once you are in Debian you can proceed to install the new u-boot using the instruction in the u-boot release thread.

You have not done that, correct? You are booting with kwboot to load u-boot image, so the Bad CRC in Debian is expected. Follow the U-Boot installation instruction

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

to flash u-boot image and the envs image to NAND. After that it should be fine.


> Also, I can see some bad blocks:
>
> root@debian:/tools# dmesg | grep -i 'bad'
> [ 8.556768] Scanning device for bad blocks
> [ 8.566826] Bad eraseblock 100 at
> 0x000000c80000
> [ 8.577340] Bad eraseblock 200 at
> 0x000001900000
>
> I can continue in this scenario?

Yes, the bad blocks are far away from mtd0, where u-boot image is. So you can install u-boot.

Note that every step in the instruction is important, you should do every step, and if there is difference, post the question here.

Pay attention to this in step 1
cat /proc/mtd

The NSA325 has different layout. So it will look different from other Kirkwood boxes. But mtd0 should be at the 1st MB of NAND. That is all we need.

Remember to adjust mtdparts env after you have installled u-boot successfully and run normally. Post back after you installed u-boot.

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



Edited 1 time(s). Last edit at 01/28/2022 03:49PM by bodhi.
Re: Zyxel NSA325v2 brick
January 28, 2022 03:45PM
Horacio,

> There is any way to flash the original firmware in
> the box? At this point, I understand that I have
> to follow the procedure to flash the u-boot on
> md0, but just wondering if it possible to flash
> with the original firmware because I wan to see if
> I can recover the information that I have on the
> raid.

As Mijzelf mentioned above, you could recover the array after installing u-boot and run Debian.

However, the other option is make sure you save the stock mtd0 (in Step 3). The worst case is that you can reflash this stock mtd0 using the file that you saved in Step 3. And then reassemble the array from stock OS.

But you box was bricked silently, so it is likely that mtd0 was corrupted. When and if it comes to the point you need stock mtd0, I think one of us here can help you with that file.

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



Edited 1 time(s). Last edit at 01/28/2022 03:52PM by bodhi.
Re: Zyxel NSA325v2 brick
January 29, 2022 05:25PM
Hello Bodhi,
I completed, without any issue, until this step:

/usr/sbin/nandwrite -s 786432 /dev/mtd0 uboot.2016.05-tld-1.environment.img
Expected output:
Writing data to block 6 at offset 0xc0000

Now, I can´t find anywhere the command fw_setenv seem that it´s not in the tools directory.

root@debian:/tmp# ls -la /tools
total 3640
drwxr-xr-x 2 root root 4096 Jan 29 14:49 .
drwxr-xr-x 22 root root 4096 Jan 28 10:34 ..
-rwxr-xr-x 1 root root 1616492 Nov 15 2010 busybox
-rw-r--r-- 1 root root 178 Jan 29 14:49 current_envs.txt
-rwxr-xr-x 1 root root 787036 Jun 19 2011 e2fsck
-rwxr-xr-x 1 root root 25632 Jun 30 2014 flash_erase
-rw-r--r-- 1 root root 329 May 17 2016 fw_env.config
-rwxr-xr-x 1 root root 668497 May 17 2016 fw_printenv
-rw-r--r-- 1 root root 524288 Jan 28 10:53 mtd0
-rwxr-xr-x 1 root root 26548 Jun 30 2014 nanddump
-rwxr-xr-x 1 root root 29644 Jun 30 2014 nandwrite

Also, by mistake I overwrite the file "current_envs.txt" saved on step "c" before the flash_erase command.
Seem that it is necessary to config the value:

fw_setenv mtdparts 'xxxxxxxxx'


Let me know please the next steps.

Attached is the log file for the flashing.

Thanks !
-Horacio
Attachments:
open | download - Flashing.log (15.6 KB)
Re: Zyxel NSA325v2 brick
January 29, 2022 05:46PM
Horacio,

It was mentioned in the rootfs release notes:

Quote

Important Correction:

After releasing this rootfs,

1. I realized I've missed one package that needs to be installed in order to make fw_printenv and fw_setenv available (these binaries have been moved to package libubootenv-tool in bullseye) . So do this if you want to list or set envs in Debian.
apt-get install libubootenv-tool

But you already downloaded and use fw_printenv, it is the same as fw_setenv. So you can use it and installing libubootenv-tool later.

Create symlink to make it more readable:
cd /tools
ln -s fw_printenv fw_setenv

And
./fw_setenv mtdparts 'xxxxxxxxx'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 29, 2022 09:39PM
Yes Bodhi, I missed that...sorry...now I have fw_setenv, but as I stated before, what value I have to use to set mtdparts, as I overwrite by error the file "current_envs.txt" saved on step "c" before the flash_erase command.

-Horacio
Re: Zyxel NSA325v2 brick
January 29, 2022 10:41PM
Horacio,

./fw_setenv mtdparts 'mtdparts=orion_nand:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2)'

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 30, 2022 08:36PM
Thanks Bodhi, I just realize that following the same thread from Krono

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

Here is my fw_printenv attached. please take a look, and if it is OK then I will reboot.....

-Horacio
Attachments:
open | download - fw_printenv.log (2.9 KB)
Re: Zyxel NSA325v2 brick
January 31, 2022 12:35PM
Hello Bodhi,
After I did check again everything I rebooted the box, and now I have Debian running ok !!
So, what I did was an update and upgrade debian, no issues. Now, next step is try if I can mount the internal drives (2 4Gb SATA in raid 1) to see if I can recover the info there....
Please any help that you can give me on that I really appreciate.
Thanks
-Horacio
Re: Zyxel NSA325v2 brick
January 31, 2022 03:27PM
Cool! Sorry I missed your last post about checking envs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NSA325v2 brick
January 31, 2022 03:41PM
No issues! In the meantime I’m installed fdisk and mdadm.
My main concern now is see if I can remount the raid 1 in Debian to recover the info.
—Horacio
Re: Zyxel NSA325v2 brick
January 31, 2022 03:53PM
Horacio,

> My main concern now is see if I can remount the
> raid 1 in Debian to recover the info.

Very carefully. See posts from Mijzelf and me starting from here:

https://forum.doozan.com/read.php?2,129924,129934#msg-129934

Basically, you'll install mdadm, and run

mdadm --assemble --scan

You need to be very careful here. I cannot guarantee what I said above will work and not destroying data in you RAID array :) If there is important data to recover, you need to do research about this topic.

mdadm --assemble --scan should not touch your data. But it's your own risk to take.

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