[Solved] Where's my rootfs?

#1

Dear All,

I'm really close to getting my Netgear WAC510 booting OpenWrt from it's flash instead of initramfs - I just need a little help in figuring out where to tell the kernel my rootfs is once I've sysupgraded from my initramfs.

From uboot, I can load the kernel from the UBI volume, but the kernel can't see the UBI rootfs. From uboot, I believe my NAND has MTD partitions that contain UBI volumes, like this:
MTD 'rootfs': ubi(kernel,ubi_rootfs,rootfs,rootfs_data)
MTD 'rootfs_1': ubi(kernel,ubi_rootfs)

When I boot the kernel from MTD(rootfs):ubi(kernel), the kernel can't see any of the other UBI volumes. Here's what happens with the bootargs set as ubi.mtd=rootfs root=ubi0:rootfs:
[ 2.036809] Creating 1 MTD partitions on "spi0.1":
[ 2.041164] 0x000000000000-0x000003800000 : "rootfs"
[ 2.047263] mtd: device 9 (rootfs) set to be root filesystem
[ 2.053297] mtdsplit: no squashfs found in "rootfs"
[ 2.078166] ubi0: attaching mtd9
[ 4.346371] ubi0: scanning is finished
[ 4.403902] ubi0: attached mtd9 (name "rootfs", size 56 MiB)
[ 4.403934] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[ 4.408629] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[ 4.415351] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[ 4.422190] ubi0: good PEBs: 448, bad PEBs: 0, corrupted PEBs: 0
[ 4.428942] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[ 4.435211] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 1011195579
[ 4.442257] ubi0: available PEBs: 0, total reserved PEBs: 448, PEBs reserved for bad PEB handling: 20
[ 4.451535] ubi0: background thread "ubi_bgt0d" started, PID 105
[ 4.456078] block ubiblock0_2: created from ubi0:2�[ 4.472467] VFS: Cannot open root device "ubi0:rootfs" or unknown-block(31,9): error -2
[ 4.472498] Please append a correct "root=" boot option; here are the available partitions:
[ 4.479295] 1f00 256 mtdblock0 [ 4.487647] (driver?)
[ 4.492819] 1f01 128 mtdblock1 [ 4.494035] (driver?)
[ 4.499162] 1f02 384 mtdblock2 [ 4.500381] (driver?)
[ 4.505509] 1f03 64 mtdblock3 [ 4.506727] (driver?)
[ 4.511868] 1f04 64 mtdblock4 [ 4.513072] (driver?)
[ 4.518200] 1f05 64 mtdblock5 [ 4.519420] (driver?)
[ 4.524547] 1f06 960 mtdblock6 [ 4.525765] (driver?)
[ 4.530893] 1f07 64 mtdblock7 [ 4.532126] (driver?)
[ 4.537238] 1f08 64 mtdblock8 [ 4.538455] (driver?)
[ 4.543584] 1f09 57344 mtdblock9 [ 4.544802] (driver?)
[ 4.549930] fe00 2480 ubiblock0_2 [ 4.551150] (driver?)
[ 4.556451] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,9)

When I boot from my initramfs image, I can use ubiattach to see all the UBI volumes on MTD(rootfs).

What am I doing wrong? :frowning:

I should add that, if I do the obvious and set rootfs=fe00, then it still fails and the bootlog changes to this:
[ 4.545981] No filesystem could mount root, tried:
[ 4.547206] squashfs
[ 4.553019]
[ 4.554248] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,9)

Tim

Archer D7 support
#2

Please try following:

  1. set bootargs as
    bootargs="ubi.mtd=rootfs root=/dev/ubiblock0_2"

Please also try following:

  1. rename mtd partition name "rootfs" to "ubi"
  2. drop bootargs line

I have tried adding support for the device of ipq806x, but I have no experience with the device of ipq40xx. So, I am not very confident about the second procedure...

1 Like
Linksys EA8300
#3

I could have sworn I tried your first suggestion, but I've just tried it again and it works!

Wow! Thank you again!

Tim

1 Like