Welcome! Log In Create A New Profile

Advanced

Zyxel NAS326 Installation Instruction

Posted by bodhi 
Re: Zyxel NAS326 Installation Instruction
January 30, 2022 05:50AM
Thanks for the suggestion!

I booted up the NAS326 with USB as under B with the fw_setenv stuff there.

Then made a 150GB ext3 partition named rootfs on /dev/sda and copied all stuff there, then did the fw_setenv stuff under C.

But it wont boot without the USB at all.
With USB in it now boots to stock fw.

Maybe there are leftovers from the USB fw_setenv stuff, that the hard drive boot don't like? I see some stuff that maybe could be wrong, but I don't dare to fiddle without consulting with you first as I don't have a serial console cable at home :-)

~ # fw_printenv
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=5C:64:8E:32:FC:F7
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S210Y31049101
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
change_boot_part=0
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
sata_init=mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init
sata_bootcmd=echo Booting from SATA ...; setenv fdt_skip_update yes; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/uImage; ext2load scsi 0:1 $load_initrd_addr /boot/uInitrd; run sata_set_bootargs; bootm $load_image_addr $load_initrd_addr
sata_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
bootcmd_custom_sata=if run sata_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
bootcmd_custom=run bootcmd_custom_sata
kernel_addr_1=0x00000000; run bootcmd_custom;

~ # fdisk -l

Disk /dev/loop0: 143 MiB, 149946368 bytes, 292864 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock0: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock1: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock2: 10 MiB, 10485760 bytes, 20480 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock3: 15 MiB, 15728640 bytes, 30720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock4: 106 MiB, 111149056 bytes, 217088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock5: 15 MiB, 15728640 bytes, 30720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mtdblock6: 106 MiB, 111149056 bytes, 217088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/sda: 7.3 TiB, 8001563222016 bytes, 15628053168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3C06B3B1-DC4D-4D77-9383-E1E2DF6C348C

Device     Start       End   Sectors   Size Type
/dev/sda1   2048 292968447 292966400 139.7G EFI System

Disk /dev/sdb: 7.3 TiB, 8001563222016 bytes, 15628053168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 563F91F8-DCE5-4E81-9D60-651BE73C98E9

Device       Start         End     Sectors  Size Type
/dev/sdb1     2048     3999743     3997696  1.9G Linux RAID
/dev/sdb2  3999744     7999487     3999744  1.9G Linux RAID
/dev/sdb3  7999488 15628052479 15620052992  7.3T Linux RAID

Disk /dev/md0: 1.9 GiB, 2045706240 bytes, 3995520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/md1: 1.9 GiB, 2046754816 bytes, 3997568 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes

~ # parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name    Flags
 1      1049kB  150GB  150GB  ext3         rootfs  boot

~ # mount /dev/sda1 /mnt/temp/
~ # ls /mnt/temp/ -la
drwxrwxrwx   21 root     root          4096 Jan 30 11:40 .
drwxr-xr-x    4 1013     1000             0 Jan 30 12:48 ..
drwxr-xr-x    2 root     root          4096 Sep 24 08:32 bin
drwxr-xr-x    3 root     root          4096 Jan 30 11:41 boot
drwxr-xr-x    4 root     root          4096 Jan  2  2017 dev
drwxr-xr-x   73 root     root          4096 Sep 28 05:29 etc
drwxr-xr-x    2 root     root          4096 Sep 12  2016 home
drwxr-xr-x   13 root     root          4096 Sep 24 08:28 lib
drwx------    2 root     root         16384 Jan  9  2017 lost+found
drwxr-xr-x    2 root     root          4096 Jan 20  2017 media
drwxr-xr-x    2 root     root          4096 Jan  2  2017 mnt
drwxr-xr-x    2 root     root          4096 Jan  2  2017 opt
drwxr-xr-x    2 root     root          4096 Sep 12  2016 proc
drwx------    5 root     root          4096 Sep 28 08:24 root
drwxr-xr-x    8 root     root          4096 Aug 25  2019 run
drwxr-xr-x    2 root     root          4096 Sep 24 09:41 sbin
drwxr-xr-x    2 root     root          4096 Jan  2  2017 srv
drwxr-xr-x    2 root     root          4096 Apr  6  2015 sys
drwxrwxrwt    2 root     root          4096 Jan  9  2004 tmp
drwxr-xr-x   11 root     root          4096 Sep 24 08:28 usr
drwxr-xr-x   11 root     root          4096 Jan  2  2017 var
-rw-r--r--    1 root     root           758 Jan 30 11:31 wget-log
~ # ls /mnt/temp/boot/ -la
drwxr-xr-x    3 root     root          4096 Jan 30 11:41 .
drwxrwxrwx   21 root     root          4096 Jan 30 11:40 ..
-rw-r--r--    1 root     root       4461631 Aug  7 22:57 System.map-5.13.8-mvebu-tld-1
-rw-r--r--    1 root     root        205052 Aug  7 22:57 config-5.13.8-mvebu-tld-1
drwxr-xr-x    2 root     root          4096 Aug  8 04:16 dts
-rw-r--r--    1 root     root       9649821 Sep 24 08:53 initrd.img-5.13.8-mvebu-tld-1
-rw-r--r--    1 root     root       7785524 Aug  8 01:54 linux-headers-5.13.8-mvebu-tld-1_1.0_armhf.deb
-rw-r--r--    1 root     root       5237781 Jan 30 11:41 uImage
-rw-r--r--    1 root     root       9649885 Sep 24 08:54 uInitrd
-rwxr-xr-x    1 root     root       5218232 Aug  7 22:57 vmlinuz-5.13.8-mvebu-tld-1
-rwxr-xr-x    1 root     root       5218232 Aug  8 01:40 zImage-5.13.8-mvebu-tld-1
-rwxr-xr-x    1 root     root       5237717 Jan 30 11:40 zImage.fdt
~ # 

Re: Zyxel NAS326 Installation Instruction
January 30, 2022 04:29PM
raffe,

> But it wont boot without the USB at all.
> With USB in it now boots to stock fw.

The envs look OK. So I'm not sure why it did not boot. This problem can be solved when you connect serial console. And we will be able to see what's going on.

change_boot_part=0
curr_bootfrom=1
next_bootfrom=1
kernel_addr_1=0x00000000; run bootcmd_custom;

The key to make it boot from USB or SATA is the above set of envs.

It is risky to change envs without serial console. I've tested the envs many times, so we can have a procedure done in Debian. But this u-boot still has some weird behavior in the logic when it choose stock kernel 1 or 2. Without serial console, it is hard to see.

I'd suggest that you get a serial console in case you can't get it to boot Debian kernel.

In the mean time you can go back to stock by doing Step B4.

Quote

B4. Reverse to stock OS permanently

To reverse the setup, and boot back to stock NAND kernel permanently, execute the following instructions at the Debian command line:

fw_setenv kernel_addr_1 0x00E00000
fw_setenv bootargs 'console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2'
and then reboot
sync
shutdown -r now

After you got it running stock OS without the USB drive. Then proceed to do repeat the section C.

There is also a small chance that the HDD rootfs was not prepared correctly (you missed something). If you have the log of that session when you created the HDD rootfs, please post here.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
January 31, 2022 03:51AM
I have had more time now to compare the attached different fw_printenv

FIRST: If I compare the original fw_printenv with when USB worked:

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


Change:
curr_bootfrom=1
kernel_addr_1=0x00000000; run bootcmd_custom;
next_bootfrom=1


SECOND: If I compare the original fw_printenv with now:

New:
bootcmd_custom_sata=if run sata_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
bootcmd_custom=run bootcmd_custom_sata
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
change_boot_part=0
load_image_addr=0x02000000
load_initrd_addr=0x2900000
sata_bootcmd=echo Booting from SATA ...; setenv fdt_skip_update yes; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/uImage; ext2load scsi 0:1 $load_initrd_addr /boot/uInitrd; run sata_set_bootargs; bootm $load_image_addr $load_initrd_addr
sata_init=mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init
sata_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"


Change:
curr_bootfrom=1
kernel_addr_1=0x00000000; run bootcmd_custom;
next_bootfrom=1


THIRD: If I compare changes in SECOND above ("original fw_printenv compared with now") with the env that should be used under C:

New:
change_boot_part=0
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"

When I compare the fw_setenv under B and C, I see this:

Only in B
fw_setenv change_boot_part 1
fw_setenv usb_bootcmd 'echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr'
fw_setenv usb_init 'mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start'
fw_setenv usb_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'


Only in C
fw_setenv bootcmd_custom_sata 'if run sata_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
fw_setenv sata_bootcmd 'echo Booting from SATA ...; setenv fdt_skip_update yes; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/uImage; ext2load scsi 0:1 $load_initrd_addr /boot/uInitrd; run sata_set_bootargs; bootm $load_image_addr $load_initrd_addr'
fw_setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init'
fw_setenv sata_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'

One change
In B
fw_setenv bootcmd_custom 'if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'

In C
fw_setenv bootcmd_custom 'run bootcmd_custom_sata'

What I have found, it they matter
  1. The "New" stuff under THIRD would not have been there, if I would have only done the hard disk part under C. So maybe something with change_boot_part, as the others don't seem to be used?
  2. Under B we have
      fw_setenv change_boot_part 1
    But now it is
      change_boot_part=0  
  3. For fw_setenv XXX_init B have 003E8800 but C have 003ca800

I also tried again, this time logged in as root on standard FW on NAS326
/mnt/temp # ls
Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2  lost+found
/mnt/temp # whoami
root
/mnt/temp # tar -xjf Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2
/mnt/temp # ls -la
drwxrwxrwx   21 root     root          4096 Jan 31 09:41 .
drwxr-xr-x    5 1013     1000             0 Jan 31 09:28 ..
-rwxr-xr-x    1 root     root     269907402 Jan 31 09:36 Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2
drwxr-xr-x    2 root     root          4096 Jan 31 09:41 bin
drwxr-xr-x    3 root     root          4096 Jan 31 09:41 boot
drwxr-xr-x    4 root     root          4096 Jan 31 09:39 dev
drwxr-xr-x   70 root     root          4096 Jan 31 09:39 etc
drwxr-xr-x    2 root     root          4096 Sep 12  2016 home
drwxr-xr-x   13 root     root          4096 Jan 31 09:41 lib
drwx------    2 root     root         16384 Jan  9  2017 lost+found
drwxr-xr-x    2 root     root          4096 Jan 20  2017 media
drwxr-xr-x    2 root     root          4096 Jan  2  2017 mnt
drwxr-xr-x    2 root     root          4096 Jan  2  2017 opt
drwxr-xr-x    2 root     root          4096 Sep 12  2016 proc
drwx------    5 root     root          4096 Jan 31 09:39 root
drwxr-xr-x    8 root     root          4096 Jan 31 09:41 run
drwxr-xr-x    2 root     root          4096 Jan 31 09:39 sbin
drwxr-xr-x    2 root     root          4096 Jan  2  2017 srv
drwxr-xr-x    2 root     root          4096 Apr  6  2015 sys
drwxrwxrwt    2 root     root          4096 Jan 31 09:41 tmp
drwxr-xr-x   10 root     root          4096 Jan 31 09:40 usr
drwxr-xr-x   11 root     root          4096 Jan 31 09:41 var
/mnt/temp # mount
/proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw)
ubi4:ubi_rootfs1 on /firmware/mnt/nand type ubifs (ro)
/dev/md0 on /firmware/mnt/sysdisk type ext4 (ro)
/firmware/mnt/sysdisk/sysdisk.img on /ram_bin type ext2 (ro)
/ram_bin/usr on /usr type none (ro,bind)
/ram_bin/lib/security on /lib/security type none (ro,bind)
/ram_bin/lib/modules on /lib/modules type none (ro,bind)
/ram_bin/lib/locale on /lib/locale type none (ro,bind)
/dev/ram0 on /tmp/tmpfs type tmpfs (rw,size=5m)
/tmp/tmpfs/usr_etc on /usr/local/etc type none (rw,bind)
ubi2:ubi_config on /etc/zyxel type ubifs (rw)
configfs on /sys/kernel/config type configfs (rw)
/dev/sda1 on /mnt/temp type ext3 (rw)
/mnt/temp # cd boot/
/mnt/temp/boot # cp -a zImage-5.2.9-mvebu-tld-1 zImage.fdt
/mnt/temp/boot # cat dts/armada-380-zyxel-nas326.dtb >> zImage.fdt
/mnt/temp/boot # ../usr/bin/mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5
.2.9-mvebu-tld-1 -d zImage.fdt uImage
Image Name:   Linux-5.2.9-mvebu-tld-1
Created:      Mon Jan 31 09:45:17 2022
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    5077016 Bytes = 4958.02 KiB = 4.84 MiB
Load Address: 00008000
Entry Point:  00008000
/mnt/temp/boot # sync
/mnt/temp/boot # sync
/mnt/temp/boot # cd /
/ # sync
~ # parted -l
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name    Flags
 1      1049kB  150GB  150GB  ext3         rootfs  boot


Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sdb: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2048MB  2047MB                     raid
 2      2048MB  4096MB  2048MB                     raid
 3      4096MB  8002GB  7997GB                     raid


Model: Linux Software RAID Array (md)
Disk /dev/md0: 2046MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system  Flags
 1      0.00B  2046MB  2046MB  ext4


Model: Linux Software RAID Array (md)
Disk /dev/md1: 2047MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags:

Number  Start  End     Size    File system     Flags
 1      0.00B  2047MB  2047MB  linux-swap(v1)


Error: /dev/mtdblock0: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock0: 2097kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock1: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock1: 2097kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock2: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock2: 10.5MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock3: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock3: 15.7MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock4: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock4: 111MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock5: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock5: 15.7MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

Error: /dev/mtdblock6: unrecognised disk label
Model: Unknown (unknown)
Disk /dev/mtdblock6: 111MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:

/ # reboot
It booted to stock FW
I did the stuff under C again (before and after all the fw_setenv, fw_printenv shows same as in fw_printenv_new_after_HardDisk2.txt)
I sync and reboot again and wait about 10 min (you never know ;-), but nothing. Maybe it is "reboot" command not working OK.
I disconnect power and then start it again, now it boots to stock fw again (without USB).

EDIT
Could the problem be GPT, same as for mahowi here https://forum.doozan.com/read.php?2,88619,98174#msg-98174
Quote
mahowi
Ok, one problem solved. :-) u-boot doesn't like GPT. I accidentally used GPT instead of MBR when creating a new partition on my stick. Now my NAS boots into Debian.
And Tasmin here https://forum.doozan.com/read.php?2,88619,126029#msg-126029
Quote
Tasmin
I figured out the problem with the ssd format. The partition table type was "gpt", and after I wrote the partition table with type "msdos" then created an "ext3" type partition with label "rootfs", and followed the rest of the instructions, I was able to boot NAS326 from it.



Edited 4 time(s). Last edit at 01/31/2022 08:44AM by raffe.
Attachments:
open | download - fw_printenv_original.txt (3.6 KB)
open | download - fw_printenv_new_USB_before_HardDisk.txt (4.7 KB)
open | download - fw_printenv_new_after_HardDisk2.txt (5.1 KB)
Re: Zyxel NAS326 Installation Instruction
January 31, 2022 03:43PM
raffe,


> Could the problem be GPT, same as for mahowi here
> https://forum.doozan.com/read.php?2,88619,98174#msg-98174

Yes, that should be the reason. This u-boot is old, and it was not built to boot from storage drives. So use MBR partition table is a safest way for rootfs partition.

As I mentioned, these 3 envs below are relevant. Basically they will change each time the box fails to boot. That's how this u-boot keep track of which kernel to boot the next boot (because there is a problem booting during current boot).

change_boot_part=0
curr_bootfrom=1
next_bootfrom=1

If you look closely at the way I set up the envs, you'll recognize that I did not change kernel_addr_2. This is very important, so that when everything is messed up, the box will be able to fall back to stock kernel 2. We will only tweak kernel_addr_1 env so we can boot with USB or HDD from that path.

If you have serial console, you can change them without worrying of bricking. If you don't have serial console, it is a bit risky to play with them. The logic in this u-boot might have bug that could lock you out (soft bricked). And then you need to connect serial console to recover anyway.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
February 01, 2022 04:06AM
I found a serial adapter, so this is what it says in the beginning (the whole boot is in attached Boot1.txt)
DDR3 Training Sequence - Ver TIP-1.26.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 Training Sequence - Switching XBAR Window to FastPath Window 
DDR3 Training Sequence - Ended Successfully
Not detected suspend to RAM indication
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_ 
        | | | |___|  _ \ / _ \ / _ \| __| 
        | |_| |___| |_) | (_) | (_) | |_ 
         \___/    |____/ \___/ \___/ \__| 
 ** LOADER **


U-Boot 2013.01-svn48206 (Dec 03 2015 - 02:50:37) Marvell version: 2014_T3.0p6

Board: RD-NAS-88F6820-DDR3
mvCtrlRevNameGet: Error: Failed to read Revision ID
SoC:   MV88F6810
       running 1 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1332 [MHz]
       L2     @ 666 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 666 [MHz]
       DDR 32 Bit Width, FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB

Map:   Code:                    0x1fed0000:0x1ff95e28
       BSS:                     0x1ffef2b4
       Stack:                   0x1f9cff20
       Heap:                    0x1f9d0000:0x1fed0000
       U-Boot Environment:      0x00200000:0x00280000 (NAND)

NAND:  256 MiB
MMC:   mv_sdh: 0
*** Booting kernel from kernel 1 @0x00000000; run bootcmd_custom;  ***
USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode
Board configuration detected:
Net:   
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x01     |
egiga0 [PRIME]
Hit any key to stop autoboot:  0 

NAND read: device 0 whole chip
Attempt to read outside the flash area
 0 bytes read: ERROR
Booting from SATA ...
AHCI init for unit0
Target spinup took 0 ms.
Target spinup took 0 ms.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
timeout exit!
timeout exit!
Found 0 device(s).
** Bad device scsi 0 **
** Bad device scsi 0 **
Wrong Image Format for bootm command
ERROR: can't get kernel image!
Booting from NAND kernel 1 ...

NAND read: device 0 offset 0xe00000, size 0xf00000
 15728640 bytes read: OK
*  kernel: cmdline image address = 0x02000000

Starting kernel ...

Init SATA for SSD ...
Power on HDD1 ...
Power on HDD2 ...
Power on USB ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
...
...
While I have these envs
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_el
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x00000000; run bootcmd_custom;  0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_custom=run bootcmd_custom_sata
bootcmd_custom_sata=if run sata_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig vide;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootdelay=3
cacheShare=no
change_boot_part=0
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
curr_bootfrom=1
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=5C:64:8E:32:FC:F7
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
kernel_addr=${kernel_addr_1}
kernel_addr_1=0x00000000; run bootcmd_custom; 
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
load_image_addr=0x02000000
load_initrd_addr=0x2900000
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
next_bootfrom=1
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_bootcmd=echo Booting from SATA ...; setenv fdt_skip_update yes; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/uImage; ext2load scsi 0:1 $load_initrd_addr /boot/uInitrd; runr
sata_delay_reset=0
sata_dma_mode=yes
sata_init=mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; scsi init
sata_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
script_addr_r=3000000
script_name=boot.scr
serial_number=S210Y31049101
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_r
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
IF it is GPT and I need to use MBR on a 8TB disk, is there still a way to use more than 2TB on it? Should I try hybrid MBR/GPT like https://wiki.gentoo.org/wiki/Hybrid_partition_table ?



Edited 1 time(s). Last edit at 02/01/2022 07:24AM by raffe.
Attachments:
open | download - Boot1.txt (44.5 KB)
Re: Zyxel NAS326 Installation Instruction
February 01, 2022 04:10PM
raffe,

> IF it is GPT and I need to use MBR on a 8TB disk,
> is there still a way to use more than 2TB on it?

Yes, it does look like GPT partition is the problem. To verify this, you can create 4 partitions on the 8TB HDD and the first partition is the rootfs. Boot with it. Or create a USB rootfs with GPT partition table to test.

> Should I try hybrid MBR/GPT like
> https://wiki.gentoo.org/wiki/Hybrid_partition_table
> ?

I never like Hybrid partition. That's the main reason I created new u-boots for the Kirkwood boxes from way back.

For this Armada 380 box I don't have new u-boot, so I run the rootfs from USB. Contrary to coventional wisdom, several of my NAS boxes have USB rootfs, and never have problem. This is the precaution I took to avoid wearing out tthe drive:

Wiki thread
Quote
https://forum.doozan.com/read.php?2,23630

Flash drives issues

How to prolong the life of your rootfs USB thumb drive

Once a while you could shutdown and take the USB out and and backup it. Or running a rsync cron job to backup to another USB drive daily.

Or in some scenario where the USB ports are really crowded, you can put the kernel uImage and uInitrd on NAND and then the HDD can be GPT.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
February 02, 2022 06:33AM
Quote

To verify this, you can create 4 partitions on the 8TB HDD and the first partition is the rootfs. Boot with it. Or create a USB rootfs with GPT partition table to test
Do you mean that I could try to make 4 MBR partitions on the 8TB HDD, and the first is the one with the rootfs stuff (as in MBR we can not name partitions)? OK, will try that. I will edit this post when done.

Quote

Or in some scenario where the USB ports are really crowded, you can put the kernel uImage and uInitrd on NAND and then the HDD can be GPT.
Oh, this sounds interesting! How can I do it?

EDIT
I did this to test MBR
/ # parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size   File system  Name    Flags
 1      1049kB  150GB  150GB  ext4         rootfs

(parted) mklabel                                                          
New disk label type? msdos                                                
Warning: The existing disk label on /dev/sda will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? Yes                                                               
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start  End  Size  Type  File system  Flags

(parted) mkpart                                                           
Partition type?  primary/extended? primary                                
File system type?  [ext2]? ext3                                           
Start? 1MB                                                                
End? 150GB                                                                
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  150GB  150GB  primary  ext4

(parted) quit                                                             
Information: You may need to update /etc/fstab.

/ # mke2fs -j /dev/sda1                                                   
mke2fs 1.42.12 (29-Aug-2014)
/dev/sda1 contains a ext4 file system
        last mounted on /mnt/temp on Tue Feb  1 16:16:41 2022
Proceed anyway? (y,n) y
Creating filesystem with 36620800 4k blocks and 9158656 inodes
Filesystem UUID: 963f08ef-5a52-4689-b9f5-2b751a298f78
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done     

/ # parted /dev/sda
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  150GB  150GB  primary  ext3

(parted) quit                                                             

/ # mount /dev/sda1 /mnt/hdd/
EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
/ # cd /mnt/hdd/
/mnt/hdd # ls
lost+found
/mnt/hdd # cp ../nas/Temp/Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2 .
/mnt/hdd # tar -xjf Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2
/mnt/hdd # whoami
root
/mnt/hdd # cd boot/
/mnt/hdd/boot # cp -a zImage-5.2.9-mvebu-tld-1 zImage.fdt
cat dts/armada-380-zyxel-nas326.dtb >>/mnt/hdd/boot # cat dts/armada-380-zyxel-nas326.dtb >> zImage.fdt
../mnt/hdd/boot # ../usr/bin/mkimage -A arm -O linux -T kernel -C none -a 0x000080
00 -e 0x00008000 -n Linux-5.2.9-mvebu-tld-1 -d zImage.fdt uImage
Image Name:   Linux-5.2.9-mvebu-tld-1
Created:      Wed Feb  2 14:11:40 2022
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    5077016 Bytes = 4958.02 KiB = 4.84 MiB
Load Address: 00008000
Entry Point:  00008000
/mnt/hdd/boot # sync
/mnt/hdd/boot # sync
/mnt/hdd/boot # cd /
/ # umount /mnt/hdd/
/ # umount /mnt/nas/
/ # fw_setenv curr_bootfrom 1
fw_setenv next_bootfrom 1
fw_setenv load_initrd_addr 0x2900000
fw_setenv load_im/ # fw_setenv next_bootfrom 1
age_addr 0x02000000
fw_setenv set_bootargs_stock 'setenv bootargs "console=ttyS0/ # fw_setenv load_initrd_addr 0x2900000
115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
fw_set/ # fw_setenv load_image_addr 0x02000000
env bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND kernel 1 ...; / # fw_setenv set_bootargs_stoc=
4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"'
and read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
fw_setenv bootcmd_stock_2 'run/ # fw_setenv bootcmd_stock_1 'run set_bootargs_stock; echo Booting from NAND ke
rnel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000'
 set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x/ # fw_setenv bootcmd_stock_2 'rue
rnel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000'
fw_setenv sata_init 'mw.l f1018100 20420000; mw.l f1018140 003ca800; sleep 3; sc/ # fw_setenv sata_init 'mw.l f103
; scsi init'
fw_setenv sata_bootcmd 'echo Booting from SATA ...; setenv fdt_skip_update yes; / # fw_setenv sata_bootcmd 'echo y
es; run sata_init; ext2load scsi 0:1 $load_image_addr /boot/uImage; ext2load scs
i 0:1 $load_initrd_addr /boot/uInitrd; run sata_set_bootargs; bootm $load_image_
addr $load_initrd_addr'
fw_setenv sata_set_bootargs 'setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs / # fw_setenv sata_set_bootaE
L=rootfs rootdelay=10 $mtdparts earlyprintk=serial"'
fw_setenv bootcmd_custom_sata 'if run sata_bootcmd; then; else if run bootcmd_st/ # fw_setenv bootcmd_custom_satam
d_stock_1; then; else run bootcmd_stock_2; reset; fi; fi'
fw_setenv bootcmd_custom 'run bootcmd_custom_sata'
fw_setenv kernel_addr_1 '0x0/ # fw_setenv bootcmd_custom 'run bootcmd_custom_sata'
000000; run bootcmd_custom; '/ # fw_setenv kernel_addr_1 '0x00000000; run bootcmd_custom; '
/ # reboot
/ # Feb  2 13:25:59 NAS326 linuxrc: starting pid 3591, tty '': '/etc/init.d/rc.shutdown'
- rc.shutdown start -

The start and end of the boot (the whole boot is in the attached Boot2.txt) seems to indicate that it works with MBR. But maybe need some fix for "ALERT! LABEL=rootfs does not exist" as MBR do not use labels on partitions, if MBR is the only solution. But the NAND stuff sounds better.
BootROM - 1.73
Booting from NAND flash

General initialization - Version: 1.0.0
Detected Device ID 6810
High speed PHY - Version: 2.0

Init RD NAS topology board SerDes lanes topology details:
 | Lane #  | Speed |  Type       |
 --------------------------------
 |   0    |  06   |  SATA0      |
 |   1    |  05   |  USB3 HOST0 |
 |   2    |  06   |  SATA1      |
 |   5    |  05   |  USB3 HOST1 |
 --------------------------------
High speed PHY - Ended Successfully
DDR3 Training Sequence - Ver TIP-1.26.0
mvSysEnvGetTopologyUpdateInfo: TWSI Read failed
DDR3 Training Sequence - Switching XBAR Window to FastPath Window 
DDR3 Training Sequence - Ended Successfully
Not detected suspend to RAM indication
BootROM: Image checksum verification PASSED

 __   __                      _ _
|  \/  | __ _ _ ____   _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| |  | | (_| | |   \ V /  __/ | |
|_|  |_|\__,_|_|    \_/ \___|_|_|
         _   _     ____              _
        | | | |   | __ )  ___   ___ | |_ 
        | | | |___|  _ \ / _ \ / _ \| __| 
        | |_| |___| |_) | (_) | (_) | |_ 
         \___/    |____/ \___/ \___/ \__| 
 ** LOADER **


U-Boot 2013.01-svn48206 (Dec 03 2015 - 02:50:37) Marvell version: 2014_T3.0p6

Board: RD-NAS-88F6820-DDR3
mvCtrlRevNameGet: Error: Failed to read Revision ID
SoC:   MV88F6810
       running 1 CPUs
CPU:   ARM Cortex A9 MPCore (Rev 1) LE
       CPU 0
       CPU    @ 1332 [MHz]
       L2     @ 666 [MHz]
       TClock @ 200 [MHz]
       DDR    @ 666 [MHz]
       DDR 32 Bit Width, FastPath Memory Access, DLB Enabled, ECC Disabled
DRAM:  512 MiB

Map:   Code:                    0x1fed0000:0x1ff95e28
       BSS:                     0x1ffef2b4
       Stack:                   0x1f9cff20
       Heap:                    0x1f9d0000:0x1fed0000
       U-Boot Environment:      0x00200000:0x00280000 (NAND)

NAND:  256 MiB
MMC:   mv_sdh: 0
*** Booting kernel from kernel 1 @0x00000000; run bootcmd_custom;  ***
USB2.0 0: Host Mode
USB3.0 0: Host Mode
USB3.0 1: Host Mode
Board configuration detected:
Net:   
|  port  | Interface | PHY address  |
|--------|-----------|--------------|
| egiga0 |   RGMII   |     0x01     |
egiga0 [PRIME]
Hit any key to stop autoboot:  0 

NAND read: device 0 whole chip
Attempt to read outside the flash area
 0 bytes read: ERROR
Booting from SATA ...
AHCI init for unit0
Target spinup took 0 ms.
Target spinup took 0 ms.

Error: SCSI Controller(s) 1B4B:9215 1B4B:9235 not found
scanning bus for devices...
  Device 0: (0:0) Vendor: ATA Prod.:  Rev: 
            Type: Hard Disk
            Capacity: 258975.3 MB = 252.9 GB (530381604 x 512)
timeout exit!
Found 1 device(s).
5077080 bytes read in 200 ms (24.2 MiB/s)
9488618 bytes read in 239 ms (37.9 MiB/s)
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   Linux-5.2.9-mvebu-tld-1
   Created:      2022-02-02  13:11:40 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5077016 Bytes = 4.8 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 02900000 ...
   Image Name:   initramfs-5.2.9-mvebu-tld-1
   Created:      2019-08-26  11:03:27 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9488554 Bytes = 9 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
[    0.000000][    T0] Booting Linux on physical CPU 0x0
...
...
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  LABEL=rootfs does not exist.  Dropping to a shell!


BusyBox v1.30.1 (Debian 1:1.30.1-4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)
As I will use the disks for backup, it would be best if the partitions are big. So "put the kernel uImage and uInitrd on NAND" sound like a good idea! How can I do it?



Edited 9 time(s). Last edit at 02/02/2022 09:46AM by raffe.
Attachments:
open | download - Boot2.txt (28.4 KB)
Re: Zyxel NAS326 Installation Instruction
February 02, 2022 03:59PM
raffe,

> Do you mean that I could try to make 4 MBR
> partitions on the 8TB HDD, and the first is the
> one with the rootfs stuff (as in MBR we can not
> name partitions)?

That's incorrect. Either label it while you're formatting:

mkfs.ext3 -L rootfs /dev/sda1
or after formatting:
e2label /dev/sda1 rootfs

> Oh, this sounds interesting! How can I do it?

For this box, there is no compelling reason to put the kernel files on NAND. You have plenty of USB ports. Puting kernel on NAND make it inconvenient to upgrade kernel (issue with wearing out flash). I would do that only if I have no choice.

> - Boot args (cat /proc/cmdline)
> - Check rootdelay= (did the system wait long
> enough?)
> - Missing modules (cat /proc/modules; ls /dev)
> ALERT! LABEL=rootfs does not exist. Dropping to
> a shell!

Yeah, label the first partition rootfs, and this will no longer a problem.

After you've booted with USB rootfs, repartition one of the HDD to use GPT (2 partitions, the first is the rootfs, the second is the rest of 8TB), create the rootfs on the first partition.
Boot with USB rootfs, and post the log, and I will suggest more regarding the files arrangement between USB and HDD rootfs.

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



Edited 1 time(s). Last edit at 02/02/2022 04:48PM by bodhi.
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 12:22AM
OK, I did this
root@debian:~# whoami
root
root@debian:~# parted
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? Yes                                                               
(parted) mkpart rootfs ext3 1MB 150GB                                                                             
(parted) mkpart backup1 ext4 150GB 100%
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  150GB   150GB   ext3         rootfs
 2      150GB   8002GB  7852GB  ext4         backup1

(parted) select /dev/sdb                                                  
[ 1594.088772][ T1789]  sda: sda1 sda2
Using /dev/sdb
(parted) mkpart backup2 ext4 1MB 100%                                                                             
(parted) print                                                            
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sdb: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  8002GB  8002GB  ext4         backup2

(parted) quit                                                             
Information: You may need to update /etc/fstab.

       [ 1701.381342][ T1789]  sdb: sdb1
root@debian:~# parted -l
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  150GB   150GB   ext3         rootfs
 2      150GB   8002GB  7852GB               backup1


Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sdb: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  8002GB  8002GB               backup2


Model:  USB FLASH DRIVE (scsi)
Disk /dev/sdc: 1032MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1028MB  1027MB  primary  ext3


Error: /dev/mtdblock4: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock4: 111MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock2: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock2: 10.5MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock0: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock0: 2097kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock5: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock5: 15.7MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock3: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock3: 15.7MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock1: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock1: 2097kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock6: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock6: 111MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

root@debian:~# mke2fs -j /dev/sda1
mke2fs 1.46.2 (28-Feb-2021)
/dev/sda1 contains a ext3 file system
        last mounted on /mnt/temp on Wed Feb  2 06:18:54 2022
Proceed anyway? (y,N) y
Creating filesystem with 36620800 4k blocks and 9158656 inodes
Filesystem UUID: 4e7f4895-025a-4c76-99da-7d29674ae6a5
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done     

root@debian:~# mkfs.ext4 /dev/sda2
mke2fs 1.46.2 (28-Feb-2021)
Creating filesystem with 1916885504 4k blocks and 239611904 inodes
Filesystem UUID: ddbe347e-9646-413d-895b-76799097e12f
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000, 214990848, 512000000, 550731776, 644972544

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done       

root@debian:~# mkfs.ext4 /dev/sdb1
mke2fs 1.46.2 (28-Feb-2021)
/dev/sdb1 contains a linux_raid_member file system labelled 'NAS326:0'
Proceed anyway? (y,N) y
Creating filesystem with 1953506304 4k blocks and 244191232 inodes
Filesystem UUID: bcf0de3b-19b3-4d72-b31c-ac01aaa99852
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done       

root@debian:/# mkdir /mnt/temp
root@debian:/# mount /dev/sda1 /mnt/temp/
[ 1430.789955][ T2929] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem
[ 1433.644858][ T2929] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
root@debian:/# cd mnt/temp/
root@debian:/mnt/temp# ls
.  ..  lost+found
root@debian:/mnt/temp# ls /boot/ -la
total 51560
drwxr-xr-x  3 root root    4096 Jan 30 00:51 .
drwxrwxrwx 21 root root    4096 Jan 20  2017 ..
-rw-r--r--  1 root root 4461631 Aug  7 14:57 System.map-5.13.8-mvebu-tld-1
-rw-r--r--  1 root root  205052 Aug  7 14:57 config-5.13.8-mvebu-tld-1
drwxr-xr-x  2 root root    4096 Aug  7 20:16 dts
-rw-r--r--  1 root root 9649821 Sep 24 00:53 initrd.img-5.13.8-mvebu-tld-1
-rw-r--r--  1 root root 7785524 Aug  7 17:54 linux-headers-5.13.8-mvebu-tld-1_1.0_armhf.deb
-rw-r--r--  1 root root 5237781 Jan 30 00:51 uImage
-rw-r--r--  1 root root 9649885 Sep 24 00:54 uInitrd
-rwxr-xr-x  1 root root 5218232 Aug  7 14:57 vmlinuz-5.13.8-mvebu-tld-1
-rwxr-xr-x  1 root root 5218232 Aug  7 17:40 zImage-5.13.8-mvebu-tld-1
-rwxr-xr-x  1 root root 5237717 Jan 30 00:47 zImage.fdt
odhi.tar.bz2 .nt/temp# cp /mnt/nas/Temp/Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2 .
root@debian:/mnt/temp# ls -la
total 274472
drwxr-xr-x 3 root root      4096 Feb  2 22:43 .
drwxr-xr-x 4 root root      4096 Feb  2 22:34 ..
-rwxr-xr-x 1 root root 280753320 Feb  2 22:43 Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2
drwx------ 2 root root     16384 Feb  2 22:26 lost+found
root@debian:/mnt/temp# 
root@debian:/mnt/temp# tar -xjf Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2 
root@debian:/mnt/temp# cd boot/
root@debian:/mnt/temp/boot# cp -a zImage-5.13.8-mvebu-tld-1 zImage.fdt 
root@debian:/mnt/temp/boot# cat dts/armada-380-zyxel-nas326.dtb >> zImage.fdt
root@debian:/mnt/temp/boot# mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-5.13.8-mvebu-tld-1 -d zImage.fdt uImage 
Image Name:   Linux-5.13.8-mvebu-tld-1
Created:      Wed Feb  2 22:48:30 2022
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    5237717 Bytes = 5114.96 KiB = 5.00 MiB
Load Address: 00008000
Entry Point:  00008000
root@debian:/mnt/temp/boot# 
root@debian:/mnt/temp/boot# sync
root@debian:/mnt/temp/boot# sync
root@debian:/mnt/temp/boot# cd /
root@debian:/# umount /mnt/nas/
root@debian:/# umount /mnt/temp/
root@debian:/# sync
root@debian:/# reboot
Then I rebooted, see attached Boot3.txt



Edited 2 time(s). Last edit at 02/03/2022 12:56AM by raffe.
Attachments:
open | download - Boot3.txt (38.8 KB)
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 02:57AM
Recap.

[    4.449584][  T575] sd 0:0:0:0: [sda] 15628053168 512-byte logical blocks: (8.00 TB/7.28 TiB)
[    4.481691][ T1402] sd 1:0:0:0: [sdb] 15628053168 512-byte logical blocks: (8.00 TB/7.28 TiB)
[    5.812236][ T1402] sd 2:0:0:0: [sdc] 2015232 512-byte logical blocks: (1.03 GB/984 MiB)
root@debian:~# df
Filesystem     1K-blocks   Used Available Use% Mounted on
udev              245984      0    245984   0% /dev
tmpfs              50244   1512     48732   4% /run
/dev/sdc1         969108 899272     19712  98% /
tmpfs               5120      0      5120   0% /run/lock
tmpfs             100480      0    100480   0% /dev/shm
tmpfs             251208      0    251208   0% /tmp


Disk /dev/sda: 8002GB

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  150GB   150GB   ext3         rootfs
 2      150GB   8002GB  7852GB  ext4         backup1
Disk /dev/sdb: 8002GB
 1      1049kB  8002GB  8002GB  ext4         backup2
Disk /dev/sdc: 1032MB
 1      1049kB  1028MB  1027MB  primary  ext3

Currently, even though the rootfs exists in both the USB drive and the HDD. The system has booted using the USB rootfs.

So now we want it to boot using the kernel files on USB, but run the rootfs on /dev/sda1.

The old convention is to label the boot partition as boot. But it is quite confusing, so I'd prefer to label it kernel.

e2label /dev/sdc1 kernel

Now when you reboot, u-boot will load the kernel files from the USB drive folder /boot/uImage and /boot/uInitrd. But when the kernel mount the rootfs, it will find the rootfs on /dev/sda1.

That's it. It would be enough to keep it this way.

However, to make the configuration clean, you would want to remove all other files on the USB drive and leave only 2 files (it is no longer the rootfs).

/boot/uImage
/boot/uInitrd

Note that after you've booted and run Debian, the USB drive is no longer play any role, you could umount and remove it too. This is in a way, similar to when you keep kernel files on NAND. Except that you can replace the USB drive any time when needed.

Each time you upgrade kernel, you would need to recopy the uImage and uInitrd files from /dev/sda1 (the rootfs) to /dev/sdc1 (kernel).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 05:17AM
It still do not want to start with hard disk.
NOTE: I have changed the USB disk to a physically smaller one, from 10 cm to 0,5 cm, then it will not be in the way. And I can use the old to boot up OK, while we are trying this.

Anyway, I booted it up with the new USB just fine, see Boot4.txt, and did this:
root@debian:~# parted -l
Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sda: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  150GB   150GB   ext3         rootfs
 2      150GB   8002GB  7852GB  ext4         backup1


Model: ATA WDC WD80EFBX-68A (scsi)
Disk /dev/sdb: 8002GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  8002GB  8002GB  ext4         backup2


Model:  USB  SanDisk 3.2Gen1 (scsi)
Disk /dev/sdc: 15.4GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      16.4kB  15.4GB  15.4GB  primary  ext3         lba


Error: /dev/mtdblock4: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock4: 111MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock2: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock2: 10.5MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock0: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock0: 2097kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock5: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock5: 15.7MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock3: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock3: 15.7MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock1: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock1: 2097kB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

Error: /dev/mtdblock6: unrecognised disk label
Model: Unknown (unknown)                                                  
Disk /dev/mtdblock6: 111MB
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags: 

root@debian:~# fdisk -l
Disk /dev/mtdblock0: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock1: 2 MiB, 2097152 bytes, 4096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock2: 10 MiB, 10485760 bytes, 20480 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock3: 15 MiB, 15728640 bytes, 30720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock4: 106 MiB, 111149056 bytes, 217088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock5: 15 MiB, 15728640 bytes, 30720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock6: 106 MiB, 111149056 bytes, 217088 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: WDC WD80EFBX-68A
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: EDDE7AA3-5062-4B0E-AC08-11D7C1E09CBD

