Welcome! Log In Create A New Profile

Advanced

NSA310 no uboot update possible and ext2load: "Bad partition 1"

Posted by randomDude 
NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 13, 2021 06:29PM
Hello all,

after trying for ~4 hours and reading several installation instructions, the installation of Debian is still not working.
One stumbling block are bad sectors in the mtd0 partition:
/ # dmesg | grep -i bad
Scanning device for bad blocks
Bad eraseblock 2 at 0x000000040000
Bad eraseblock 3 at 0x000000060000
...

So the solution seems to be to keep the stock uboot and proceed from there. I followed the instructions for stock uboot here: https://forum.doozan.com/read.php?2,102054,105374#msg-105374

printev shows (output of only the last lines...)

...
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
load_uinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
usb_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000
usb_bootcmd=run usb_set_bootargs; run usb_boot
bootcmd=usb reset; run usb_bootcmd; usb stop; reset

Environment size: 1880/131068 bytes

Then trying to boot:
boot
(Re)start USB...
USB:   scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
stopping USB..
What else can I try to get this working?

Thanks!
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 13, 2021 07:33PM
randomDude,

Please post the entire serial bootlog.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 14, 2021 01:25AM
Hi bodhi,

thanks for the reply. Here is the requested output:

NSA310>>printenv
bootargs=console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key
_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0
x2FC0000(rootfs2) root=/dev/nfs rw init=/init
bootdelay=2
baudrate=115200
loads_echo=0
eth1addr=00:19:CB:00:51:82
ipaddr=10.4.50.165
serverip=10.4.50.5
rootpath=/mnt/ARM_FS/
netmask=255.255.255.0
nandEcc=1bit
MODEL_ID=A203
PRODUCT_NAME=NSA-310
FEATURE_BIT=00
CONTRY_TYPE=FF
VENDOR_NAME=ZyXEL Communications Corp.
run_diag=yes
ethaddr=CC:5D:4E:CA:09:31
stdin=serial
stdout=serial
stderr=serial
console=console=ttyS0,115200 mtdparts=nand_mtd:0xc0000@0(uboot)ro,0x7f00000@0x100000(root)
mainlineLinux=no
CASset=min
enaMonExt=no
enaCpuStream=no
enaWrAllo=no
pexMode=RC
disL2Cache=no
setL2CacheWT=yes
disL2Prefetch=yes
enaICPref=yes
enaDCPref=yes
sata_dma_mode=yes
ethprime=egiga1
netbsd_en=no
vxworks_en=no
bootargs_root=root=/dev/nfs rw
bootargs_end=:::DB88FXX81:eth0:none
image_name=uImage
standalone=fsload 0x2000000 $(image_name);setenv bootargs $(console) root=/dev/mtdblock0 rw ip=$(ipaddr):$(serverip)$(bootargs_end) $(mvPhoneConfig); bootm 0x2000000;
disaMvPnp=no
ethmtu=1500
eth1mtu=1500
mvPhoneConfig=mv_phone_config=dev0:fxs,dev1:fxs
mvNetConfig=mv_net_config=(00:11:88:0f:62:81,0:1:2:3),mtu=1500
usb0Mode=host
yuk_ethaddr=00:00:00:EE:51:81
hddPowerCtrl=no
netretry=no
rcvrip=169.254.100.100
loadaddr=0x02000000
autoload=no
enaAutoRecovery=yes
kernel_addr=0xc80000
pcieTune=no
ethact=egiga1
usb_set_bootargs=setenv bootargs console=ttyS0,115200 root=LABEL=rootfs rootdelay=10 earlyprintk=serial
load_uimage=ext2load usb 0:1 0x800000 /boot/uImage
load_uinitrd=ext2load usb 0:1 0x2100000 /boot/uInitrd
usb_boot=mw 0x800000 0 1; run load_uimage; run load_uinitrd; bootm 0x800000 0x2100000
usb_bootcmd=run usb_set_bootargs; run usb_boot
bootcmd=usb reset; run usb_bootcmd; usb stop; reset

Environment size: 1880/131068 bytes

Followed by

NSA310>> boot
(Re)start USB...
USB:   scanning bus for devices... 3 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
** Bad partition 1 **
** Bad partition 1 **
## Booting image at 00800000 ...
Bad Magic Number
stopping USB..


Cheers!



Edited 2 time(s). Last edit at 10/14/2021 01:28AM by randomDude.
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 14, 2021 03:44PM
randomDude,

Check your rootfs. Make sure you are root, use a single Ext3 partition and MBR/msdos partition table, when you create the rootfs. It is best to do this at command line on a Linux box. GUI sometimes default to Ext4 on a modern Linux distro.

And remember to sync.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 14, 2021 05:21PM
bodhi,

thanks for the suggestion, but I did this already:
was root, used mkfs.ext3 from CLI, label is "rootfs".
Unpacked Debian-5.13.6-kirkwood-tld-1-rootfs-bodhi.tar.bz2 with "tar -xjf ...".
Copied/Appended data, used mkimage,
synced

Is there some way to check if the MBR was written correctly?

rD



Edited 1 time(s). Last edit at 10/14/2021 05:40PM by randomDude.
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 14, 2021 05:46PM
I just tried to change disk to the other bay and it went a bit forward:

Reset IDE:
Marvell Serial ATA Adapter
Integrated Sata device found
[0 0 0]: Enable DMA mode
  Device 0 @ 0 0:
Model: WDC WD20EFRX-68EUZN0                     Firm: 82.00A82 Ser#:      WD-WCC4M6KXY9HR
            Type: Hard Disk
            Supports 48-bit addressing
            Capacity: 1907729.0 MB = 1863.0 GB (-387938128 x 512)


5435888 bytes read

9671091 bytes read
## Booting image at 00800000 ...
   Image Name:   Linux-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   0:22:58 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5435824 Bytes =  5.2 MB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
OK
## Loading Ramdisk Image at 02100000 ...
   Image Name:   initramfs-5.13.6-kirkwood-tld-1
   Created:      2021-09-24   1:06:32 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    9671027 Bytes =  9.2 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: invalid dtb and unrecognized/unsupported machine ID
  r1=0x00000ab7, r2=0x00000100
  r2[]=05 00 00 00 01 00 41 54 00 00 00 00 00 00 00 00
Available machine support:

ID (hex)        NAME
ffffffff        Generic DT based system
ffffffff        Marvell Kirkwood (Flattened Device Tree)

Please check your kernel config and/or bootloader.
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 14, 2021 06:17PM
bodhi,

I am quite the moron. I had overwritten the MBR by issuing mkfs.ext3 /dev/sdb instead of /dev/sdb1...
It works now!

Thanks for your help!
rD
Re: NSA310 no uboot update possible and ext2load: "Bad partition 1"
October 14, 2021 07:28PM
randomDude,

> I am quite the moron. I had overwritten the MBR by
> issuing mkfs.ext3 /dev/sdb instead of
> /dev/sdb1...
> It works now!

Cool! that happens sometime to all of us!

-bodhi
===========================
Forum Wiki
bodhi's corner
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: