OpenWrt Forum Archive

Topic: mtd: bad character after partition (r)

The content of this topic has been archived on 3 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I changed my spi flash from 8MB to 16MB, then I add a MTD partition of "mback"

But an error occurs: "mtd: bad character after partition (r)"
And 2 MTD partitions lost: 
0x000000ff0000-0x000001000000 : "art"
0x000000050000-0x0000007a0000 : "firmware"

Here is the booting info:

[    0.690000] m25p80 spi0.0: found w25q128, expected m25p80
[    0.690000] m25p80 spi0.0: w25q128 (16384 Kbytes)
[    0.700000] mtd: bad character after partition (r)
[    0.700000] 7 cmdlinepart partitions found on MTD device spi0.0
[    0.710000] Creating 7 MTD partitions on "spi0.0":
[    0.720000] 0x000000000000-0x000000040000 : "u-boot"
[    0.720000] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.730000] 0x000000050000-0x000000150000 : "kernel"
[    0.740000] 0x000000150000-0x0000007a0000 : "rootfs"
[    0.740000] mtd: partition "rootfs" set to be root filesystem
[    0.750000] mtd: partition "rootfs_data" created automatically, ofs=4F0000, len=2B0000
[    0.760000] 0x0000004f0000-0x0000007a0000 : "rootfs_data"
[    0.760000] 0x0000007a0000-0x0000007e0000 : "cfg"
[    0.770000] 0x0000007e0000-0x0000007f0000 : "nvram"
[    0.780000] 0x0000007f0000-0x000000ff0000 : "mback"

What is the problem?

Here is my initial MTD partitions setting:

[    0.000000] Kernel command line:  board=LP-WR934X console=ttyS0,115200 mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1024k(kernel),6464k(rootfs),256k(cfg),64k(nvram)ro,8192k(mback)rw,64k(art)ro,7488k@0x50000(firmware) rootfstype=squashfs,jffs2 noinitrd

The problem is solved.

Flash cannot be set as "rw", so change "8192k(mback)rw" to "8192k(mback)ro". here is the booting information:

[    0.000000] Kernel command line:  board=LP-WR934X console=ttyS0,115200

mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env),1024k(kernel),6464k(rootfs),256k(cfg),64k

(nvram)ro,8192k(mback)ro,64k(art)ro,7488k@0x50000(firmware) rootfstype=squashfs,jffs2

noinitrd

...


[    0.700000] 9 cmdlinepart partitions found on MTD device spi0.0
[    0.710000] Creating 9 MTD partitions on "spi0.0":
[    0.710000] 0x000000000000-0x000000040000 : "u-boot"
[    0.720000] 0x000000040000-0x000000050000 : "u-boot-env"
[    0.730000] 0x000000050000-0x000000150000 : "kernel"
[    0.730000] 0x000000150000-0x0000007a0000 : "rootfs"
[    0.740000] mtd: partition "rootfs" set to be root filesystem
[    0.750000] mtd: partition "rootfs_data" created automatically, ofs=4F0000, len=2B0000
[    0.750000] 0x0000004f0000-0x0000007a0000 : "rootfs_data"
[    0.760000] 0x0000007a0000-0x0000007e0000 : "cfg"
[    0.770000] 0x0000007e0000-0x0000007f0000 : "nvram"
[    0.770000] 0x0000007f0000-0x000000ff0000 : "mback"
[    0.780000] 0x000000ff0000-0x000001000000 : "art"
[    0.790000] 0x000000050000-0x0000007a0000 : "firmware"

...

Done!

leaf_ee wrote:

The problem is solved.

Flash cannot be set as "rw", so change "8192k(mback)rw" to "8192k(mback)ro". here is the booting information:

If you want it to be writable, use "8192k(mback)".

The discussion might have continued from here.