Unable to mount root fs on unknown-block(31,4)

Hi,

Currently I am working on a EasyBox 802 and I want to get openwrt to run on it. So I deleted the original boot loader and replaced it with uboot and flashed the latest version of openwrt using UART. So far so good.
But as for some reason the device is unable to mount the root file system. I did some research (I am completely new to this subject) and discovered that I need to tell the machine where to mount the root fs using bootargs. So I tried the following:

bootargs=root=/dev/mtdblockXZY

There are 7 mtdblocks and I tried it with mtdblock0 - mtdblock6, but nothing worked.

I also tried.

bootargs=root=/dev/mtdblockXZY rw rootfstype=quashfs

and

bootargs=root=/dev/mtdblockXZY r rootfstype=quashfs

And a lot more stuff, but nothing worked.

I am running out of ideas, so I hope someone of you can help me with this problem.

Here is my boot log:

[    0.000000] Linux version 4.9.152 (buildbot@builds-03.infra.lede-project.org) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7552-2f11a9e) ) #0 Mon Jan 28 08:54:32 2019
[    0.000000] SoC: Danube rev 1.5
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019641 (MIPS 24KEc)
[    0.000000] MIPS: machine is Arcor 802
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 16kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 16kB, 4-way, VIPT, no 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: console=ttyLTQ0,115200
[    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=0004eb38
[    0.000000] Readback ErrCtl register=0004eb38
[    0.000000] Memory: 58656K/65536K available (4012K kernel code, 170K rwdata, 624K rodata, 1192K init, 210K bss, 6880K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS:256
[    0.000000] CPU Clock: 333MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000021] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.007964] Calibrating delay loop... 221.18 BogoMIPS (lpj=442368)
[    0.050634] pid_max: default: 32768 minimum: 301
[    0.055606] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.062157] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.079466] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.089171] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.095436] pinctrl core: initialized pinctrl subsystem
[    0.103082] NET: Registered protocol family 16
[    0.115679] pinctrl-xway 1e100b10.pinmux: Init done
[    0.122216] dma-xway 1e104100.dma: Init done - hw rev: 3, ports: 5, channels: 20
[    0.183094] Can't analyze schedule() prologue at 803e8e30
[    0.189857] PCI host bridge /fpi@10000000/pci@E105400 ranges:
[    0.195566]  MEM 0x0000000018000000..0x0000000019ffffff
[    0.200834]   IO 0x000000001ae00000..0x000000001affffff
[    0.256114] usbcore: registered new interface driver usbfs
[    0.261742] usbcore: registered new interface driver hub
[    0.267171] usbcore: registered new device driver usb
[    0.272807] PCI host bridge to bus 0000:00
[    0.276862] pci_bus 0000:00: root bus resource [mem 0x18000000-0x19ffffff]
[    0.283785] pci_bus 0000:00: root bus resource [io  0x1ae00000-0x1affffff]
[    0.290727] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    0.297582] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    0.306471] pci 0000:00:0e.0: BAR 0: assigned [mem 0x18000000-0x1800ffff]
[    0.323463] clocksource: Switched to clocksource MIPS
[    0.330983] NET: Registered protocol family 2
[    0.337206] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.344175] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.350559] TCP: Hash tables configured (established 1024 bind 1024)
[    0.357147] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.362966] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.369659] NET: Registered protocol family 1
[    0.380239] gptu: totally 6 16-bit timers/counters
[    0.385204] gptu: misc_register on minor 63
[    0.389351] gptu: succeeded to request irq 126
[    0.393852] gptu: succeeded to request irq 127
[    0.398365] gptu: succeeded to request irq 128
[    0.402879] gptu: succeeded to request irq 129
[    0.407393] gptu: succeeded to request irq 130
[    0.411909] gptu: succeeded to request irq 131
[    0.423147] lantiq,vmmc 1f103000.vmmc: requested GPIO 465
[    0.428510] lantiq,vmmc 1f103000.vmmc: reserved 1MB at 0x03a00000
[    0.436327] Crashlog allocated RAM at address 0x3f00000
[    0.445153] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.467818] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.473587] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.510738] io scheduler noop registered
[    0.514600] io scheduler deadline registered (default)
[    0.520992] 1e100c00.serial: ttyLTQ0 at MMIO 0x1e100c00 (irq = 112, base_baud = 0) is a lantiq,asc
[    0.529965] console [ttyLTQ0] enabled
[    0.529965] console [ttyLTQ0] enabled
[    0.537065] bootconsole [early0] disabled
[    0.537065] bootconsole [early0] disabled
[    0.546467] lantiq nor flash device: 00800000 at 10000000
[    0.550739] ltq_nor: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022cb
[    0.559700] Amd/Fujitsu Extended Query Table at 0x0040
[    0.564702]   Amd/Fujitsu Extended Query version 1.1.
[    0.569562] number of CFI chips: 1
[    0.572916] 4 fixed-partitions partitions found on MTD device ltq_nor
[    0.579109] Creating 4 MTD partitions on "ltq_nor":
[    0.583866] 0x000000000000-0x000000010000 : "uboot"
[    0.595859] 0x000000010000-0x000000020000 : "uboot_env"
[    0.603574] 0x000000020000-0x0000007f0000 : "firmware"
[    0.652460] 2 uimage-fw partitions found on MTD device firmware
[    0.656919] 0x000000020000-0x0000001a313e : "kernel"
[    0.664841] 0x0000001a313e-0x0000007f0000 : "rootfs"
[    0.672294] mtd: device 4 (rootfs) set to be root filesystem
[    0.676606] 1 squashfs-split partitions found on MTD device rootfs
[    0.682498] 0x0000004a0000-0x0000007f0000 : "rootfs_data"
[    0.691668] 0x0000007f0000-0x000000800000 : "board_config"
[    0.702936] libphy: Fixed MDIO Bus: probed
[    0.727306] libphy: ltq_mii: probed
[    0.829726] Registering RTL8306SDM switch with Chip ID: 0x5988, version: 0x0000
[    0.835578] Realtek RTL8306S 1e180000.etop-ffffffff:00: attached PHY driver [Realtek RTL8306S] (mii_bus:phy_addr=1e180000.etop-ffffffff:00, irq=-1)
[    0.850417] wdt 1f8803f0.watchdog: Init done
[    0.859911] NET: Registered protocol family 10
[    0.875774] NET: Registered protocol family 17
[    0.878796] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    0.891373] 8021q: 802.1Q VLAN Support v1.8
[    0.903574] OF: fdt:not creating '/sys/firmware/fdt': CRC check fa[    0.914862] squashfs: SQUASHFS error: unable to read id index table
[    0.919988] List of all partitions:
[    0.922944] 1f00              64 mtdblock0 [    0.926899]  (driver?)
[    0.929187] 1f01              64 mtdblock1 [    0.933045]  (driver?)
[    0.935277] 1f02            8000 mtdblock2 [    0.939221]  (driver?)
[    0.941521] 1f03            1548 mtdblock3 [    0.945378]  (driver?)
[    0.947688] 1f04            6451 mtdblock4 [    0.951546]  (driver?)
[    0.953778] 1f05            3392 mtdblock5 [    0.957721]  (driver?)
[    0.960022] 1f06              64 mtdblock6 [    0.963880]  (driver?)
[    0.966095] No filesystem could mount root, tried: [    0.970733]  squashfs
[    0.972920]
[    0.974299] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,4)
[    0.984595] Rebooting in 1 seconds..