Device         Start         End     Sectors   Size Type
/dev/sda1       2048   292968447   292966400 139.7G Linux filesystem
/dev/sda2  292968448 15628052479 15335084032   7.1T Linux filesystem


Disk /dev/sdb: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: WDC WD80EFBX-68A
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 5A084138-AA5D-4949-ABFF-C50F956E0CD2

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 15628052479 15628050432  7.3T Linux filesystem


Disk /dev/sdc: 14.32 GiB, 15376318464 bytes, 30031872 sectors
Disk model:  SanDisk 3.2Gen1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdc1          32 30031871 30031840 14.3G  c W95 FAT32 (LBA)


root@debian:~# 
root@debian:~# 
root@debian:~# 
root@debian:~# 
root@debian:~# e2label /dev/sdc1 kernel
root@debian:~# reboot
But when I reboot, it end with this, see Boot5.txt
...
...
[   35.082069][   T20] v5.0-sata1: disabling
[   35.086127][   T20] v12.0-sata1: disabling
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
Begin: Running /scripts/local-block ... done.
done.
Gave up waiting for root file system device.  Common problems:
 - Boot args (cat /proc/cmdline)
   - Check rootdelay= (did the system wait long enough?)
 - Missing modules (cat /proc/modules; ls /dev)
ALERT!  LABEL=rootfs does not exist.  Dropping to a shell!


BusyBox v1.30.1 (Debian 1:1.30.1-6+b3) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs)
I also tried to power it down, and then start it. But the same, see Boot6.txt

EDIT!!!
I took a chance and tried
e2label /dev/sda1 rootfs


Then I rebooted with the new USB.
And YES, now it boot to /dev/sda1

bound to 192.168.222.62 -- renewal in 1515 seconds.

.

Debian GNU/Linux 11 debian ttyS0

debian login: root
Password: 
Linux debian 5.13.8-mvebu-tld-1 #1.0 SMP PREEMPT Sat Aug 7 14:58:41 PDT 2021 armv7l

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.
Last login: Mon Sep 27 22:36:43 PDT 2021 from 192.168.0.100 on pts/0
debian
192.168.222.6
Zyxel NAS326
Linux version 5.13.8-mvebu-tld-1 (root@tldDebian) (gcc (Debian 8.3.0-6) 8.3.0, GNU ld (GNU Binutils for Debian) 2.31.1) #1.0 SMP PREEMPT Sat Aug 7 14:58:41 PDT 2021
Debian 11.0
Thu Feb 3 05:14:20 PST 2022 up 2 minutes
root@debian:~# df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              245984       0    245984   0% /dev
tmpfs              50244    1512     48732   4% /run
/dev/sda1      143074516 1059476 134690880   1% /
tmpfs               5120       0      5120   0% /run/lock
tmpfs             100480       0    100480   0% /dev/shm
tmpfs             251208       0    251208   0% /tmp

Then I continued to test to use the envs for hard drive booting, and the rebooted. But it will still not boot with only hard drive.

So I changed it back to boot from USB, and that worked well as above.
Then I removed all other files on the USB drive and left only the 2 files under, and it still boots OK.
/boot/uImage
/boot/uInitrd
After that I fixed obsolete sources in /etc/apt/source, did apt update and upgrade before I upgraded to kernel 5.15.5 (also uImage and uInitrd on USB) and everything seems to work OK.

Thank you very much for all your help! <3



Edited 4 time(s). Last edit at 02/03/2022 09:37AM by raffe.
Attachments:
open | download - Boot4.txt (34 KB)
open | download - Boot5.txt (31.2 KB)
open | download - Boot6.txt (29 KB)
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 12:14PM
@raffe: Could you test for me if the NAS326 supports wake on RTC? In that case the command
echo `date '+%s' -d '+ 1 minutes'` > /sys/class/rtc/rtc0/wakealarm ; poweroff
(run as root) should poweroff the NAS, and after 1 minute it should wakeup again.

Thanks in advance.
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 01:10PM
@Mijzelf : I did this on NAS326
root@debian:~# date
Thu Feb  3 20:03:55 CET 2022
root@debian:~# echo `date '+%s' -d '+ 1 minutes'` > /sys/class/rtc/rtc0/wakealarm ; poweroff
root@debian:~#
Broadcast message from root@debian (pts/0) (Thu Feb  3 20:03:57 2022):

The system is going down for system halt NOW!
login as: root
root@192.168.222.115's password:
Linux debian 5.15.5-mvebu-tld-1 #1.0 SMP PREEMPT Wed Dec 1 16:26:36 PST 2021 armv7l

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.
Last login: Thu Feb  3 19:59:28 2022 from 192.168.222.25
debian
192.168.222.1
Zyxel NAS326
Linux version 5.15.5-mvebu-tld-1 (root@tldDebianVM) (arm-linux-gnueabihf-gcc (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04) 7.5.0, GNU ld (GNU Binutils for Ubuntu) 2.30) #1.0 SMP PREEMPT Wed Dec 1 16:26:36 PST 2021
Debian 11.2
Thu Feb 3 20:06:48 CET 2022 up 1 minute
root@debian:~# date
Thu Feb  3 20:06:51 CET 2022
root@debian:~#
And this on another computer
PS C:\Users\> ping.exe -t 192.168.222.115|Foreach{"{0} - {1}" -f (Get-Date),$_}
2022-02-03 20:03:52 -
2022-02-03 20:03:52 - Pinging 192.168.222.115 with 32 bytes of data:
2022-02-03 20:03:52 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:03:53 - Reply from 192.168.222.115: bytes=32 time=93ms TTL=64
2022-02-03 20:03:54 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:03:55 - Reply from 192.168.222.115: bytes=32 time=2ms TTL=64
2022-02-03 20:03:56 - Reply from 192.168.222.115: bytes=32 time=2ms TTL=64
2022-02-03 20:04:01 - Request timed out.
2022-02-03 20:04:05 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:08 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:11 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:14 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:17 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:20 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:23 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:26 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:29 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:32 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:35 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:38 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:41 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:44 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:47 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:50 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:53 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:56 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:04:59 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:02 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:05 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:08 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:11 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:14 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:17 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:20 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:23 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:26 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:29 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:32 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:35 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:38 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:41 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:44 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:47 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:50 - Reply from 192.168.222.25: Destination host unreachable.
2022-02-03 20:05:50 - Reply from 192.168.222.115: bytes=32 time=5ms TTL=64
2022-02-03 20:05:51 - Reply from 192.168.222.115: bytes=32 time=32ms TTL=64
2022-02-03 20:05:52 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:05:53 - Reply from 192.168.222.115: bytes=32 time=14ms TTL=64
2022-02-03 20:05:58 - Request timed out.
2022-02-03 20:06:03 - Request timed out.
2022-02-03 20:06:08 - Request timed out.
2022-02-03 20:06:13 - Request timed out.
2022-02-03 20:06:18 - Request timed out.
2022-02-03 20:06:23 - Request timed out.
2022-02-03 20:06:28 - Request timed out.
2022-02-03 20:06:29 - Reply from 192.168.222.115: bytes=32 time=11ms TTL=64
2022-02-03 20:06:30 - Reply from 192.168.222.115: bytes=32 time=4ms TTL=64
2022-02-03 20:06:31 - Reply from 192.168.222.115: bytes=32 time=4ms TTL=64
2022-02-03 20:06:32 - Reply from 192.168.222.115: bytes=32 time=2ms TTL=64
2022-02-03 20:06:33 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:06:34 - Reply from 192.168.222.115: bytes=32 time=5ms TTL=64
2022-02-03 20:06:35 - Reply from 192.168.222.115: bytes=32 time=23ms TTL=64
2022-02-03 20:06:36 - Reply from 192.168.222.115: bytes=32 time=7ms TTL=64
2022-02-03 20:06:37 - Reply from 192.168.222.115: bytes=32 time=2ms TTL=64
2022-02-03 20:06:38 - Reply from 192.168.222.115: bytes=32 time=4ms TTL=64
2022-02-03 20:06:39 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:06:40 - Reply from 192.168.222.115: bytes=32 time=64ms TTL=64
2022-02-03 20:06:41 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:06:42 - Reply from 192.168.222.115: bytes=32 time=81ms TTL=64
2022-02-03 20:06:43 - Reply from 192.168.222.115: bytes=32 time=4ms TTL=64
2022-02-03 20:06:44 - Reply from 192.168.222.115: bytes=32 time=2ms TTL=64
2022-02-03 20:06:45 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:06:46 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:06:47 - Reply from 192.168.222.115: bytes=32 time=4ms TTL=64
2022-02-03 20:06:48 - Reply from 192.168.222.115: bytes=32 time=3ms TTL=64
2022-02-03 20:06:49 - Reply from 192.168.222.115: bytes=32 time=40ms TTL=64
2022-02-03 20:06:50 - Reply from 192.168.222.115: bytes=32 time=4ms TTL=64
I tested one more time, and went to look at the NAS. And it actually even turned of all leds and seemed totally turned off, and then stared up again. What kind of sorcery is this ;-)



