WNDR4500v3 - Kernel Panic - not syncing: VFS

Hello,

I am discovering OpenWrt. I install https://downloads.openwrt.org/snapshots/targets/ath79/nand/openwrt-ath79-nand-netgear_wndr4500-v3-squashfs-factory.img on my WNDR4500v3. It works until i reboot it. Then my router enter in an infinite reboot loop. I open it and i discover an UART port in it. so I can put netgear image back and try one more time to install openWrt. But infinite loop is back...

Using UART i can grab Kernel Panic :

U-Boot 1.1.4 (Aug 12 2014 - 15:21:46)

U-boot dni29 V0.5 for DNI HW ID: 29764821 NOR flash 2MB NAND flash 128MB RAM 128MB
 - Dragonfly 1.0DRAM:
sri
ath_ddr_initial_config(278): (ddr2 init)
ath_sys_frequency: cpu 775 ddr 650 ahb 258
Tap values = (0xf, 0xf, 0xf, 0xf)
128 MB
Top of RAM usable for U-Boot at: 88000000
Reserving 265k for U-Boot at: 87fbc000
Reserving 192k for malloc() at: 87f8c000
Reserving 44 Bytes for Board Info at: 87f8bfd4
Reserving 36 Bytes for Global Data at: 87f8bfb0
Reserving 128k for boot params() at: 87f6bfb0
Stack Pointer at: 87f6bf98
Now running in RAM - U-Boot at: 87fbc000
Flash Manuf Id 0xef, DeviceId0 0x40, DeviceId1 0x15
flash size 2MB, sector count = 32
Flash:  2 MB
Qualcomm Atheros SPI NAND Driver, Version 0.1 (c) 2014  Qualcomm Atheros Inc.
ath_parse_read_id: SPI NAND V.Id: 0xc8 D.Id: 0xf1
====== NAND Parameters ======
sc = 0x87ff77e4 page = 0x800 block = 0x20000In:    serial
Out:   serial
Err:   serial
Net:   ath_gmac_enet_initialize...
Fetching MAC Address from 0x87fe914c
ath_gmac_enet_initialize: reset mask:c02200
athr_mgmt_init ::done
Dragonfly  ----> S17 PHY *
athrs17_reg_init: complete
SGMII in forced mode
athr_gmac_sgmii_setup SGMII done
: cfg1 0x80000000 cfg2 0x7114
eth0: a0:63:91:86:db:6d
eth0 up
eth0
Setting 0x181162c0 to 0x40802100
Hit any key to stop autoboot:  0
Trying eth0
dup 1 speed 1000

 Client starts...[Listening] for ADVERTISE...Tchecksum bad
checksum bad
checksum bad
checksum bad
TTchecksum bad
checksum bad
checksum bad
checksum bad
checksum bad

Retry count exceeded; boot the image as usual

 nmrp server is stopped or failed !

Loading from device 0: ath-spi-nand (offset 0x0)

** check kernel image **
   Verifying Checksum ... OK

** check rootfs image **
   Verifying Checksum ... OK
## Booting image at 81000000 ...
   Image Name:   MIPS OpenWrt Linux-4.19.123
   Created:      2020-07-03  18:38:06 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    4194175 Bytes =  4 MB
   Load Address: 80060000
   Entry Point:  80060000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80060000) ...
## Giving linux memsize in bytes, 134217728

Starting kernel ...

[    0.000000] Linux version 4.19.123 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r13682-472f5b1474)) #0 Fri Jul 3 18:38:06 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019750 (MIPS 74Kc)
[    0.000000] MIPS: machine is Netgear WNDR4500 v3
[    0.000000] SoC: Qualcomm Atheros QCA956X ver 1 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 08000000 @ 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-0x0000000007ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[    0.000000] random: get_random_bytes called from start_kernel+0x98/0x4b0 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 32480
[    0.000000] Kernel command line: console=ttyS0,115200n8 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 121836K/131072K available (4814K kernel code, 178K rwdata, 1100K rodata, 1196K init, 214K bss, 9236K 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] CPU clock: 775.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 4932285024 ns
[    0.000007] sched_clock: 32 bits at 387MHz, resolution 2ns, wraps every 5541893118ns
[    0.008219] Calibrating delay loop... 385.02 BogoMIPS (lpj=770048)
[    0.046723] pid_max: default: 32768 minimum: 301
[    0.051795] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.058777] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.070802] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.081112] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.087680] pinctrl core: initialized pinctrl subsystem
[    0.094406] NET: Registered protocol family 16
[    0.127298] clocksource: Switched to clocksource MIPS
[    0.133694] NET: Registered protocol family 2
[    0.139148] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes)
[    0.147322] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.154684] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.161400] TCP: Hash tables configured (established 1024 bind 1024)
[    0.168233] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.174435] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.181363] NET: Registered protocol family 1
[    0.188907] Crashlog allocated RAM at address 0x3f00000
[    0.196048] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[    0.209014] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.215204] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.239229] io scheduler noop registered
[    0.243417] io scheduler deadline registered (default)
[    0.251049] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.258145] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.267027] console [ttyS0] disabled
[    0.270866] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    0.279974] console [ttyS0] enabled
[    0.279974] console [ttyS0] enabled
[    0.287527] bootconsole [early0] disabled
[    0.287527] bootconsole [early0] disabled
[    0.314765] m25p80 spi0.0: s25fl016k (2048 Kbytes)
[    0.319790] 8 fixed-partitions partitions found on MTD device spi0.0
[    0.326363] Creating 8 MTD partitions on "spi0.0":
[    0.331336] 0x000000000000-0x000000040000 : "u-boot"
[    0.337205] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.343507] 0x000000050000-0x000000060000 : "caldata_backup"
[    0.350116] 0x000000060000-0x000000070000 : "config"
[    0.355987] 0x000000070000-0x000000080000 : "traffic_meter"
[    0.362504] 0x000000080000-0x000000090000 : "pot"
[    0.368099] 0x000000090000-0x0000001f0000 : "reserved"
[    0.374175] 0x0000001f0000-0x000000200000 : "caldata"
[    0.385733] spi-nand spi0.1: GigaDevice SPI NAND was found.
[    0.391551] spi-nand spi0.1: 128 MiB, block size: 128 KiB, page size: 2048, OOB size: 64
[    0.400080] 2 fixed-partitions partitions found on MTD device spi0.1
[    0.406660] Creating 2 MTD partitions on "spi0.1":
[    0.411633] 0x000000000000-0x000000400000 : "kernel"
[    0.421618] 0x000000400000-0x000008000000 : "ubi"
[    0.554562] libphy: Fixed MDIO Bus: probed
[    1.135292] random: fast init done
[    1.191683] libphy: ag71xx_mdio: probed
[    1.198751] switch0: Atheros AR8337 rev. 2 switch registered on mdio.0
[    1.786752] ag71xx 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd036, driver=Atheros AR8216/AR8236/AR8316]
[    1.798073] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: sgmii
[    1.807390] NET: Registered protocol family 10
[    1.817434] Segment Routing with IPv6
[    1.821374] NET: Registered protocol family 17
[    1.826065] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.839463] 8021q: 802.1Q VLAN Support v1.8
[    1.846618] PCI host bridge /ahb/pcie-controller@18250000 ranges:
[    1.852977]  MEM 0x0000000012000000..0x0000000013ffffff
[    1.858388]   IO 0x0000000000000000..0x0000000000000000
[    1.863956] PCI host bridge to bus 0000:00
[    1.868231] pci_bus 0000:00: root bus resource [mem 0x12000000-0x13ffffff]
[    1.875341] pci_bus 0000:00: root bus resource [io  0x0000]
[    1.881110] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    1.888134] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    1.897685] pci 0000:00:00.0: BAR 0: assigned [mem 0x12000000-0x1201ffff 64bit]
[    1.905298] pci 0000:00:00.0: BAR 6: assigned [mem 0x12020000-0x1202ffff pref]
[    1.915555] UBI: auto-attach mtd9
[    1.919005] ubi0: attaching mtd9
[    3.850345] ubi0 warning: ubi_attach: valid VID header but corrupted EC header at PEB 991
[    3.858820] ubi0 error: ubi_add_to_av: two LEBs with same sequence number 1
[    3.866013] eraseblock attaching information dump:
[    3.870966]  ec       1
[    3.873501]  pnum     990
[    3.876217]  lnum     0
[    3.878742]  scrub    0
[    3.881269]  sqnum    1
[    3.883795] Volume identifier header dump:
[    3.888025]  magic     55424921
[    3.891267]  version   1
[    3.893885]  vol_type  1
[    3.896501]  copy_flag 1
[    3.899108]  compat    5
[    3.901727]  vol_id    2147479551
[    3.905156]  lnum      0
[    3.907773]  data_size 22528
[    3.910737]  used_ebs  0
[    3.913354]  data_pad  0
[    3.915971]  sqnum     1
[    3.918578]  hdr_crc   54de2e3b
[    3.921821] Volume identifier header hexdump:
[    3.926699] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd9, error -22
[    3.934100] UBI error: cannot attach mtd9
[    3.939214] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    3.947007] Please append a correct "root=" boot option; here are the available partitions:
[    3.955646] 1f00             256 mtdblock0
[    3.955649]  (driver?)
[    3.962418] 1f01              64 mtdblock1
[    3.962420]  (driver?)
[    3.969182] 1f02              64 mtdblock2
[    3.969184]  (driver?)
[    3.975947] 1f03              64 mtdblock3
[    3.975949]  (driver?)
[    3.982703] 1f04              64 mtdblock4
[    3.982705]  (driver?)
[    3.989468] 1f05              64 mtdblock5
[    3.989470]  (driver?)
[    3.996232] 1f06            1408 mtdblock6
[    3.996235]  (driver?)
[    4.002989] 1f07              64 mtdblock7
[    4.002991]  (driver?)
[    4.009744] 1f08            4096 mtdblock8
[    4.009746]  (driver?)
[    4.016508] 1f09          126976 mtdblock9
[    4.016511]  (driver?)
[    4.023263] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[    4.032625] Rebooting in 1 seconds..

