Installing LEDE on NSA325

@bobafetthotmail
Is openwrt-kirkwood-zyxel_nsa310b-squashfs-factory.bin with uboot ?
maybe I can nandwrite /dev/mtd0 openwrt-kirkwood-zyxel_nsa310b-squashfs-factory.bin ?
Or different way:
offset is 0x0140000 (1310720)
So maybe:
/usr/sbin/nandwrite -s 1310720 /dev/mtd0 zyxel_nsa310b-squashfs-sysupgrade.bin
or
/usr/sbin/nandwrite -s 1310720 /dev/mtd2 zyxel_nsa310b-squashfs-sysupgrade.bin

No it is not.

OK, My idea was not working.

~/tools # ./nandwrite -s 1310720 /dev/mtd0 /tmp/openwrt-kirkwood-zyxel_nsa310b-squashfs-sysupgrade.bin 
Input file is not page-aligned. Use the padding option.
nandwrite: error!: Data was only partially written due to error
           error 0 (Success)
~/tools # ./nandwrite -s 1310720 /dev/mtd0 /tmp/openwrt-kirkwood-zyxel_nsa310b-squashfs-sysupgrade.bin -p
Image 3471534 bytes, NAND page 2048 bytes, OOB area 64 bytes, device size 1048576 bytes
nandwrite: error!: Input file does not fit into device
           error 0 (Success)
nandwrite: error!: Data was only partially written due to error
           error 0 (Success)
~/tools # ./nandwrite -s 1310720 /dev/mtd2 /tmp/openwrt-kirkwood-zyxel_nsa310b-squashfs-sysupgrade.bin -p
Image 3471534 bytes, NAND page 2048 bytes, OOB area 64 bytes, device size 524288 bytes
nandwrite: error!: Input file does not fit into device
           error 0 (Success)
nandwrite: error!: Data was only partially written due to error
           error 0 (Success)

@bobafetthotmail and Paul Wassi(p-wassi) - I don't know his nickname in this forum
I found two issue:
The uImage from https://downloads.openwrt.org/snapshots/targets/kirkwood/generic/openwrt-kirkwood-zyxel_nsa310b-initramfs-uImage
doesn't contains driver kmod-r8169 so there is no ethernet connection
So I build by myself and this issue was resolved
But issue which I wasn't able to resolve is that u-boot don'y see "ubi" partition after sysupgrade:

root@OpenWrt:/mnt# sysupgrade openwrt-kirkwood-zyxel_nsa310b-squashfs-sysupgrade
.bin
Image not in /tmp, copying...
Cannot save config while running from ramdisk.
Commencing upgrade. All shell sessions will be closed now.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sending TERM to remaining processes ... ubusd logd netifd odhcpd ntpd dnsmasq
Sending KILL to remaining processes ...
Performing system upgrade...
[  162.850447] ubi0: attaching mtd2
[  162.997255] ubi0: scanning is finished
[  163.001156] ubi0 error: ubi_read_volume_table: the layout volume was not found
[  163.008630] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd2, error -22
ubiattach: error!: cannot attach mtd2
           error 22 (Invalid argument)