Edited 6 time(s). Last edit at 02/03/2022 01:22PM by raffe.
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 02:29PM
Ah, so it works! Thanks a lot for testing! I'll put the '326 on my shortlist.
Re: Zyxel NAS326 Installation Instruction
February 03, 2022 03:53PM
raffe,

> e2label /dev/sda1 rootfs

> Then I rebooted with the new USB.
> And YES, now it boot to /dev/sda1
>

> After that I fixed obsolete sources in
> /etc/apt/source, did apt update and upgrade before
> I upgraded to kernel 5.15.5 (also uImage and
> uInitrd on USB) and everything seems to work OK.
>

Cool!

What you saw (I did not have a chance to look at the log yet :) looks like a classic problem. Relabel the HDD partition corrected something we were not seeing in the log.

For sanity, you should look at when you create the partition and format. Should be 2 step, create the 2 partitions using parted, and then mkfs.ext3 -L rootfs /dev/sda1.

And you should reboot a few times to make sure it is consistent.

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



Edited 1 time(s). Last edit at 02/03/2022 03:59PM by bodhi.
kzmx
Re: Zyxel NAS326 Installation Instruction
February 10, 2022 02:54AM
Hi

Firstly, sorry that I didn't read all the pages from 2019 to this day.

I have 326 too and would like to custom it. I don't like its web front-end, and laggish smb etc.

Is the instruction B still working?

I would like to install nextcloud to my 326, as I have found it is more useful and stable than 326 Zcloud solution.

I have slightly better knowledge about linux(ubuntu) environment and how to install it to pc etc, but the serial part in section A is not familiar to me... I have my own VPS and it has all the things that needs to run with email, www servers securely. Done it myself..

If the B section still works and I get all working, where aptitude installs all its packages, to usb, or hdd?

I don't mind if there is usb stick sticking out of my 326.. :)

Thanks
Re: Zyxel NAS326 Installation Instruction
February 10, 2022 04:34PM
kzmx,

> Is the instruction B still working?

Yes.

> If the B section still works and I get all
> working, where aptitude installs all its packages,
> to usb, or hdd?

The USB is the rootfs, so that's the whole system (everything is on USB). After you installed, see the Wiki thread for how to avoid wearing out the drive:

Quote
https://forum.doozan.com/read.php?2,23630
Flash drives issues

How to prolong the life of your rootfs USB thumb drive

About serial console, even though the instruction was well tested, if you run into some problem booting then serial console is the best tool to troubleshoot. This box serial port header is already poplulated. So it is quite easy to buy part (serial module converter) and a wires to hook up, no soldering needed.

Wiki thread

Quote

Unbricking with Serial Console & JTAG console

How to unbrick your box using serial console with kwboot
Repair Pogo E02 with Raspberry PI (JTAG) and OpenOCD
Serial Port connector - what are people using to make it work

The serial pinout for all Zyxel NAS series NSA3xx is described in this post:
https://forum.doozan.com/read.php?3,51739,51919#msg-51919

After you installed in stock OS successfully (without serial console), I still recommend planning to hook up serial console for future troubleshooting and learning purpose. When the system is booting, there are outputs that are only available in serial console, and that is how we learn what's hapenning behind the scene.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
kzmx
Re: Zyxel NAS326 Installation Instruction
March 01, 2022 02:07PM
Thanks for reply.

And sorry for delayed reply at my end.. (i havent got any reply email.. so I a little bit forgot this thread..)

I have to get on this asap, as Zcloud is.. what it is.
I prefer Nextcloud. I have it on my three servers now. home server, vps, and my website provider.

even the LAN speeds are quite slow on 326.. that I have tested.. but thats acceptable, as my ISP speed is only 300/20M fibre/cable. And I dont know for now, which would make bigger electricity bill, laptop as server-NAS or 326 as server-NAS..

yes, laptop has more ram, but limited hdd, and I dont want to use external usb hdds. I have had 2x1tb hdd inside in 326 and 2x2tb usb hdd connected to 326.
Re: Zyxel NAS326 Installation Instruction
March 01, 2022 04:19PM
> even the LAN speeds are quite slow on 326.. that I
> have tested..

LAN speed is in the range of 900Mbs. That's the best you can get for a typical NAS. Unless you go to the next tier of NAS boxes that cost a lot more.

> but thats acceptable, as my ISP
> speed is only 300/20M fibre/cable. And I dont know
> for now, which would make bigger electricity bill,
> laptop as server-NAS or 326 as server-NAS..

I'm pretty sure that the Intel laptop as a server will use substantially more in electricity than ARM box like NAS326.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Markeli
Re: Zyxel NAS326 Installation Instruction
April 24, 2022 11:13AM
I've tried to install Debian on USB and run it on my NAS326, completely following instructions from this article. But stock OS is still booting instead of Debian. I've used Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2.

What I've done:
- formatted USB with ext3 file system with label "rootfs"
- uploaded Debian to USB following this article: https://forum.doozan.com/read.php?2,32146 (Updated 28 Sept 2021)
- prepared NAS326, following section B of this article: https://forum.doozan.com/read.php?2,88619,91734
- inserted USB into front slot

But nothing happened.

There is output of my fw_printenv command:

CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=88:AC:C0:2A:74:91
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S200Y17047940
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=0

What else should I do to run Debian on NAS36?
Re: Zyxel NAS326 Installation Instruction
April 24, 2022 03:19PM
Markeli,

Make sure that you were root when you extract the tarball into the USB drive.
su -

If you did that, then try this,

1. Plug in the USB rootfs to the front USB port.

2. In stock OS, set this env

fw_setenv change_boot_part 1
fw_printenv
and reboot.

If it still boot stock OS, log in and set it again
fw_setenv change_boot_part 1
fw_printenv
and reboot.

If that is still not working then post the log of the entire SSH session above from your terminal here.

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



Edited 2 time(s). Last edit at 04/24/2022 04:52PM by bodhi.
Markeli
Re: Zyxel NAS326 Installation Instruction
April 25, 2022 07:45AM
Sure, all actions with USB driver were made from the root user.

Unfortunately, it is still not working. I'm using USB 2.0 driver.

There are SSH session log:

- first reboot

