# Key outputs captured during real recovery (some preceding boot logs summarized)

# Original firmware booted from U-Boot using:
# run nandboot

# Bad NAND eraseblocks
[    0.931833] Bad eraseblock 239 at 0x000001de0000
[    0.965614] Bad eraseblock 692 at 0x000005680000
[    0.989104] Bad eraseblock 985 at 0x000007b20000

# OpenWrt initramfs /proc/mtd
mtd0: 00080000 00020000 "u-boot"
mtd1: 00020000 00020000 "u_env"
mtd2: 00020000 00020000 "s_env"
mtd3: 01a00000 00020000 "kernel1"
mtd4: 01700000 00020000 "rootfs1"
mtd5: 01a00000 00020000 "kernel2"
mtd6: 01700000 00020000 "rootfs2"
mtd7: 04a00000 00020000 "syscfg"
mtd8: 00140000 00020000 "unused"

# Linux partition offsets
0x000001c00000-0x000003600000 : "kernel2"
0x000001f00000-0x000003600000 : "rootfs2"

# Probe in original system (first 4 bytes at physical eraseblock starts)
0x01EE0000: 00 00 ...
0x01F00000: 00 00 ...
0x01F20000: 55 42 49 23 (UBI#)
0x01F40000: 55 42 49 23 (UBI#)
0x01F60000: 55 42 49 23 (UBI#)

# Actual successful UBI format
ubiformat: mtd6 (nand), size 24117248 bytes (23.0 MiB), 184 eraseblocks of 131072 bytes (128.0 KiB), min. I/O size 2048 bytes
libscan: scanning eraseblock 183 -- 100 % complete
ubiformat: 35 eraseblocks have valid erase counter, mean value is 0
ubiformat: 148 eraseblocks are supposedly empty
ubiformat: warning!: 1 of 184 eraseblocks contain non-UBI data
ubiformat: warning!: only 35 of 184 eraseblocks have valid erase counter
ubiformat: erase counter 0 will be used for all eraseblocks
ubiformat: flashing eraseblock 33 -- 100 % complete
ubiformat: formatting eraseblock 183 -- 100 % complete

# Actual successful UBI attach
ubi0: attaching mtd6
UBI: EOF marker found, PEBs from 29 will be erased
ubi0: volume 1 ("rootfs_data") re-sized from 9 to 133 LEBs
ubi0: attached mtd6 (name "rootfs2", size 23 MiB)
ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
ubi0: VID header offset: 512 (aligned 512), data offset: 2048
ubi0: good PEBs: 184, bad PEBs: 0, corrupted PEBs: 0
ubi0: user volume: 2, internal volumes: 1, max. volumes count: 128

# Actual ubinfo -a volume summary
Volume ID: 0, Type: dynamic, Name: rootfs, Size: 27 LEBs, State: OK
Volume ID: 1, Type: dynamic, Name: rootfs_data, Size: 133 LEBs, State: OK

# Final successful firmware login
OpenWrt 23.05.6, r24232-539228933c
BusyBox v1.36.1 (2025-08-14 18:27:40 UTC)
root@OpenWrt:/#