ubiformat: mtd2 (nand), size 132907008 bytes (126.7 MiB), 1014 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 1013 -- 100 % complete
ubiformat: 331 eraseblocks are supposedly empty
ubiformat: 5 bad eraseblocks found, numbers: 466, 547, 710, 847, 851
ubiformat: warning!: 678 of 1009 eraseblocks contain non-UBI data
ubiformat: warning!: only 0 of 1009 eraseblocks have valid erase counter
ubiformat: erase counter 0 will be used for all eraseblocks
ubiformat: note, arbitrary erase counter value may be specified using -e option
ubiformat: use erase counter 0 for all eraseblocks
ubiformat: formatting eraseblock 1013 -- 100 % complete
[  172.681062] ubi0: attaching mtd2
[  172.857696] ubi0: scanning is finished
[  172.872814] ubi0: attached mtd2 (name "ubi", size 126 MiB)
[  172.878330] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[  172.885269] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[  172.892022] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[  172.898852] ubi0: good PEBs: 1009, bad PEBs: 5, corrupted PEBs: 0
[  172.904968] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[  172.912238] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 603085179
[  172.921341] ubi0: available PEBs: 990, total reserved PEBs: 19, PEBs reserved for bad PEB handling: 15
[  172.930724] ubi0: background thread "ubi_bgt0d" started, PID 2662
UBI device number 0, total 1009 LEBs (130185216 bytes, 124.1 MiB), available 990 LEBs (127733760 bytes, 121.8 MiB), LEB size 129024 bytes (126.0 KiB)
Volume ID 0, size 17 LEBs (2193408 bytes, 2.0 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "kernel", alignment 1
Volume ID 1, size 11 LEBs (1419264 bytes, 1.3 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 124121088
Volume ID 2, size 962 LEBs (124121088 bytes, 118.3 MiB), LEB size 129024 bytes (126.0 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
umount: can't unmount /: Invalid argument
[  174.567357] reboot: Restarting system


U-Boot 2018.03 (Jun 05 2018 - 19:54:00 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
unexpected character 'b' at the end of partition
Error initializing mtdparts!
incorrect device type in ubi
Partition ubi not found!
Error, no UBI device/partition selected!
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
NSA310>

I found in history that Paul ask you:

@bobafetthotmail I've done some more changes to your 010 patch for Pogoplug v4.
This patch has touched configuration options for the whole kirkwood target. If those
changes are needed, then this should probably go into a patch seperated from the
device support.

And you never reply. I found that you confirm that uboot 2017.09 is working fine but never confirm that uboot 2018.03 compile by gcc 7.3 is working for you ? Do you have a chance to test it ?

I mean this commit: https://github.com/openwrt/openwrt/commit/f21cd9640052a733e1759519e3d7ca0f9453653b

Never tried the uimage from there, the uimage I built with the same sources always worked. Will try this and open a bug report if needed.

This weekend I will test it.

Did you try pulling power adapter (to shut down the device) and attach it again after 5 seconds?

I also had issues where uboot fails to boot after it was upgraded but they were solved by a hardware power off. (RAM was not cleared properly I guess)

Did you try pulling power adapter (to shut down the device) and attach it again after 5 seconds?

I also had issues where uboot fails to boot after it was upgraded but they were solved by a hardware power off. (RAM was not cleared properly I guess)

I tried and didn't help. I will try uboot 2017.9 which was fine in your case.
Regarding uImage. Maybe it is also worth to add vfat module and USB-storage. That way we system starts you have the same options as uboot - can mount USB stick and install image from it.

Maybe this commit is related:
https://github.com/openwrt/openwrt/commit/daf19649dbf101ce7ae17abf84eeed7a30b41275
If I find a time I will try.

@bobafetthotmail
The issue wasn't cause by above commit. What is the correct command to upgrade uboot from lede/openwrt ?
mtd -r write u-boot.trx uboot ?
when I have:

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 000c0000 00020000 "uboot"
mtd1: 00080000 00020000 "uboot_env"
mtd2: 07ec0000 00020000 "ubi"

I always installed uboot from inside uboot (or from stock firmware).

The command should be correct, but the tool will not work because the uboot partition is marked read-only inside OpenWrt.

You must add mtd-rw package in your firmware to ignore this limitation, see it here in packages repository/feed https://github.com/openwrt/packages/blob/master/kernel/mtd-rw/Makefile

use the uboot file called "u-boot.kwb". The other two don't work, I don't know why. There is no u-boot.trx for kirkwood.

@bobafetthotmail
This is an issue with uboot 2018.3 with 2017.09 it load fine. Thanks a lot for you help

U-Boot 2018.03 (Jun 05 2018 - 19:54:00 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
unexpected character 'b' at the end of partition
Error initializing mtdparts!
incorrect device type in ubi
Partition ubi not found!
Error, no UBI device/partition selected!
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
NSA310> usb reset
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
NSA310> fatload usb 0 0x1000000 u-boot.kwb
541748 bytes read in 53 ms (9.7 MiB/s)
NSA310> nand erase 0x00000 0x100000

NAND erase: device 0 offset 0x0, size 0x100000
Erasing at 0xe0000 -- 100% complete.
OK
NSA310> nand write 0x1000000 0x00000 0x100000

NAND write: device 0 offset 0x0, size 0x100000
 1048576 bytes written: OK
NSA310> reset
resetting ...
▒

U-Boot 2017.09 (Jan 31 2018 - 13:43:12 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Error: egiga0 address not set.

PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=2", size 126 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 1009, bad PEBs: 5, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 603085179
ubi0: available PEBs: 0, total reserved PEBs: 1009, PEBs reserved for bad PEB handling: 15
Read 0 bytes from volume kernel to 800000
No size specified -> Using max size (2193408)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.48
   Created:      2018-06-08  10:19:49 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2103426 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.48 (kofec@E5420Mint) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6394-359273d)) #0 Tue Jun 5 19:54:00 2                                                                                    018
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: ZyXEL NSA310b
[    0.000000] Memory policy: Data cache writeback

Ok I think I found the culprit.

U-Boot 2018.03 (Jun 05 2018 - 19:54:00 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   
Loading Environment from NAND... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Error: egiga0 address not set.

PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
unexpected character 'b' at the end of partition
Error initializing mtdparts!
incorrect device type in ubi
Partition ubi not found!
Error, no UBI device/partition selected!
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
NSA310> printenv
baudrate=115200
bootcmd=ubi part ubi; ubi read 0x800000 kernel; bootm 0x800000
bootdelay=3
console=console=ttyS0,115200
ethact=egiga0
ipaddr=192.168.1.1
mtdids=nand0=orion_nand
mtdparts=mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)bootargs_root=
serverip=192.168.1.2
stderr=serial
stdin=serial
stdout=serial

Environment size: 357/131068 bytes

Note the
mtdparts=mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)bootargs_root=

Yeah, that's wrong.

And it explains the error message


U-Boot 2018.03 (Jun 05 2018 - 19:54:00 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Error: egiga0 address not set.

PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
unexpected character 'b' at the end of partition
Error initializing mtdparts!
incorrect device type in ubi
Partition ubi not found!
Error, no UBI device/partition selected!
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!

"unexpected character 'b' at the end of partition". That's the "bootargs_root=" that got appended there.

If in uboot console I write

NSA310> setenv mtdparts 'mtdparts=orion_nand:0x0c0000(uboot),0x80000(uboot_env),0x7ec0000(ubi)'
NSA310> saveenv

Then it boots correctly.

Will go find where this typo is in the source and send a PR.

Ok, PR with fix is here https://github.com/openwrt/openwrt/pull/1027 Please test and report if it works for you too.

Your fix is fine. Thanks.

U-Boot 2017.09 (Jan 31 2018 - 13:43:12 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Error: egiga0 address not set.

PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
NSA310>
NSA310>
NSA310> usb reset
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
NSA310> fatload usb 0 0x1000000 u-boot.kwb
reading u-boot.kwb
621348 bytes read in 50 ms (11.9 MiB/s)
NSA310> nand erase 0x00000 0x100000

NAND erase: device 0 offset 0x0, size 0x100000
Erasing at 0xe0000 -- 100% complete.
OK
NSA310> nand write 0x1000000 0x00000 0x100000

NAND write: device 0 offset 0x0, size 0x100000
 1048576 bytes written: OK
NSA310> reset
resetting ...
▒

U-Boot 2018.03 (Jun 09 2018 - 16:42:36 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:
Loading Environment from NAND... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Error: egiga0 address not set.

PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: attached mtd1 (name "mtd=2", size 126 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 1009, bad PEBs: 5, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 603085179
ubi0: available PEBs: 0, total reserved PEBs: 1009, PEBs reserved for bad PEB handling: 15
Read 0 bytes from volume kernel to 800000
No size specified -> Using max size (2193408)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.48
   Created:      2018-06-05  19:54:00 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2102074 Bytes = 2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.48 (kofec@E5420Mint) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r6394-359273d)) #0 Tue Jun 5 19:54                       :00 2018
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] OF: fdt: Machine model: ZyXEL NSA310b
[    0.000000] Memory policy: Data cache writeback
[    0.000000] random: get_random_bytes called from start_kernel+0x70/0x41c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,115200

2 posts were split to a new topic: Support for Zyxel NSA320

Hi @bobafetthotmail I'm the OP guy of this thread it seems there's a bug on upgrading firmware. I have problem upgrading from 4.9 to 4.14 latest git trunk then I do sysupgrade I get this error.

root@LEDE-NSA325:/# sysupgrade -n -p /mnt/sda1/nsa325\ gcc8/targets/kirkwood/generic/openwrt-kirkwood-zyxel_nsa325-squashfs-sysupgrade.bin
Image not in /tmp, copying...
Device nsa325 not supported by this image
Supported devices: zyxel,nsa325
Image check 'fwtool_check_image' failed.

Anyway I've manage to upgrade it using latest snapshot of uImage.

Hi, I have update my nsa325v2 to openwrt. I face the issue with uboot:

Also good scripts:
echo "Fanspeed" $[60000/$(($(i2cget -y 0x0 0x0a 0x08)))] "RPM"
Fanspeed 1818 RPM
echo "CPU Temperature" $(($(i2cget -y 0x0 0x0a 0x07))) "C"
CPU Temperature 31 C

http://zyxel.nas-central.org/wiki/Fan_control_(NSA325)
https://forum.doozan.com/read.php?2,27108,28116

Did you have issues booting a USB drive like described in that thread?
If you had issues and that patch fixed it, then can you open a PR with it on OpenWrt github?

Is this issue on bodhi's uboot or OpenWrt's?

I never used tftpboot command. I always do

tftp RAM-address file-name
bootm RAM-address

Yes I know but I don't think they are needed.
This can go in the nsa325 wiki page.

I have never seen CPU temp rise above 60, actually the HDD temperature is a much bigger issue.

You can read but not control the fan speed, so I don't see why I should need to read it.

If you want a to add a script that will shut down the NSA325 if the fan stops spinning or the temp increases to 80 or 112 celsius? You can do a PR for that, I'm OK with that.

Did you have issues booting a USB drive like described in that thread?

Yes
The issue was seen on stock uboot and U-Boot 2019.01 (Mar 29 2019 - 14:55:08 +0000). But It was NOt seen/fixed on U-Boot 2017.07-tld-1

If you had issues and that patch fixed it, then can you open a PR with it on OpenWrt github?

You mean propose changes ? I'm not sure if my knowledge is sufficient. I take a look and @mibodhi introduce this change in commit

In uboot repository there were few commit on this file common/usb_storage.c after release 2017.07

The uboot 2019.01 is OK to start NSA325v2 from nand. I just need to start U-Boot 2017.07-tld-1 via kwboot to first time did sysupgrade.

 99 % [....................................]
[Type Ctrl-\ + c to quit]


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 
## Error: "setenv" not defined
ubi0: attaching mtd1
ubi0: scanning is finished
UBI init error 22
Error, no UBI device/partition selected!
Wrong Image Format for bootm command
Error occured, error code = 112
ERROR: can't get kernel image!
NSA325> usb reset
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
NSA325> fatload usb 0 0x800000 nsa325ram.bin
reading nsa325ram.bin
3364296 bytes read in 273 ms (11.8 MiB/s)
NSA325> bootm 0x800000
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.109
   Created:      2019-03-29  14:55:08 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3364232 Bytes = 3.2 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.109 (buildbot@slashdirt-03) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r9753-6df5ab8)) #0 Fri Mar 29 14:55:08 2019
........................
root@OpenWrt:/tmp# wget http://downloads.openwrt.org/snapshots/targets/kirkwood/
generic/openwrt-kirkwood-zyxel_nsa325-squashfs-factory.bin
Downloading 'http://downloads.openwrt.org/snapshots/targets/kirkwood/generic/openwrt-kirkwood-zyxel_nsa325-squashfs-factory.bin'
Connecting to 148.251.78.235:80
Writing to 'openwrt-kirkwood-zyxel_nsa325-squashfs-factory.bin'
openwrt-kirkwood-zyx 100% |*******************************|  3968k  0:00:00 ETA
Download completed (4063232 bytes)
root@OpenWrt:/tmp# sysupgrade -F openwrt-kirkwood-zyxel_nsa325-squashfs-factory.
bin 
Image metadata not found
Image check 'fwtool_check_image' failed but --force given - will update anyway!
Cannot save config while running from ramdisk.
Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sending TERM to remaining processes ... ubusd logd dnsmasq netifd odhcpd ntpd 
Sending KILL to remaining processes ... 
Performing system upgrade...
ubidetach: error!: cannot detach "/dev/mtd2"
           error 19 (No such device)
ubiformat: mtd2 (nand), size 132907008 bytes (126.7 MiB), 1014 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 1013 -- 100 % complete  
ubiformat: 964 eraseblocks are supposedly empty
ubiformat: 2 bad eraseblocks found, numbers: 90, 190
ubiformat: warning!: 48 of 1012 eraseblocks contain non-UBI data
ubiformat: warning!: only 0 of 1012 eraseblocks have valid erase counter
ubiformat: erase counter 0 will be used for all eraseblocks
ubiformat: note, arbitrary erase counter value may be specified using -e option
ubiformat: use erase counter 0 for all eraseblocks
ubiformat: flashing eraseblock 30 -- 100 % complete  
ubiformat: formatting eraseblock 987[  183.078612] ubi0: attaching mtd2
ubiformat: formatting eraseblock 1013 -- 100 % complete  
[  183.254843] ubi0: scanning is finished
[  183.286479] ubi0: volume 2 ("rootfs_data") re-sized from 9 to 961 LEBs
[  183.293611] ubi0: attached mtd2 (name "ubi", size 126 MiB)
[  183.299147] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[  183.306067] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[  183.312793] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[  183.319614] ubi0: good PEBs: 1012, bad PEBs: 2, corrupted PEBs: 0
[  183.325744] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[  183.332998] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 1254764615
[  183.342181] ubi0: available PEBs: 0, total reserved PEBs: 1012, PEBs reserved for bad PEB handling: 18
[  183.351550] ubi0: background thread "ubi_bgt0d" started, PID 2498
UBI device number 0, total 1012 LEBs (130572288 bytes, 124.5 MiB), available 0 LEBs (0 bytes), LEB size 129024 bytes (126.0 KiB)
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: [  183.381613] reboot: Restarting system


U-Boot 2019.01 (Mar 29 2019 - 14:55:08 +0000)
ZyXEL NSA325 2-Bay Power Media Server

SoC:   Kirkwood 88F6282_A1
DRAM:  512 MiB
NAND:  128 MiB
MMC:   
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0 
## Error: "setenv" not defined
ubi0: attaching mtd3
ubi0: scanning is finished
ubi0: attached mtd3 (name "ubi", size 126 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 1012, bad PEBs: 2, corrupted PEBs: 0
ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1254764615
ubi0: available PEBs: 0, total reserved PEBs: 1012, PEBs reserved for bad PEB handling: 18
No size specified -> Using max size (2322432)
Read 2322432 bytes from volume kernel to 00800000
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   ARM OpenWrt Linux-4.14.109
   Created:      2019-03-30   9:36:31 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2207208 Bytes = 2.1 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.109 (buildbot@slashdirt-03) (gcc version 7.4.0 (OpenWrt GCC 7.4.0 r9754-fbe2e7d)) #0 Sat Mar 30 09:36:31 2019

Regarding temperature and fan speed - In my case, the fan is quite loud (e.g compare to nsa310)
So I'm thinking about disconnect it / replace or maybe some resistor to slow down. How it looks like in your case ?
I thinking about wiki for nsa325 similar to nsa310:

Ah ok I thought you applied patches to OpenWrt u-boot.
I see the changes in the usb code of uboot in the commit you linked.
I will try to send a PR myself, and I will ask you to test a uboot I compiled, as all my USB drives work fine in uboot.

Does the uboot in the nsa310b have the same issue? I think it should. Can you try the same USB drive in the nsa310b and see if it works or not?

In my nsa325, the noise happens because it's screwed to the metal plate in the back. The fan was nearly silent if removed from the NAS. The metal plate was making a lot of noise with just a little vibration from the fan.

I placed some soft rubber between the fan and the metal plate, and used metal wire instead of the screws to hold it in place. Now it's not noisy.

I can't slow the fan down, I'm using old drives that heat a lot, I need the air movement.

Yes it would be useful.

I have test uboot 2019.01 on my NSA310 and issue was introduced with uboot 2019.01:

U-Boot 2018.03 (Jun 09 2018 - 16:42:36 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
NSA310> usb reset
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
NSA310>
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
NSA310> fatload usb 0 0x1000000 u-boot.kwb
645376 bytes read in 75 ms (8.2 MiB/s)
NSA310> nand erase 0x0 0x100000
NAND erase: device 0 offset 0x0, size 0x100000
Erasing at 0xe0000 -- 100% complete.
OK
NSA310> nand write 0x1000000 0x00000 0x100000
NAND write: device 0 offset 0x0, size 0x100000
1048576 bytes written: OK
NSA310> reset
resetting ...

U-Boot 2019.01 (Feb 24 2019 - 23:07:20 +0000)
ZyXEL NSA310 1-Bay Power Media Server

SoC:   Kirkwood 88F6281_A1
DRAM:  256 MiB
NAND:  128 MiB
MMC:
Loading Environment from NAND... OK
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
PHY reset timed out
MV88E1318 PHY initialized on egiga0
Hit any key to stop autoboot:  0
NSA310> usb reset
resetting USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
EHCI timed out on TD - token=0x80008c80
 ERROR: NOT USB_CONFIG_DESC 80
 EHCI timed out on TD - token=0x80008d80
 EHCI timed out on TD - token=0x80008c80
 EHCI timed out on TD - token=0x80008c80
 2 USB Device(s) found
 scanning usb for storage devices... 0 Storage Device(s) found
 NSA310>