Can you post the log within </> code blocks? That way it is much easier to read. Use the above icon for that when you edit your post. That icon should create 6 backticks ` and you need to paste the log between them. Thank you

Dunno how you flashed without knowing which was the rootpart but; ( EDIT: OK I found the support page )

[ 0.682498] 0x0000004a0000-0x0000007f0000 : "rootfs_data"

In some sort of split partition.... errors might also indicate issues with supporting the filesystem? Wonder if it ( openwrt ) is there?

What image did you flash? ( EDIT: Never mind found it ) Also i think "rootblock" might be worth a try.... If you can, it's worth trying to get an initramfs up over tftp in most cases.... because from there, you can inspect freely and it provides a platform for backup / restore.....

That looks like it should work. It's a fixed-partitions scheme so you're really at the mercy of the build to find the partitions. The bootargs will likely be ignored.

If the bootargs get ignored, how am i able to tell it which partition it should use?

Done, thank you

Would it be possible for @Domtavus to change the partition scheme to be more in line with OpenWrt? That way all the future hassle can be avoided.

I'm not sure why it didn't mount. mtd4 was properly identified as the rootfs. Possibly the squashfs is corrupt?

1 Like

Hi, i used UART to copy the openwrt image to the ram and flashed it from there, maybe there was an error made while transmitting or copying from ram to flash. But if that is the case, i dont understand why the verification of the chekcsum turns out to be ok during boot procedure.

Hit any key to stop autoboot:  0
## Booting kernel from Legacy Image at b0020000 ...
   Image Name:   MIPS OpenWrt Linux-4.9.152
   Created:      2019-01-30  12:21:02 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1585406 Bytes =  1.5 MB
   Load Address: 80002000
   Entry Point:  80002000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ...


The bootloader only reads and checksums the kernel partition. The rootfs should be in flash immediately after the kernel, but it is only accessed by the kernel.

I think someone else also had a similar mount error on an EasyBox router and they were able to boot their system by changing some partition variables within the code files. You can probably search for it in the forum.

sounds like you just flashed the KERNEL.... and not the ROOTFS

To be honest, I don't realy know what I did (always good). I just downloaded the image from the link below and copied it, as it is, to my flash. And that's basically all I did.

downloads.openwrt.org/releases/18.06.2/targets/lantiq/xway/openwrt-18.06.2-lantiq-xway-arcadyan_arv752dpw-squashfs-sysupgrade.bin

And what did you do with the initramfs-kernel.bin file?

Oh ok, now I have an idea why it can't mount the root fs, because there is none. Well thats embarrassing.