BusyBox v1.19.4 (2020-03-18 06:56:46 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # fw_printenv
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=88:AC:C0:2A:74:91
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S200Y17047940
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=0
~ # fw_setenv change_boot_part 1
~ # fw_printenv
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=88:AC:C0:2A:74:91
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S200Y17047940
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=1
~ # reboot


- after second reboot
BusyBox v1.19.4 (2020-03-18 06:56:46 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # fw_printenv
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=88:AC:C0:2A:74:91
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S200Y17047940
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=0
~ # fw_setenv change_boot_part 1
~ # fw_printenv
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=88:AC:C0:2A:74:91
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S200Y17047940
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=1
~ # /sbin/reboot


- after third reboot
BusyBox v1.19.4 (2020-03-18 06:56:46 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

~ # fw_printenv
CASset=max
CONTRY_TYPE=FF
FEATURE_BIT=00
MALLOC_len=5
MODEL_ID=B303
MPmode=SMP
PRODUCT_NAME=STG-328
VENDOR_NAME=MitraStar Technology Corp.
autoload=no
baudrate=115200
boot_order=hd_scr usb_scr mmc_scr hd_img usb_img mmc_img pxe net_img net_scr
bootargs=console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2
bootargs_dflt=$console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel
bootargs_end=:10.4.50.254:255.255.255.0:Armada38x:eth0:none
bootargs_root=root=/dev/nfs rw
bootcmd=nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
bootcmd_auto=stage_boot $boot_order
bootcmd_fdt=tftpboot 0x2000000 $image_name;tftpboot $fdtaddr $fdtfile;setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_boot=tftpboot 0x2000000 $image_name; setenv bootargs $console $nandEcc $mtdparts $bootargs_root nfsroot=$serverip:$rootpath ip=$ipaddr:$serverip$bootargs_end $mvNetConfig video=dovefb:lcd0:$lcd0_params clcd.lcd0_enable=$lcd0_enable clcd.lcd_panel=$lcd_panel; bootz 0x2000000 - $fdtaddr;
bootcmd_fdt_edit=tftpboot $fdtaddr $fdtfile; fdt addr $fdtaddr; setenv bootcmd $bootcmd_fdt_boot
bootcmd_lgcy=tftpboot 0x2000000 $image_name; setenv bootargs $bootargs_dflt; bootm 0x2000000;
bootdelay=3
cacheShare=no
console=console=ttyS0,115200
core_checksum_1=c782fd9d1adda4a6bac11cb570151a09
core_checksum_2=b2e7f9d46be6914446516f2cbedfd7eb
device_partition=0:1
disaMvPnp=no
eeeEnable=no
enaClockGating=no
enaCpuStream=no
enaFPU=yes
enaMonExt=no
enaWrAllo=no
eth1addr=00:50:43:38:32:25
eth1mtu=1500
eth2addr=00:50:43:38:a6:25
eth2mtu=1500
eth3addr=00:50:43:32:a6:38
eth3mtu=1500
ethact=egiga0
ethaddr=88:AC:C0:2A:74:91
ethmtu=1500
ethprime=egiga0
fdt_addr=2040000
fdt_skip_update=no
fdtaddr=0x1000000
fdtfile=armada-38x-modular.dtb
fwversion_1=V5.21(AAZF.8)
fwversion_2=V5.21(AAZF.10)
ide_path=/
image_name=uImage
img_checksum_1=dd8adfdfaec6f9560ac52c54b277f5cf
img_checksum_2=ea11142db3b34adc3602086d20479a95
initrd_name=uInitrd
ipaddr=10.4.50.170
kernel_addr=${kernel_addr_1}
kernel_addr_2=0x08700000
kernel_addr_r=2080000
kernel_mtd_1=3
kernel_mtd_2=5
lcd0_enable=0
lcd0_params=640x480-16@60
lcd_panel=0
loadaddr=0x02000000
loads_echo=0
modelid_1=B303
modelid_2=B303
mtdids=nand0=armada-nand
mtdparts=mtdparts=armada-nand:2m(u-boot),2m(env),2m(config),15m(kernel1),110m(rootfs1),15m(kernel2),-(rootfs2)
mvNetConfig=mv_net_config=4,(00:50:43:11:11:11,0:1:2:3),mtu=1500
mv_pon_addr=00:50:43:25:a6:38
nandEcc=nfcConfig=4bitecc
netbsd_en=no
netmask=255.255.255.0
netretry=no
pcieTune=no
pexMode=RC
pxe_files_load=:default.arm-armadaxp-db:default.arm-armadaxp:default.arm
pxefile_addr_r=3100000
ramdisk_addr_r=2880000
revision_1=51181
revision_2=51209
romfile_checksum_1=B316
romfile_checksum_2=7010
rootpath=/srv/nfs/
sata_delay_reset=0
sata_dma_mode=yes
script_addr_r=3000000
script_name=boot.scr
serial_number=S200Y17047940
serverip=10.4.50.38
standalone=fsload 0x2000000 $image_name;setenv bootargs $console $nandEcc $mtdparts root=/dev/mtdblock0 rw ip=$ipaddr:$serverip$bootargs_end; bootm 0x2000000;
stderr=serial
stdin=serial
stdout=serial
sysimg_mtd_1=4
sysimg_mtd_2=6
usb0Mode=host
usbActive=0
usbType=2
vxworks_en=no
yuk_ethaddr=00:00:00:EE:51:81
zld_checksum_1=e3da2fd44e82e74d7c15dbeef23be3d0
zld_checksum_2=e861824adfedf3827be8b63e8405ce7e
curr_bootfrom=1
next_bootfrom=1
load_initrd_addr=0x2900000
load_image_addr=0x02000000
usb_init=mw.l f1018100 20420000; mw.l f1018140 003E8800; sleep 3; usb start
set_bootargs_stock=setenv bootargs "console=ttyS0,115200 ubi.mtd=4,2048 rootfstype=ubifs root=ubi0:rootfs1 rw rootdelay=2"
bootcmd_stock_1=run set_bootargs_stock; echo Booting from NAND kernel 1 ...; nand read 0x2000000 0x00E00000 0xF00000 && bootz 0x2000000
bootcmd_stock_2=run set_bootargs_stock; echo Booting from NAND kernel 2 ...; nand read 0x2000000 0x08700000 0xF00000 && bootz 0x2000000
usb_set_bootargs=setenv bootargs "console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 $mtdparts earlyprintk=serial"
usb_bootcmd=echo Booting from USB ...; setenv fdt_skip_update yes; run usb_init; ext2load usb 0:1 $load_image_addr /boot/uImage; ext2load usb 0:1 $load_initrd_addr /boot/uInitrd; run usb_set_bootargs; bootm $load_image_addr $load_initrd_addr
bootcmd_custom=if run usb_bootcmd; then; else if run bootcmd_stock_1; then; else run bootcmd_stock_2; reset; fi; fi
kernel_addr_1=0x00000000; run bootcmd_custom; 
change_boot_part=0

Re: Zyxel NAS326 Installation Instruction
April 25, 2022 03:05PM
OK. Try:
fw_setenv curr_bootfrom 2
fw_setenv next_bootfrom 1
fw_setenv change_boot_part 1

If you alternatively modify the curr_bootfrom and next_bootfrom a few times (2 to 1 and 1 to 2) and still no boot, then I think you will need to connect serial console.

There might be some different behavior that we cannot see without serial console.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
August 26, 2022 04:55AM
I've got the opportunity to buy one of these devices (Zyxel NAS326) but would only ever consider it if I can get a fairly recent version of Debian running on it. The last post in this thread is several years old, but mentions 'stretch' so that gives me hope that perhaps maybe even 'bullseye' will install.

I enjoy tinkering, don't mind some challenges, but don't think I'd venture down this path without the knowledge that this is still an active thread. So I thought I'd check in before I pull the trigger and ask for the device to be shipped to me.
Re: Zyxel NAS326 Installation Instruction
August 26, 2022 03:20PM
robdejonge,

Yes, currently in bullseye for all MVEBU boxes (Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2)

See the main kernel and rootfs release thread:

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

The instruction in this thread 1st post was last updated with the buster rootfs Debian-5.2.9-mvebu-tld-1-rootfs-bodhi.tar.bz2. Replace that with Debian-5.13.8-mvebu-tld-1-rootfs-bodhi.tar.bz2.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
August 29, 2022 09:11PM
Thank you very much for the confirmation.

Reading through the instructions, I am wondering if I am understanding this correctly:
Debian will be installed on the HDD inserted into the NAS?
There is no onboard storage in the NAS on which the existing firmware is installed that gets replaced by Debian?
Re: Zyxel NAS326 Installation Instruction
August 29, 2022 10:39PM
> Reading through the instructions, I am wondering
> if I am understanding this correctly:
> Debian will be installed on the HDD inserted into
> the NAS?

There are 3 sections. A and B are for installation on USB rootfs. C is for installation to HDD rootfs..

> There is no onboard storage in the NAS on which
> the existing firmware is installed that gets
> replaced by Debian?

The stock FW on flash is left untouched. So you can go back to stock.

The most robust way to install is using section A. But you need to connect serial console. With serial console, you can see what's going on during booting progress.

Section B and C are for installation without serial console. These will just boot the system without any logging to console. So if there is problem, it is harder to diagnose.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
August 29, 2022 11:19PM
Is it possible to install on the flash? I have no reason to keep the stock firmware :)
Re: Zyxel NAS326 Installation Instruction
August 30, 2022 01:14AM
robdejonge Wrote:
-------------------------------------------------------
> Is it possible to install on the flash? I have no
> reason to keep the stock firmware :)

Flash space is too small to fit Debian rootfs.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: Zyxel NAS326 Installation Instruction
September 01, 2022 03:23AM
Oh darn ... do you know if there is the possibility to have an SSD of some sort flapping around inside the enclosure (not in the bays) that I could use to install Debian on to? I am not keen on having actual hdd spinning 24/7. Appreciate your comments, thanks a lot!
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: