RB433 bad sector - cannot start OpenWrt

Hi,
Can I do anything with below issue:

RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..
writing settings to flash... OK
trying bootp protocol... OK
Got IP address: 192.168.88.101
resolved mac address D0:67:E5:56:BA:E4
Gateway: 192.168.88.2
transfer started ................................................... transfer ok, time=3.21s
setting up elf image... OK
jumping to kernel code
[    0.000000] Linux version 4.9.214 (buildbot@eebc0ab1447a) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7989-82fbd85747) ) #0 Thu Feb 27 21:25:59 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7130 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: parts=1 boot_part_size=4194304 gpio=4031 HZ=150000000 mem=64M kmac=00:0C:42:42:64:60 board=433 ver=3.22 hw_opt=00000000 boot=1 mlc=8 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 57660K/65536K available (3627K kernel code, 161K rwdata, 456K rodata, 2404K init, 209K bss, 7876K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Clocks: CPU:300.000MHz, DDR:300.000MHz, AHB:150.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[    0.000017] sched_clock: 32 bits at 150MHz, resolution 6ns, wraps every 14316557820ns
[    0.007928] Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
[    0.090559] pid_max: default: 32768 minimum: 301
[    0.095352] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.101970] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.113421] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.123286] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.131209] NET: Registered protocol family 16
[    0.138153] MIPS: machine is MikroTik RouterBOARD 433/AH
[    0.915566] registering PCI controller with io_map_base unset
[    0.936226] rb4xx-spi rb4xx-spi: master is unqueued, this is deprecated
[    0.944644] PCI host bridge to bus 0000:00
[    0.948756] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    0.955657] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.961223] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.968011] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.981270] clocksource: Switched to clocksource MIPS
[    0.987924] NET: Registered protocol family 2
[    0.993846] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    1.000840] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.007278] TCP: Hash tables configured (established 1024 bind 1024)
[    1.013817] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.019667] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.026302] NET: Registered protocol family 1
[    2.581279] random: fast init done
[    6.382145] Crashlog allocated RAM at address 0x3f00000
[    6.389323] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    6.408253] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.414119] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    6.555216] io scheduler noop registered
[    6.559146] io scheduler deadline registered (default)
[    6.564920] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    6.575875] console [ttyS0] disabled
[    6.599504] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 9375000) is a 16550A
[    6.608134] console [ttyS0] enabled
[    6.608134] console [ttyS0] enabled
[    6.615100] bootconsole [early0] disabled
[    6.615100] bootconsole [early0] disabled
[    6.624809] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[    6.694880] Creating 4 MTD partitions on "spi0.0":
[    6.699692] 0x000000000000-0x00000000b000 : "routerboot"
[    6.737255] 0x00000000b000-0x00000000c000 : "hard_config"
[    6.775003] 0x00000000d000-0x00000000f000 : "bios"
[    6.811980] 0x00000000f000-0x000000010000 : "soft_config"
[    6.849804] NAND flash driver for RouterBoard 4xx series version 0.2.0
[    6.863787] nand: Could not find valid ONFI parameter page; aborting
[    6.870201] nand: device found, Manufacturer ID: 0x20, Chip ID: 0xf1
[    6.876555] nand: ST Micro NAND 128MiB 3,3V 8-bit
[    6.881253] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    6.888851] Scanning device for bad blocks
[    6.893582] Bad eraseblock 2 at 0x000000040000
[    6.898222] Bad eraseblock 3 at 0x000000060000
[    6.902879] Bad eraseblock 4 at 0x000000080000
[    6.907518] Bad eraseblock 5 at 0x0000000a0000
[    6.912176] Bad eraseblock 6 at 0x0000000c0000
[    6.916815] Bad eraseblock 7 at 0x0000000e0000
[    6.921472] Bad eraseblock 8 at 0x000000100000
[    6.926112] Bad eraseblock 9 at 0x000000120000
[    6.930751] Bad eraseblock 10 at 0x000000140000
[    6.935496] Bad eraseblock 11 at 0x000000160000
[    6.940221] Bad eraseblock 12 at 0x000000180000
[    6.944965] Bad eraseblock 13 at 0x0000001a0000
[    6.949690] Bad eraseblock 14 at 0x0000001c0000
[    6.954434] Bad eraseblock 15 at 0x0000001e0000
[    6.959160] Bad eraseblock 16 at 0x000000200000
[    6.963904] Bad eraseblock 17 at 0x000000220000
[    6.968629] Bad eraseblock 18 at 0x000000240000
[    6.973373] Bad eraseblock 19 at 0x000000260000
[    6.978098] Bad eraseblock 20 at 0x000000280000
[    6.982843] Bad eraseblock 21 at 0x0000002a0000
[    6.987568] Bad eraseblock 22 at 0x0000002c0000
[    6.992313] Bad eraseblock 23 at 0x0000002e0000
[    6.997037] Bad eraseblock 24 at 0x000000300000
[    7.001782] Bad eraseblock 25 at 0x000000320000
[    7.006506] Bad eraseblock 26 at 0x000000340000
[    7.275070] Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
[    7.281326] 0x000000000000-0x000000040000 : "booter"
[    7.318400] 0x000000040000-0x000000400000 : "kernel"
[    7.355809] 0x000000400000-0x000008000000 : "ubi"
[    7.397540] libphy: Fixed MDIO Bus: probed
[    7.438446] IP17xx: Found IP175D at ag71xx-mdio.0:00
[    7.473513] libphy: ag71xx_mdio: probed
[    7.812727] ag71xx ag71xx.1: connected to PHY at ag71xx-mdio.0:04 [uid=02430d80, driver=Generic PHY]
[    7.823013] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:RMII
[    8.266369] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=02430d80, driver=IC+ IP17xx]
[    8.276589] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    8.285856] NET: Registered protocol family 10
[    8.296592] NET: Registered protocol family 17
[    8.301107] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    8.314082] 8021q: 802.1Q VLAN Support v1.8
[    8.318548] rb: no calibration data found
[    8.327771] UBI: auto-attach mtd6
[    8.331124] ubi0: attaching mtd6
[    9.437131] ubi0: scanning is finished
[    9.514981] ubi0: attached mtd6 (name "ubi", size 124 MiB)
[    9.520472] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    9.527391] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    9.534181] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    9.541126] ubi0: good PEBs: 992, bad PEBs: 0, corrupted PEBs: 0
[    9.547141] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    9.554368] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 3975563018
[    9.563487] ubi0: available PEBs: 0, total reserved PEBs: 992, PEBs reserved for bad PEB handling: 20
[    9.572869] ubi0: background thread "ubi_bgt0d" started, PID 333
[    9.581779] block ubiblock0_2: created from ubi0:2(rootfs)
[    9.587265] ubiblock: device ubiblock0_2 (rootfs) set to be root filesystem
[    9.606949] Freeing unused kernel memory: 2404K
[    9.611508] This architecture does not have kernel memory protection.
[    9.640911] init: Console is alive
[    9.644757] init: - watchdog -
[    9.678046] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    9.688489] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    9.706344] init: - preinit -
[   10.019520] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   10.058311] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   11.061623] eth1: link up (100Mbps/Full duplex)
[   11.066178] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   13.261473] eth1: link down
[   13.280938] procd: - early -
[   13.284055] procd: - watchdog -
[   13.898292] procd: - watchdog -
[   13.901884] procd: - ubus -
[   13.916324] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.955313] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.962387] random: ubusd: uninitialized urandom read (4 bytes read)
[   13.970224] procd: - init -
Please press Enter to activate this console.
[   14.267790] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.280130] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.300407] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[   14.308478] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[   14.319325] ip_tables: (C) 2000-2006 Netfilter Core Team
[   14.336440] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   14.419616] xt_time: kernel timezone is -0000
[   14.495990] PPP generic driver version 2.4.2
[   14.503967] NET: Registered protocol family 24
[   14.557798] kmodloader: done loading kernel modules from /etc/modules.d/*
[   15.769167] urandom_read: 5 callbacks suppressed
[   15.769181] random: jshn: uninitialized urandom read (4 bytes read)
[   36.319163] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   36.325440] eth1: link up (100Mbps/Full duplex)
[   36.329985] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   36.369580] br-lan: port 1(eth1.1) entered blocking state
[   36.375053] br-lan: port 1(eth1.1) entered disabled state
[   36.381082] device eth1.1 entered promiscuous mode
[   36.385935] device eth1 entered promiscuous mode
[   36.441354] br-lan: port 1(eth1.1) entered blocking state
[   36.446758] br-lan: port 1(eth1.1) entered forwarding state
[   36.452610] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   36.584963] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   37.381930] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   37.621783] eth0: link up (100Mbps/Full duplex)
[   37.626815] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready



BusyBox v1.28.4 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.8, r7989-82fbd85747
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether 00:0c:42:42:64:60 brd ff:ff:ff:ff:ff:ff
    inet 192.168.88.101/24 brd 192.168.88.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:42ff:fe42:6460/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether 00:0c:42:42:64:61 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:42ff:fe42:6461/64 scope link 
       valid_lft forever preferred_lft forever
4: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    link/ether 00:0c:42:42:64:61 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever
    inet6 fd48:30c8:b468::1/60 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:42ff:fe42:6461/64 scope link 
       valid_lft forever preferred_lft forever
5: eth1.1@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP qlen 1000
    link/ether 00:0c:42:42:64:61 brd ff:ff:ff:ff:ff:ff
root@OpenWrt:/# /e
root@OpenWrt:/# /etc/ini
root@OpenWrt:/# /etc/init.
root@OpenWrt:/# /etc/init.d/dfi
root@OpenWrt:/# /etc/init.d/firewall sopttop
Warning: Unable to locate ipset utility, disabling ipset support
 * Flushing IPv4 filter table
 * Flushing IPv4 nat table
 * Flushing IPv4 mangle table
 * Flushing IPv6 filter table
 * Flushing IPv6 mangle table
 * Flushing conntrack table ...
root@OpenWrt:/# [   96.821366] random: crng init done

root@OpenWrt:/# 
root@OpenWrt:/# 
root@OpenWrt:/# cd /tm
root@OpenWrt:/# cd /tmp/\
root@OpenWrt:/tmp# ls -al
drwxrwxrwt   15 root     root           420 Mar  1 20:42 .
drwxr-xr-x   16 root     root             0 Jan  1  1970 ..
-rwx------    1 root     root             5 Mar  1 20:41 .switch2jffs
drwx------    2 root     root           120 Mar  1 20:41 .uci
-rw-r--r--    1 root     root             4 Mar  1 20:41 TZ
-rw-r--r--    1 root     root             0 Mar  1 20:41 dhcp.leases
drwxr-xr-x    2 root     root            40 Mar  1 20:41 dnsmasq.d
drwxr-xr-x    2 root     root            40 Mar  1 20:41 dropbear
drwxr-xr-x    3 root     root            80 Mar  1 20:41 etc
drwxr-xr-x    2 root     root            60 Mar  1 20:41 hosts
drwxr-xr-x    3 root     root            60 Mar  1 20:41 lib
drwxr-xr-x    2 root     root           320 Mar  1 20:41 lock
drwxr-xr-x    2 root     root            80 Mar  1 20:41 log
-rw-r--r--    1 root     root       4096000 Mar  1 20:42 openwrt-18.06.8-ar71xx-mikrotik-nand-large-squashfs-sysupgrade.bin
-rw-r--r--    1 root     root            32 Mar  1 20:41 resolv.conf
-rw-r--r--    1 root     root             0 Mar  1 20:41 resolv.conf.auto
drwxr-xr-x    4 root     root           200 Mar  1 20:42 run
drwxrwxrwt    2 root     root            40 Jan  1  1970 shm
drwxr-xr-x    2 root     root            60 Mar  1 20:41 state
drwxr-xr-x    2 root     root            80 Jan  1  1970 sysinfo
drwxr-xr-x    2 root     root            40 Mar  1 20:41 tmp
root@OpenWrt:/tmp# sysu
root@OpenWrt:/tmp# sysupgrade op
root@OpenWrt:/tmp# sysupgrade openwrt-18.06.8-ar71xx-mikrotik-nand-large-squashf

s-sysupgrade.bin 
Image metadata not found
Cannot save config while running from ramdisk.
Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sending TERM to remaining processes ... ntpd udhcpc odhcp6c dnsmasq ubusd logd rpcd netifd odhcpd uhttpd 
Sending KILL to remaining processes ... 
Performing system upgrade...
Unlocking kernel ...
Erasing kernel ...

Skipping bad block at 0x0   
Skipping bad block at 0x20000   
Skipping bad block at 0x40000   
Skipping bad block at 0x60000   
Skipping bad block at 0x80000   
Skipping bad block at 0xa0000   
Skipping bad block at 0xc0000   
Skipping bad block at 0xe0000   
Skipping bad block at 0x100000   
Skipping bad block at 0x120000   
Skipping bad block at 0x140000   
Skipping bad block at 0x160000   
Skipping bad block at 0x180000   
Skipping bad block at 0x1a0000   
Skipping bad block at 0x1c0000   
Skipping bad block at 0x1e0000   
Skipping bad block at 0x200000   
Skipping bad block at 0x220000   
Skipping bad block at 0x240000   
Skipping bad block at 0x260000   
Skipping bad block at 0x280000   
Skipping bad block at 0x2a0000   
Skipping bad block at 0x2c0000   
Skipping bad block at 0x2e0000   
Skipping bad block at 0x300000   Writing data to block 0 at offset 0x0
Bad block at 0, 1 block(s) will be skipped
Writing data to block 1 at offset 0x20000
Bad block at 20000, 1 block(s) will be skipped
Writing data to block 2 at offset 0x40000
Bad block at 40000, 1 block(s) will be skipped
Writing data to block 3 at offset 0x60000
Bad block at 60000, 1 block(s) will be skipped
Writing data to block 4 at offset 0x80000
Bad block at 80000, 1 block(s) will be skipped
Writing data to block 5 at offset 0xa0000
Bad block at a0000, 1 block(s) will be skipped
Writing data to block 6 at offset 0xc0000
Bad block at c0000, 1 block(s) will be skipped
Writing data to block 7 at offset 0xe0000
Bad block at e0000, 1 block(s) will be skipped
Writing data to block 8 at offset 0x100000
Bad block at 100000, 1 block(s) will be skipped
Writing data to block 9 at offset 0x120000
Bad block at 120000, 1 block(s) will be skipped
Writing data to block 10 at offset 0x140000
Bad block at 140000, 1 block(s) will be skipped
Writing data to block 11 at offset 0x160000
Bad block at 160000, 1 block(s) will be skipped
Writing data to block 12 at offset 0x180000
Bad block at 180000, 1 block(s) will be skipped
Writing data to block 13 at offset 0x1a0000
Bad block at 1a0000, 1 block(s) will be skipped
Writing data to block 14 at offset 0x1c0000
Bad block at 1c0000, 1 block(s) will be skipped
Writing data to block 15 at offset 0x1e0000
Bad block at 1e0000, 1 block(s) will be skipped
Writing data to block 16 at offset 0x200000
Bad block at 200000, 1 block(s) will be skipped
Writing data to block 17 at offset 0x220000
Bad block at 220000, 1 block(s) will be skipped
Writing data to block 18 at offset 0x240000
Bad block at 240000, 1 block(s) will be skipped
Writing data to block 19 at offset 0x260000
Bad block at 260000, 1 block(s) will be skipped
Writing data to block 20 at offset 0x280000
Bad block at 280000, 1 block(s) will be skipped
Writing data to block 21 at offset 0x2a0000
Bad block at 2a0000, 1 block(s) will be skipped
Writing data to block 22 at offset 0x2c0000
Bad block at 2c0000, 1 block(s) will be skipped
Writing data to block 23 at offset 0x2e0000
Bad block at 2e0000, 1 block(s) will be skipped
Writing data to block 24 at offset 0x300000
Bad block at 300000, 1 block(s) will be skipped
Writing data to block 25 at offset 0x320000
Writing data to block 26 at offset 0x340000
Writing data to block 27 at offset 0x360000
Writing data to block 28 at offset 0x380000
Writing data to block 29 at offset 0x3a0000
tar: write error: Broken pipe
removing ubiblock0_2
[  131.180308] block ubiblock0_2: released
Volume ID 1, size 13 LEBs (1650688 bytes, 1.5 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "none", alignment 1
Volume ID 2, size 20 LEBs (2539520 bytes, 2.4 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 117071872
Volume ID 3, size 922 LEBs (117071872 bytes, 111.6 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
umount: can't unmount /: Invalid argument
[  135.342995] reboot: Restarting system


RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..

loading kernel from nand... OK
setting up elf image... 
  • Your OpenWrt booted, please explain.
  • What issue (specifically...as there's a lot here)?

TFTP boot OpenWrt from the bootloader as in the original install and re flash it...be sure to format your flash first in the bootloader before proceeding. :warning:

but if more blocks keep appearing...I think your flash chip may be failing.

This looks like the bad blocks flags in the flash have been falsely set. If all those blocks are actually bad, the kernel partition is not usable, and either the flash chip or the whole router needs to be replaced.

If it is a case of corrupting the flags, I'm not sure how to recover from that.

1 Like

Hi, i'm able to start from bootp and run in ram but what I should change to have working version on nand

Theo orginal mikrotik software was working fine.

It tries to write to NAND and finds a large number of blocks are bad, or at least have been marked bad. There are only about 4 "good" blocks in the kernel partition, which isn't enough space to store the kernel.

So can I repartion the nand and change the offset? Is IT difficult to do?

???

To be clear, you are referring to the MikroTik RB433, correct?

Because all you have to do it reformat from the bootloader menu; and proceed to reinstall OpenWrt like an original install. I'm really not understanding the confusion in the last few posts.

In case you're unaware, the menu I'm referring to appears when you press a key here.

thanks everyone for answer.
@mk24
As you mentioned it could be not enough space in kernel partition. Should I cahnge here:
https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c ?
@lleachii
I tried format partition but it didn't help:

RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup

RouterBOOT-3.22
What do you want to configure?
   d - boot delay
   k - boot key
   s - serial console
   n - silent boot
   o - boot device
   f - cpu frequency
   r - reset booter configuration
   e - format nand
   w - repartition nand
   g - upgrade firmware
   i - board info
   p - boot protocol
   b - booter options
   t - do memory testing
   x - exit setup
your choice: e - format nand


Do you realy want to format your storage device?
that would result in losing all your data
type "yes" to confirm: yes
formatting nand... done!

RouterBOOT-3.22
What do you want to configure?
   d - boot delay
   k - boot key
   s - serial console
   n - silent boot
   o - boot device
   f - cpu frequency
   r - reset booter configuration
   e - format nand
   w - repartition nand
   g - upgrade firmware
   i - board info
   p - boot protocol
   b - booter options
   t - do memory testing
   x - exit setup
your choice: o - boot device

Select boot device:
   e - boot over Ethernet
 * n - boot from NAND, if fail then Ethernet
   1 - boot Ethernet once, then NAND
   o - boot from NAND only
   b - boot chosen device
   f - boot Flash Configure Mode
   3 - boot Flash Configure Mode once, then NAND
your choice: timeout

RouterBOOT-3.22
What do you want to configure?
   d - boot delay
   k - boot key
   s - serial console
   n - silent boot
   o - boot device
   f - cpu frequency
   r - reset booter configuration
   e - format nand
   w - repartition nand
   g - upgrade firmware
   i - board info
   p - boot protocol
   b - booter options
   t - do memory testing
   x - exit setup
your choice: o - boot device

Select boot device:
   e - boot over Ethernet
 * n - boot from NAND, if fail then Ethernet
   1 - boot Ethernet once, then NAND
   o - boot from NAND only
   b - boot chosen device
   f - boot Flash Configure Mode
   3 - boot Flash Configure Mode once, then NAND
your choice: 1 - boot Ethernet once, then NAND

RouterBOOT-3.22
What do you want to configure?
   d - boot delay
   k - boot key
   s - serial console
   n - silent boot
   o - boot device
   f - cpu frequency
   r - reset booter configuration
   e - format nand
   w - repartition nand
   g - upgrade firmware
   i - board info
   p - boot protocol
   b - booter options
   t - do memory testing
   x - exit setup
your choice: x - exit setup


writing settings to flash... OK



RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..
writing settings to flash... OK
trying bootp protocol....................................................................................................................................................... OK
Got IP address: 192.168.88.101
resolved mac address D0:67:E5:56:BA:E4
Gateway: 192.168.88.2
transfer started ................................................... transfer ok, time=3.15s
setting up elf image... OK
jumping to kernel code
[    0.000000] Linux version 4.9.214 (buildbot@eebc0ab1447a) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7989-82fbd85747) ) #0 Thu Feb 27 21:25:59 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7130 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: parts=1 boot_part_size=4194304 gpio=4031 HZ=150000000 mem=64M kmac=00:0C:42:42:64:60 board=433 ver=3.22 hw_opt=00000000 boot=1 mlc=8 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 57660K/65536K available (3627K kernel code, 161K rwdata, 456K rodata, 2404K init, 209K bss, 7876K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:51
[    0.000000] Clocks: CPU:300.000MHz, DDR:300.000MHz, AHB:150.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[    0.000017] sched_clock: 32 bits at 150MHz, resolution 6ns, wraps every 14316557820ns
[    0.007927] Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
[    0.090558] pid_max: default: 32768 minimum: 301
[    0.095351] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.101969] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.113419] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.123277] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.131202] NET: Registered protocol family 16
[    0.138146] MIPS: machine is MikroTik RouterBOARD 433/AH
[    0.915568] registering PCI controller with io_map_base unset
[    0.936224] rb4xx-spi rb4xx-spi: master is unqueued, this is deprecated
[    0.944643] PCI host bridge to bus 0000:00
[    0.948756] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    0.955657] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.961222] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.968010] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.981260] clocksource: Switched to clocksource MIPS
[    0.987914] NET: Registered protocol family 2
[    0.993836] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    1.000831] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.007268] TCP: Hash tables configured (established 1024 bind 1024)
[    1.013808] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.019658] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.026293] NET: Registered protocol family 1
[    2.581269] random: fast init done
[    6.383209] Crashlog allocated RAM at address 0x3f00000
[    6.390089] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    6.409022] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    6.414888] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    6.556043] io scheduler noop registered
[    6.559966] io scheduler deadline registered (default)
[    6.565740] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    6.576685] console [ttyS0] disabled
[    6.600318] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 9375000) is a 16550A
[    6.608947] console [ttyS0] enabled
[    6.608947] console [ttyS0] enabled
[    6.615915] bootconsole [early0] disabled
[    6.615915] bootconsole [early0] disabled
[    6.625626] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[    6.695728] Creating 4 MTD partitions on "spi0.0":
[    6.700533] 0x000000000000-0x00000000b000 : "routerboot"
[    6.738061] 0x00000000b000-0x00000000c000 : "hard_config"
[    6.775684] 0x00000000d000-0x00000000f000 : "bios"
[    6.812789] 0x00000000f000-0x000000010000 : "soft_config"
[    6.850618] NAND flash driver for RouterBoard 4xx series version 0.2.0
[    6.864598] nand: Could not find valid ONFI parameter page; aborting
[    6.871007] nand: device found, Manufacturer ID: 0x20, Chip ID: 0xf1
[    6.877361] nand: ST Micro NAND 128MiB 3,3V 8-bit
[    6.882074] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    6.889655] Scanning device for bad blocks
[    6.894387] Bad eraseblock 2 at 0x000000040000
[    6.899028] Bad eraseblock 3 at 0x000000060000
[    6.903685] Bad eraseblock 4 at 0x000000080000
[    6.908324] Bad eraseblock 5 at 0x0000000a0000
[    6.912981] Bad eraseblock 6 at 0x0000000c0000
[    6.917621] Bad eraseblock 7 at 0x0000000e0000
[    6.922279] Bad eraseblock 8 at 0x000000100000
[    6.926917] Bad eraseblock 9 at 0x000000120000
[    6.931575] Bad eraseblock 10 at 0x000000140000
[    6.936301] Bad eraseblock 11 at 0x000000160000
[    6.941026] Bad eraseblock 12 at 0x000000180000
[    6.945772] Bad eraseblock 13 at 0x0000001a0000
[    6.950496] Bad eraseblock 14 at 0x0000001c0000
[    6.955240] Bad eraseblock 15 at 0x0000001e0000
[    6.959966] Bad eraseblock 16 at 0x000000200000
[    6.964710] Bad eraseblock 17 at 0x000000220000
[    6.969434] Bad eraseblock 18 at 0x000000240000
[    6.974179] Bad eraseblock 19 at 0x000000260000
[    6.978904] Bad eraseblock 20 at 0x000000280000
[    6.983649] Bad eraseblock 21 at 0x0000002a0000
[    6.988374] Bad eraseblock 22 at 0x0000002c0000
[    6.993118] Bad eraseblock 23 at 0x0000002e0000
[    6.997844] Bad eraseblock 24 at 0x000000300000
[    7.002587] Bad eraseblock 25 at 0x000000320000
[    7.007313] Bad eraseblock 26 at 0x000000340000
[    7.275430] Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
[    7.281691] 0x000000000000-0x000000040000 : "booter"
[    7.318774] 0x000000040000-0x000000400000 : "kernel"
[    7.356148] 0x000000400000-0x000008000000 : "ubi"
[    7.397844] libphy: Fixed MDIO Bus: probed
[    7.438729] IP17xx: Found IP175D at ag71xx-mdio.0:00
[    7.473771] libphy: ag71xx_mdio: probed
[    7.812717] ag71xx ag71xx.1: connected to PHY at ag71xx-mdio.0:04 [uid=02430d80, driver=Generic PHY]
[    7.823002] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:RMII
[    8.266359] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=02430d80, driver=IC+ IP17xx]
[    8.276573] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
[    8.285842] NET: Registered protocol family 10
[    8.296585] NET: Registered protocol family 17
[    8.301101] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    8.314075] 8021q: 802.1Q VLAN Support v1.8
[    8.318542] rb: no calibration data found
[    8.327759] UBI error: no valid UBI magic found inside mtd6
[    8.345848] Freeing unused kernel memory: 2404K
[    8.350376] This architecture does not have kernel memory protection.
[    8.379274] init: Console is alive
[    8.383108] init: - watchdog -
[    8.416367] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    8.426808] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    8.444654] init: - preinit -
[    8.756792] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[    8.795540] random: procd: uninitialized urandom read (4 bytes read)
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    9.781615] eth1: link up (100Mbps/Full duplex)
[    9.786174] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   12.010931] eth1: link down
[   12.030465] procd: - early -
[   12.033583] procd: - watchdog -
[   12.639417] procd: - watchdog -
[   12.643011] procd: - ubus -
[   12.657567] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.696473] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.703521] random: ubusd: uninitialized urandom read (4 bytes read)
[   12.711380] procd: - init -
Please press Enter to activate this console.
[   13.007540] kmodloader: loading kernel modules from /etc/modules.d/*
[   13.019945] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   13.039933] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[   13.048000] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[   13.058873] ip_tables: (C) 2000-2006 Netfilter Core Team
[   13.076075] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   13.159218] xt_time: kernel timezone is -0000
[   13.234439] PPP generic driver version 2.4.2
[   13.242335] NET: Registered protocol family 24
[   13.293122] kmodloader: done loading kernel modules from /etc/modules.d/*
[   14.504855] urandom_read: 5 callbacks suppressed
[   14.504869] random: jshn: uninitialized urandom read (4 bytes read)
[   35.043802] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   35.050008] eth1: link up (100Mbps/Full duplex)
[   35.061717] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   35.096277] br-lan: port 1(eth1.1) entered blocking state
[   35.101754] br-lan: port 1(eth1.1) entered disabled state
[   35.107768] device eth1.1 entered promiscuous mode
[   35.112616] device eth1 entered promiscuous mode
[   35.171454] br-lan: port 1(eth1.1) entered blocking state
[   35.176864] br-lan: port 1(eth1.1) entered forwarding state
[   35.182722] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   35.300201] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   36.101578] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   36.341828] eth0: link up (100Mbps/Full duplex)
[   36.361372] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  128.191357] random: crng init done



BusyBox v1.28.4 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 18.06.8, r7989-82fbd85747
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# /e
root@OpenWrt:/# /etc/ini
root@OpenWrt:/# /etc/init.
root@OpenWrt:/# /etc/init.d/fir
root@OpenWrt:/# /etc/init.d/firewall sidstop
Warning: Unable to locate ipset utility, disabling ipset support
 * Flushing IPv4 filter table
 * Flushing IPv4 nat table
 * Flushing IPv4 mangle table
 * Flushing IPv6 filter table
 * Flushing IPv6 mangle table
 * Flushing conntrack table ...
root@OpenWrt:/# cd /tm
root@OpenWrt:/# cd /tmp/
root@OpenWrt:/tmp# sysu
root@OpenWrt:/tmp# sysupgrade open
root@OpenWrt:/tmp# sysupgrade openwrt-18.06.8-ar71xx-mikrotik-nand-large-squashf

s-sysupgrade.bin 
Image metadata not found
Cannot save config while running from ramdisk.
Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sending TERM to remaining processes ... ntpd udhcpc odhcp6c dnsmasq ubusd logd rpcd netifd odhcpd uhttpd 
Sending KILL to remaining processes ... 
Performing system upgrade...
Unlocking kernel ...
Erasing kernel ...

Skipping bad block at 0x0   
Skipping bad block at 0x20000   
Skipping bad block at 0x40000   
Skipping bad block at 0x60000   
Skipping bad block at 0x80000   
Skipping bad block at 0xa0000   
Skipping bad block at 0xc0000   
Skipping bad block at 0xe0000   
Skipping bad block at 0x100000   
Skipping bad block at 0x120000   
Skipping bad block at 0x140000   
Skipping bad block at 0x160000   
Skipping bad block at 0x180000   
Skipping bad block at 0x1a0000   
Skipping bad block at 0x1c0000   
Skipping bad block at 0x1e0000   
Skipping bad block at 0x200000   
Skipping bad block at 0x220000   
Skipping bad block at 0x240000   
Skipping bad block at 0x260000   
Skipping bad block at 0x280000   
Skipping bad block at 0x2a0000   
Skipping bad block at 0x2c0000   
Skipping bad block at 0x2e0000   
Skipping bad block at 0x300000   Writing data to block 0 at offset 0x0
Bad block at 0, 1 block(s) will be skipped
Writing data to block 1 at offset 0x20000
Bad block at 20000, 1 block(s) will be skipped
Writing data to block 2 at offset 0x40000
Bad block at 40000, 1 block(s) will be skipped
Writing data to block 3 at offset 0x60000
Bad block at 60000, 1 block(s) will be skipped
Writing data to block 4 at offset 0x80000
Bad block at 80000, 1 block(s) will be skipped
Writing data to block 5 at offset 0xa0000
Bad block at a0000, 1 block(s) will be skipped
Writing data to block 6 at offset 0xc0000
Bad block at c0000, 1 block(s) will be skipped
Writing data to block 7 at offset 0xe0000
Bad block at e0000, 1 block(s) will be skipped
Writing data to block 8 at offset 0x100000
Bad block at 100000, 1 block(s) will be skipped
Writing data to block 9 at offset 0x120000
Bad block at 120000, 1 block(s) will be skipped
Writing data to block 10 at offset 0x140000
Bad block at 140000, 1 block(s) will be skipped
Writing data to block 11 at offset 0x160000
Bad block at 160000, 1 block(s) will be skipped
Writing data to block 12 at offset 0x180000
Bad block at 180000, 1 block(s) will be skipped
Writing data to block 13 at offset 0x1a0000
Bad block at 1a0000, 1 block(s) will be skipped
Writing data to block 14 at offset 0x1c0000
Bad block at 1c0000, 1 block(s) will be skipped
Writing data to block 15 at offset 0x1e0000
Bad block at 1e0000, 1 block(s) will be skipped
Writing data to block 16 at offset 0x200000
Bad block at 200000, 1 block(s) will be skipped
Writing data to block 17 at offset 0x220000
Bad block at 220000, 1 block(s) will be skipped
Writing data to block 18 at offset 0x240000
Bad block at 240000, 1 block(s) will be skipped
Writing data to block 19 at offset 0x260000
Bad block at 260000, 1 block(s) will be skipped
Writing data to block 20 at offset 0x280000
Bad block at 280000, 1 block(s) will be skipped
Writing data to block 21 at offset 0x2a0000
Bad block at 2a0000, 1 block(s) will be skipped
Writing data to block 22 at offset 0x2c0000
Bad block at 2c0000, 1 block(s) will be skipped
Writing data to block 23 at offset 0x2e0000
Bad block at 2e0000, 1 block(s) will be skipped
Writing data to block 24 at offset 0x300000
Bad block at 300000, 1 block(s) will be skipped
Writing data to block 25 at offset 0x320000
Writing data to block 26 at offset 0x340000
Writing data to block 27 at offset 0x360000
Writing data to block 28 at offset 0x380000
Writing data to block 29 at offset 0x3a0000
tar: write error: Broken pipe
[  287.258878] ubi0: attaching mtd6
[  287.815935] ubi0: scanning is finished
[  287.819691] ubi0: empty MTD device detected
[  287.871747] ubi0: attached mtd6 (name "ubi", size 124 MiB)
[  287.877242] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[  287.884164] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[  287.890933] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[  287.897898] ubi0: good PEBs: 992, bad PEBs: 0, corrupted PEBs: 0
[  287.903904] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[  287.911111] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 35056040
[  287.920059] ubi0: available PEBs: 968, total reserved PEBs: 24, PEBs reserved for bad PEB handling: 20
[  287.929407] ubi0: background thread "ubi_bgt0d" started, PID 1697
UBI device number 0, total 992 LEBs (125960192 bytes, 120.1 MiB), available 968 LEBs (122912768 bytes, 117.2 MiB), LEB size 126976 bytes (124.0 KiB)
Volume ID 0, size 13 LEBs (1650688 bytes, 1.5 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "none", alignment 1
Volume ID 1, size 20 LEBs (2539520 bytes, 2.4 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 118722560
Volume ID 2, size 935 LEBs (118722560 bytes, 113.2 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
umount: can't unmount /: Invalid argument
[  294.271990] reboot: Restarting system


RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..

loading kernel from nand... OK
setting up elf image...

I have small progress but have to change size of ubi image somewhere ?
I change https://github.com/openwrt/openwrt/blob/master/target/linux/ar71xx/files/drivers/mtd/nand/rb4xx_nand.c
from

	{
		.name	= "kernel",
		.offset	= (256 * 1024),
		.size	= (4 * 1024 * 1024) - (256 * 1024),
	},

to

	{
		.name	= "kernel",
		.offset	= (256 * 1024),
		.size	= (8 * 1024 * 1024) - (256 * 1024),
	},

the result was:

root@OpenWrt:/tmp# sysupgrade openwrt-ar71xx-mikrotik-nand-large-squashfs-sysupg

rade.bin 
Image metadata not found
Cannot save config while running from ramdisk.
Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
killall: telnetd: no process killed
Sending TERM to remaining processes ... netifd ubusd urngd logd ntpd 
Sending KILL to remaining processes ... 
Performing system upgrade...
Unlocking kernel ...
Erasing kernel ...

Skipping bad block at 0x0   
Skipping bad block at 0x20000   
Skipping bad block at 0x40000   
Skipping bad block at 0x60000   
Skipping bad block at 0x80000   
Skipping bad block at 0xa0000   
Skipping bad block at 0xc0000   
Skipping bad block at 0xe0000   
Skipping bad block at 0x100000   
Skipping bad block at 0x120000   
Skipping bad block at 0x140000   
Skipping bad block at 0x160000   
Skipping bad block at 0x180000   
Skipping bad block at 0x1a0000   
Skipping bad block at 0x1c0000   
Skipping bad block at 0x1e0000   
Skipping bad block at 0x200000   
Skipping bad block at 0x220000   
Skipping bad block at 0x240000   
Skipping bad block at 0x260000   
Skipping bad block at 0x280000   
Skipping bad block at 0x2a0000   
Skipping bad block at 0x2c0000   
Skipping bad block at 0x2e0000   
Skipping bad block at 0x300000   Writing data to block 0 at offset 0x0
Bad block at 0, 1 block(s) will be skipped
Writing data to block 1 at offset 0x20000
Bad block at 20000, 1 block(s) will be skipped
Writing data to block 2 at offset 0x40000
Bad block at 40000, 1 block(s) will be skipped
Writing data to block 3 at offset 0x60000
Bad block at 60000, 1 block(s) will be skipped
Writing data to block 4 at offset 0x80000
Bad block at 80000, 1 block(s) will be skipped
Writing data to block 5 at offset 0xa0000
Bad block at a0000, 1 block(s) will be skipped
Writing data to block 6 at offset 0xc0000
Bad block at c0000, 1 block(s) will be skipped
Writing data to block 7 at offset 0xe0000
Bad block at e0000, 1 block(s) will be skipped
Writing data to block 8 at offset 0x100000
Bad block at 100000, 1 block(s) will be skipped
Writing data to block 9 at offset 0x120000
Bad block at 120000, 1 block(s) will be skipped
Writing data to block 10 at offset 0x140000
Bad block at 140000, 1 block(s) will be skipped
Writing data to block 11 at offset 0x160000
Bad block at 160000, 1 block(s) will be skipped
Writing data to block 12 at offset 0x180000
Bad block at 180000, 1 block(s) will be skipped
Writing data to block 13 at offset 0x1a0000
Bad block at 1a0000, 1 block(s) will be skipped
Writing data to block 14 at offset 0x1c0000
Bad block at 1c0000, 1 block(s) will be skipped
Writing data to block 15 at offset 0x1e0000
Bad block at 1e0000, 1 block(s) will be skipped
Writing data to block 16 at offset 0x200000
Bad block at 200000, 1 block(s) will be skipped
Writing data to block 17 at offset 0x220000
Bad block at 220000, 1 block(s) will be skipped
Writing data to block 18 at offset 0x240000
Bad block at 240000, 1 block(s) will be skipped
Writing data to block 19 at offset 0x260000
Bad block at 260000, 1 block(s) will be skipped
Writing data to block 20 at offset 0x280000
Bad block at 280000, 1 block(s) will be skipped
Writing data to block 21 at offset 0x2a0000
Bad block at 2a0000, 1 block(s) will be skipped
Writing data to block 22 at offset 0x2c0000
Bad block at 2c0000, 1 block(s) will be skipped
Writing data to block 23 at offset 0x2e0000
Bad block at 2e0000, 1 block(s) will be skipped
Writing data to block 24 at offset 0x300000
Bad block at 300000, 1 block(s) will be skipped
Writing data to block 25 at offset 0x320000
Writing data to block 26 at offset 0x340000
Writing data to block 27 at offset 0x360000
Writing data to block 28 at offset 0x380000
Writing data to block 29 at offset 0x3a0000
Writing data to block 30 at offset 0x3c0000
Writing data to block 31 at offset 0x3e0000
Writing data to block 32 at offset 0x400000
Writing data to block 33 at offset 0x420000
Writing data to block 34 at offset 0x440000
Writing data to block 35 at offset 0x460000
Writing data to block 36 at offset 0x480000
Writing data to block 37 at offset 0x4a0000
Writing data to block 38 at offset 0x4c0000
[  219.678301] ubi0: attaching mtd6
[  220.724921] ubi0: scanning is finished
[  220.797379] ubi0 error: ubi_read_volume_table: not enough PEBs, required 970, available 960
[  220.806168] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd6, error -28
ubiattach: error!: cannot attach mtd6
           error 28 (No space left on device)
ubiformat: mtd6 (nand), size 125829120 bytes (120.0 MiB), 960 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes

libscan: scanning eraseblock 0 --  0 % complete  
libscan: scanning eraseblock 1 --  0 % complete  
... 
libscan: scanning eraseblock 958 -- 99 % complete  
libscan: scanning eraseblock 959 -- 100 % complete  
ubiformat: 960 eraseblocks have valid erase counter, mean value is 1

ubiformat: formatting eraseblock 0 --  0 % complete  
ubiformat: formatting eraseblock 1 --  0 % complete  
....
ubiformat: formatting eraseblock 958 -- 99 % complete  
ubiformat: formatting eraseblock 959 -- 100 % complete  
[  230.898983] ubi0: attaching mtd6
[  231.945601] ubi0: scanning is finished
[  232.021306] ubi0: attached mtd6 (name "ubi", size 120 MiB)
[  232.026864] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[  232.033723] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[  232.040519] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[  232.047474] ubi0: good PEBs: 960, bad PEBs: 0, corrupted PEBs: 0
[  232.053466] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[  232.060696] ubi0: max/mean erase counter: 3/2, WL threshold: 4096, image sequence number: 318895745
[  232.069740] ubi0: available PEBs: 936, total reserved PEBs: 24, PEBs reserved for bad PEB handling: 20
[  232.079057] ubi0: background thread "ubi_bgt0d" started, PID 1347
UBI device number 0, total 960 LEBs (121896960 bytes, 116.2 MiB), available 936 LEBs (118849536 bytes, 113.3 MiB), LEB size 126976 bytes (124.0 KiB)
Volume ID 0, size 14 LEBs (1777664 bytes, 1.6 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "none", alignment 1
Volume ID 1, size 19 LEBs (2412544 bytes, 2.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 114659328
Volume ID 2, size 903 LEBs (114659328 bytes, 109.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
umount: can't unmount /: Invalid argument
[  236.149721] reboot: Restarting system


RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..

loading kernel from nand... OK
setting up elf image... 

RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..

loading kernel from nand... OK
setting up elf image... OK
jumping to kernel code



OpenWrt kernel loader for AR7XXX/AR9XXX

Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>

Decompressing kernel... failed, data error!


System halted!



RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..

loading kernel from nand... OK
setting up elf image... OK
jumping to kernel code



OpenWrt kernel loader for AR7XXX/AR9XXX

Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>

Decompressing kernel... failed, data error!


System halted!

@flyn, @f00b4r0,
I see your commit: https://github.com/openwrt/openwrt/pull/3026
Maybe you are able to help in my case - too many bad blocks on kernel partition. And probably bad block on address 40000 - start of kernel partition. What I should changed ? Thanks in advance

Currently, in order for the board to run, the kernel downloaded with bootp (another router in the network with dnsmasq) and the rest starts from nand.

dhcp-boot=openwrt-ar71xx-mikrotik-vmlinux-lzma.elf,boothost,192.168.1.3

If someone knows how to change the address where the board should look for the kernel, it would be great. I changed the partition layout to:

    {
        .name    = "kernel",
        .offset    = (256 * 1024) + (5 * 1024 * 1024),
        .size    = (8 * 1024 * 1024) - (256 * 1024),
    },

So partition layout is:

root@RB433:~# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 0000b000 00001000 "routerboot"
mtd1: 00001000 00001000 "hard_config"
mtd2: 00002000 00001000 "bios"
mtd3: 00001000 00001000 "soft_config"
mtd4: 00040000 00020000 "booter"
mtd5: 007c0000 00020000 "kernel"
mtd6: 07300000 00020000 "ubi"

and finally we have:

RouterBOOT booter 3.22

RouterBoard 433

CPU frequency: 300 MHz
  Memory size:  64 MiB
    NAND size: 128 MiB

Press any key within 2 seconds to enter setup..

loading kernel from nand... kernel not found
trying bootp protocol...................................................... OK
Got IP address: 192.168.1.6
resolved mac address F0:B4:29:59:41:AE
Gateway: 192.168.1.1
transfer started ............ transfer ok, time=1.27s
setting up elf image... OK
jumping to kernel code



OpenWrt kernel loader for AR7XXX/AR9XXX

Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>

Decompressing kernel... done!

Starting kernel at 80060000...


[    0.000000] Linux version 4.14.193 (amk082@krk-sc11-19) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11181-e754e0a)) #0 Wed Aug 12 09:10:16 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7130 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x90/0x47c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: parts=1 boot_part_size=4194304 gpio=4031 HZ=150000000 mem=64M kmac=00:0C:42:42:64:60 board=433 ver=3.22 hw_opt=00000000 boot=1 mlc=8 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 59396K/65536K available (3705K kernel code, 158K rwdata, 860K rodata, 196K init, 201K bss, 6140K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] Clocks: CPU:300.000MHz, DDR:300.000MHz, AHB:150.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 12741736309 ns
[    0.000016] sched_clock: 32 bits at 150MHz, resolution 6ns, wraps every 14316557820ns
[    0.007916] Calibrating delay loop... 199.06 BogoMIPS (lpj=995328)
[    0.094106] pid_max: default: 32768 minimum: 301
[    0.099106] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.105722] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.116472] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.126348] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.133024] NET: Registered protocol family 16
[    0.139711] MIPS: machine is MikroTik RouterBOARD 433/AH
[    0.917342] registering PCI controller with io_map_base unset
[    0.944232] rb4xx-spi rb4xx-spi: controller is unqueued, this is deprecated
[    0.952646] PCI host bridge to bus 0000:00
[    0.956820] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    0.963679] pci_bus 0000:00: root bus resource [io  0x0000]
[    0.969265] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.976036] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.985123] clocksource: Switched to clocksource MIPS
[    0.991648] NET: Registered protocol family 2
[    0.997349] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    1.004339] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    1.010775] TCP: Hash tables configured (established 1024 bind 1024)
[    1.017382] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    1.023232] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    1.029920] NET: Registered protocol family 1
[    1.042176] Crashlog allocated RAM at address 0x3f00000
[    1.049280] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    1.064285] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    1.070171] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    1.094083] io scheduler noop registered
[    1.098073] io scheduler deadline registered (default)
[    1.103592] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    1.110556] console [ttyS0] disabled
[    1.134191] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 9375000) is a 16550A
[    1.142827] console [ttyS0] enabled
[    1.142827] console [ttyS0] enabled
[    1.149795] bootconsole [early0] disabled
[    1.149795] bootconsole [early0] disabled
[    1.159365] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[    1.168408] Creating 4 MTD partitions on "spi0.0":
[    1.173213] 0x000000000000-0x00000000b000 : "routerboot"
[    1.180998] 0x00000000b000-0x00000000c000 : "hard_config"
[    1.188496] 0x00000000d000-0x00000000f000 : "bios"
[    1.196194] 0x00000000f000-0x000000010000 : "soft_config"
[    1.203856] NAND flash driver for RouterBoard 4xx series version 0.2.0
[    1.218085] nand: Could not find valid ONFI parameter page; aborting
[    1.224493] nand: device found, Manufacturer ID: 0x20, Chip ID: 0xf1
[    1.230847] nand: ST Micro NAND 128MiB 3,3V 8-bit
[    1.235567] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    1.243138] Scanning device for bad blocks
[    1.247854] Bad eraseblock 2 at 0x000000040000
[    1.252483] Bad eraseblock 3 at 0x000000060000
[    1.257137] Bad eraseblock 4 at 0x000000080000
[    1.261771] Bad eraseblock 5 at 0x0000000a0000
[    1.266425] Bad eraseblock 6 at 0x0000000c0000
[    1.271059] Bad eraseblock 7 at 0x0000000e0000
[    1.275713] Bad eraseblock 8 at 0x000000100000
[    1.280347] Bad eraseblock 9 at 0x000000120000
[    1.284978] Bad eraseblock 10 at 0x000000140000
[    1.289718] Bad eraseblock 11 at 0x000000160000
[    1.294439] Bad eraseblock 12 at 0x000000180000
[    1.299180] Bad eraseblock 13 at 0x0000001a0000
[    1.303900] Bad eraseblock 14 at 0x0000001c0000
[    1.308640] Bad eraseblock 15 at 0x0000001e0000
[    1.313360] Bad eraseblock 16 at 0x000000200000
[    1.318104] Bad eraseblock 17 at 0x000000220000
[    1.322822] Bad eraseblock 18 at 0x000000240000
[    1.327561] Bad eraseblock 19 at 0x000000260000
[    1.332273] Bad eraseblock 20 at 0x000000280000
[    1.337014] Bad eraseblock 21 at 0x0000002a0000
[    1.341735] Bad eraseblock 22 at 0x0000002c0000
[    1.346474] Bad eraseblock 23 at 0x0000002e0000
[    1.351187] Bad eraseblock 24 at 0x000000300000
[    1.355926] Bad eraseblock 25 at 0x000000320000
[    1.360638] Bad eraseblock 26 at 0x000000340000
[    1.365379] Bad eraseblock 27 at 0x000000360000
[    1.370100] Bad eraseblock 28 at 0x000000380000
[    1.374817] Bad eraseblock 29 at 0x0000003a0000
[    1.379557] Bad eraseblock 30 at 0x0000003c0000
[    1.384277] Bad eraseblock 31 at 0x0000003e0000
[    1.389018] Bad eraseblock 32 at 0x000000400000
[    1.393739] Bad eraseblock 33 at 0x000000420000
[    1.398479] Bad eraseblock 34 at 0x000000440000
[    1.403199] Bad eraseblock 35 at 0x000000460000
[    1.407940] Bad eraseblock 36 at 0x000000480000
[    1.412859] Bad eraseblock 38 at 0x0000004c0000
[    1.417599] Bad eraseblock 39 at 0x0000004e0000
[    1.618319] Creating 3 MTD partitions on "NAND 128MiB 3,3V 8-bit":
[    1.624505] 0x000000000000-0x000000040000 : "booter"
[    1.631905] 0x000000540000-0x000000d00000 : "kernel"
[    1.639108] 0x000000d00000-0x000008000000 : "ubi"
[    1.651098] libphy: Fixed MDIO Bus: probed
.....

@kofec, where did you get openwrt-ar71xx-mikrotik-vmlinux-lzma.elf? My build process does not create that file. I do have build_dir/target-mips_24kc_musl/linux-ath79_mikrotik/vmlinux.elf. Is this the same file?

I presume openwrt-ar71xx-mikrotik-vmlinux-lzma.elf contains only the kernel and not an initramfs. Is the default procedure used by this kernel image to boot off NAND? How would I know?

Did you have any success adjusting the layout and position of the partitions? I have also thought of that as a potential solution to excess bad blocks, but I never had any success laying things out in a way that worked.

I have one running RB49G and one spare. The spare is not booting the ATH79 images, as noted at https://github.com/openwrt/openwrt/pull/3026#issuecomment-694605091. I am not sure whether this is due to bad blocks or not, and I am afraid to flash my running RB493G to find out---I do not want to be left without any working routers.

It is beginning to become difficult to find replacement RB493G boards!

I am seeing similar behaviour on the RB2011 series. I have one router, which was never used, and upon trying to upgrade openwrt some months after the initial flash, it suddenly reported bad blocks via serial. It's a bit strange, since it was never used. I doubt it's a flash issue. I don't see any way to adjust the bootloaders partitions from the mikrotik bootloader (no shell), so it may be easier to replace the flash. Although this is a NAND flash, which means it's less supported by eeprom programmers. Bit of a mess, it is.

I believe the initial partitions are handled by routerboot, and not changeable as far as I can tell. Time to get a device with uboot instead.

I should mention that there are actually two routers exhibiting this behavior. One was used in an office environment, the other one was unused, outside of being flashed once, then put in storage.

Both seem to have corrupted their flash, as neither will boot. I've confirmed one via UART, but the other one lacks the uart ic. Nonetheless, boot behavior is identical.

Since these run Routerboot, it looks like they are destined for a landfill.

So just bricked my RB2011UiAS-RM also with bad sectors. Can boot over ethernet just fine, but won't work after flashing openwrt from webui. I understand there is nothing what can be done for this matter?
It was brand new router and worked for some time and then I updated fw and this happened before I even got this to production.

EDIT:

Well. You can get it to work. It seems 19 is broken. But you can fix bad sectors error. I red that if you flash routerboard fw it will reformat flash and clean bad blocks.

So I flashed routerboard back in there and then bootet 19 up from ethernet and sysupgaded to 19. It went back to bad sectors.

Then I reinstalled routerboard and booted 19 and sysupgarded 18. Again badblocks.

Then reinstalled routerboard and booted 18 and sysupgraded 18. And now it works. Seems 19 somehow breaks it.

So maybe not landfill afterall :slight_smile:

Routerboard itself works, so you can actually revert to factory fw no problem and nothing is broken.
@kofec @teppo

I think I observed...

Did anyone note if they reformatted NAND first?