Do you have any idea ? Thank you :slight_smile:

The UBI root filesystem in the NAND flash is improperly formatted.

It may work to boot the initramfs OpenWrt build (by TFTP in the bootloader) then use it to install the sysupgrade image.

My install is ok now. Thank you very much mk24 :slight_smile:

So :

  1. i use UART to tftpboot (https://downloads.openwrt.org/snapshots/targets/ath79/nand/openwrt-ath79-nand-netgear_wndr4500-v3-initramfs-kernel.bin) and bootm

  2. i use scp to put (https://downloads.openwrt.org/snapshots/targets/ath79/nand/openwrt-ath79-nand-netgear_wndr4500-v3-squashfs-sysupgrade.bin) and sysupgarde (via ssh). Some error during update but the install seems ok

Performing system upgrade...
Unlocking kernel ...

Writing from <stdin> to kernel ...
[ 1491.777568] ubi0: attaching mtd1
[ 1493.824810] ubi0 warning: ubi_attach: valid VID header but corrupted EC header at PEB 991
[ 1493.833290] ubi0 error: ubi_add_to_av: two LEBs with same sequence number 1
[ 1493.840488] eraseblock attaching information dump:
[ 1493.845445]  ec       1
[ 1493.847980]  pnum     990
[ 1493.850683]  lnum     0
[ 1493.853214]  scrub    0
[ 1493.855748]  sqnum    1
[ 1493.858273] Volume identifier header dump:
[ 1493.862512]  magic     55424921
[ 1493.865765]  version   1
[ 1493.868390]  vol_type  1
[ 1493.871005]  copy_flag 1
[ 1493.873623]  compat    5
[ 1493.876249]  vol_id    2147479551
[ 1493.879679]  lnum      0
[ 1493.882295]  data_size 22528
[ 1493.885270]  used_ebs  0
[ 1493.887896]  data_pad  0
[ 1493.890511]  sqnum     1
[ 1493.893133]  hdr_crc   54de2e3b
[ 1493.896380] Volume identifier header hexdump:
[ 1493.902046] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd1, error -22
ubiattach: error!: cannot attach mtd1
           error 22 (Invalid argument)
ubiformat: mtd1 (nand), size 130023424 bytes (124.0 MiB), 992 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 991 -- 100 % complete
ubiformat: 910 eraseblocks have valid erase counter, mean value is 1
ubiformat: 1 eraseblocks are supposedly empty
ubiformat: 1 bad eraseblocks found, numbers: 736
ubiformat: warning!: 80 of 991 eraseblocks contain non-UBI data
ubiformat: warning!: only 910 of 991 eraseblocks have valid erase counter
ubiformat: mean erase counter 1 will be used for the rest of eraseblock
ubiformat: use erase counter 1 for all eraseblocks
ubiformat: formatting eraseblock 938 -- 94 % complete  [ 1503.298811] nand: failed to write BBM to block @7fe0000 (err = -5)
ubiformat: form[ 1503.466707] ubi0: attaching mtd1ete
ubiformat: formatting eraseblock 991 -- 100 % complete  libmtd: error!: MEMERASE64 ioctl failed for eraseblock 991 (mtd1)
        error 5 (I/O error)

ubiformat: error!: failed to erase eraseblock 991
           error 5 (I/O error)
ubiformat: marking block 991 bad

[ 1505.514135] ubi0: scanning is finished
[ 1505.543800] ubi0: attached mtd1 (name "ubi", size 124 MiB)
[ 1505.549519] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 1505.556635] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 1505.563651] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 1505.570845] ubi0: good PEBs: 990, bad PEBs: 2, corrupted PEBs: 0
[ 1505.577053] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[ 1505.584521] ubi0: max/mean erase counter: 1/1, WL threshold: 4096, image sequence number: 828345020
[ 1505.593871] ubi0: available PEBs: 968, total reserved PEBs: 22, PEBs reserved for bad PEB handling: 18
[ 1505.604485] ubi0: background thread "ubi_bgt0d" started, PID 1896
UBI device number 0, total 990 LEBs (125706240 bytes, 119.8 MiB), available 968 LEBs (122912768 bytes, 117.2 MiB), LEB size 126976 bytes (124.0 KiB)
Volume ID 0, size 19 LEBs (2412544 bytes, 2.3 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 120500224
Volume ID 1, size 949 LEBs (120500224 bytes, 114.9 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 /: I[ 1507.594874] reboot: Restarting system
  1. Change the network.lan.ipaddr to avoid conflict...

It was epic (so much knowledge :p) but so rewarding !

ps: do you know how can i build working factory img for others users ?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.