UBI "not enough PEBs" sysupgrading Mikrotik RB493G from 19.07.04 -> latest

Christopher Hill ch6574 at gmail.com
Wed Oct 7 18:24:01 EDT 2020


Hi,

I just tried sysupgrading a new head build for a Mikrotik 493G device
(ar71xx 19.07.4 initramfs -> ath79 head) however I get the below "not
enough PEBs" UBI failure and panic:

If I sysupgrade from an earlier git build (e.g.
b7a8a5454226f34256c5d76480dda5abb1308395 ath79 initramfs -> ath79 head)
it works fine, and I see it fixes the PEBs issue

Any thoughts or ideas why flashing from ar71xx to ath79 blows this up? I
ask as this would make migration from 19.07 to 20.xx painful for many.

Thanks,
Chris



19.07.04 sysupgrade log:

root at OpenWrt:/# sysupgrade -F -v
/tmp/openwrt-ath79-mikrotik-mikrotik_routerboard-493g-squashfs-sysupgrade.bin
Invalid sysupgrade file.
Image check failed but --force given - will update anyway!
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 ... odhcpd uhttpd ntpd udhcpc
odhcp6c dnsmasq ubusd urngd logd rpcd netifd
Sending KILL to remaining processes ...
Performing system upgrade...
Unlocking kernel ...
Erasing kernel ...
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x20000
Writing data to block 2 at offset 0x40000
Writing data to block 3 at offset 0x60000
Writing data to block 4 at offset 0x80000
Writing data to block 5 at offset 0xa0000
Writing data to block 6 at offset 0xc0000
Writing data to block 7 at offset 0xe0000
Writing data to block 8 at offset 0x100000
Writing data to block 9 at offset 0x120000
Writing data to block 10 at offset 0x140000
Writing data to block 11 at offset 0x160000
Writing data to block 12 at offset 0x180000
Writing data to block 13 at offset 0x1a0000
Writing data to block 14 at offset 0x1c0000
Writing data to block 15 at offset 0x1e0000
Writing data to block 16 at offset 0x200000
Writing data to block 17 at offset 0x220000
removing ubiblock0_1
[  116.299696] block ubiblock0_1: released
Volume ID 0, size 19 LEBs (2412544 bytes, 2.3 MiB), LEB size 126976
bytes (124.0 KiB), dynamic, name "none", alignment 1
Volume ID 1, size 23 LEBs (2920448 bytes, 2.7 MiB), LEB size 126976
bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 117579776
Volume ID 2, size 926 LEBs (117579776 bytes, 112.1 MiB), LEB size 126976
bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful



Tail of subsequent latest kernel boot log:

[    1.887155] UBI: auto-attach mtd2
[    1.890554] ubi0: attaching mtd2
[    3.037225] ubi0: scanning is finished
[    3.104023] ubi0 error: ubi_read_volume_table: not enough PEBs,
required 970, available 958
[    3.112648] ubi0 error: ubi_attach_mtd_dev: failed to attach mtd2,
error -28
[    3.119770] UBI error: cannot attach mtd2
[    3.124398] /dev/root: Can't open blockdev
[    3.128559] VFS: Cannot open root device "(null)" or
unknown-block(0,0): error -6
[    3.136035] Please append a correct "root=" boot option; here are the
available partitions:
[    3.144384] 1f00             256 mtdblock0
[    3.144387]  (driver?)
[    3.150932] 1f01            8192 mtdblock1
[    3.150934]  (driver?)
[    3.157476] 1f02          122624 mtdblock2
[    3.157478]  (driver?)
[    3.164004] 1f03              64 mtdblock3
[    3.164006]  (driver?)
[    3.170542] 1f04              44 mtdblock4
[    3.170544]  (driver?)
[    3.177070] 1f05               4 mtdblock5
[    3.177072]  (driver?)
[    3.183608] 1f06               4 mtdblock6
[    3.183610]  (driver?)
[    3.190146] 1f07               8 mtdblock7
[    3.190148]  (driver?)
[    3.196674] 1f08               4 mtdblock8
[    3.196676]  (driver?)
[    3.203212] Kernel panic - not syncing: VFS: Unable to mount root fs
on unknown-block(0,0)
[    3.211454] Rebooting in 1 seconds..



Same sections on a good install (where volume 2 now reports different sizes)

removing ubiblock0_1
[ 1438.275670] block ubiblock0_1: released
Volume ID 0, size 19 LEBs (2412544 bytes, 2.3 MiB), LEB size 126976
bytes (124.0 KiB), dynamic, name "none", alignment 1
Volume ID 1, size 23 LEBs (2920448 bytes, 2.7 MiB), LEB size 126976
bytes (124.0 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 113262592
Volume ID 2, size 892 LEBs (113262592 bytes, 108.0 MiB), LEB size 126976
bytes (124.0 KiB), dynamic, name "rootfs_data", alignment 1
[ 1443.243449] UBIFS (ubi0:2): default file-system created
[ 1443.260078] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started,
PID 2341
[ 1443.790864] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2,
name "rootfs_data"
[ 1443.798728] UBIFS (ubi0:2): LEB size: 126976 bytes (124 KiB),
min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 1443.808634] UBIFS (ubi0:2): FS size: 111865856 bytes (106 MiB, 881
LEBs), journal size 5586944 bytes (5 MiB, 44 LEBs)
[ 1443.819240] UBIFS (ubi0:2): reserved for root: 4952683 bytes (4836 KiB)
[ 1443.825859] UBIFS (ubi0:2): media format: w4/r0 (latest is w5/r0),
UUID A2702902-BDC0-4788-9F46-4DABF752DFE6, small LPT model
[ 1443.875223] UBIFS (ubi0:2): un-mount UBI device 0
[ 1443.879994] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" stops
sysupgrade successful


[    1.887155] UBI: auto-attach mtd2
[    1.890554] ubi0: attaching mtd2
[    3.037265] ubi0: scanning is finished
[    3.106483] ubi0: attached mtd2 (name "ubi", size 119 MiB)
[    3.112018] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976
bytes
[    3.118892] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    3.125672] ubi0: VID header offset: 2048 (aligned 2048), data
offset: 4096
[    3.132624] ubi0: good PEBs: 958, bad PEBs: 0, corrupted PEBs: 0
[    3.138625] ubi0: user volume: 3, internal volumes: 1, max. volumes
count: 128
[    3.145840] ubi0: max/mean erase counter: 5/3, WL threshold: 4096,
image sequence number: 1525706785
[    3.154965] ubi0: available PEBs: 0, total reserved PEBs: 958, PEBs
reserved for bad PEB handling: 20
[    3.164282] ubi0: background thread "ubi_bgt0d" started, PID 381
[    3.172265] block ubiblock0_1: created from ubi0:1(rootfs)
[    3.177817] ubiblock: device ubiblock0_1 (rootfs) set to be root
filesystem
[    3.203242] VFS: Mounted root (squashfs filesystem) readonly on
device 254:0.




More information about the openwrt-devel mailing list