UniElec U7623-06 fixing eMMC partition layout / partition table

Hi,
I've bought a new router UniElec U7623-06 (512MB RAM, 8GM eMMC)
When I got it was already after some reconfigurations?! and successful/unsuccessful? firmware updates. I've been told that partitions were deleted from eMMC (/dev/mmcblk0) but I am not quite sure about this

I have upgraded it with the latest stable OpenWrt 19.07.4 (*bin.gz copied via SCP and then sysupgraded)
It seems the router is running normally, but:

  1. fdisk shows no partitions on /dev/mmcblk0

  2. /proc/partitions shows /dev/mmcblk0p1 /dev/mmcblk0p1 /dev/mmcblk0boot0 /dev/mmcblk0boot1

  3. dmesg reports errors (see below in the next few posts)

My initial objective was to be able to extend disk space for installing software.
I have updated this post and changed the objective to fixing partition layout.

root@OpenWrt:~# mount
/dev/root on /rom type squashfs (ro,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev,noatime)
/dev/loop0 on /overlay type f2fs (rw,lazytime,noatime,background_gc=on,no_heap,user_xattr,inline_xattr,inline_data,inline_dentry,flush_merge,extent_cache,mode=adaptive,active_logs=6)
overlayfs:/overlay on / type overlay (rw,noatime,lowerdir=/,upperdir=/overlay/upper,workdir=/overlay/work)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,size=512k,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,mode=600,ptmxmode=000)
debugfs on /sys/kernel/debug type debugfs (rw,noatime)

root@OpenWrt:~# block detect
config 'global'
        option  anon_swap       '0'
        option  anon_mount      '0'
        option  auto_swap       '1'
        option  auto_mount      '1'
        option  delay_root      '5'
        option  check_fs        '0'

config 'mount'
        option  target  '/overlay'
        option  uuid    'f18101b2-5583-4bd7-b2f4-f969990683d5'
        option  enabled '0'

config 'mount'
        option  target  '/mnt/mmcblk0p1'
        option  uuid    '7722-66FB'
        option  enabled '0'

config 'mount'
        option  target  '/rom'
        option  uuid    '755ab79c-32c0573c-e99138d4-4a77c21b'
        option  enabled '0'

Regards
Sebastian

I don't know any specifications about this device. But my Zyxel NBG6819 has 4GB MMC also. OpenWrt is using only a small portion of it. This is done for several reasons. Most important here is to assure you can revert back to stock firmware at any time.

To use the remaining space it should be possible to configure remaining partitions as an extroot.

As I cannot find your device specifications for reference (to get an idea; seek for flash layout):

To see what is available on your device you can issue the following commands:

cat /proc/partitions
cat /proc/mtd

Thanks,
I will keep digging. I the mean time I post the output for the commands you listed.


root@OpenWrt:~# cat /proc/partitions
major minor  #blocks  name

   7        0     259328 loop0
 179        0    7634944 mmcblk0
 179        1       3072 mmcblk0p1
 179        2     262144 mmcblk0p2
 179       16       4096 mmcblk0boot1
 179        8       4096 mmcblk0boot0

root@OpenWrt:~# cat /proc/mtd
dev:    size   erasesize  name
[empty]
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.14.195 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11208-ce6496d796)) #0 SMP PREEMPT Sun Sep 6 16:19:39 2020
[    0.000000] CPU: ARMv7 Processor [410fc073] revision 3 (ARMv7), cr=10c5387d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: UniElec U7623-02 eMMC (512M RAM)
[    0.000000] Memory policy: Data cache writealloc
[    0.000000] On node 0 totalpages: 131072
[    0.000000] free_area_init_node: node 0, pgdat c0929f40, node_mem_map dfbf9000
[    0.000000]   Normal zone: 1024 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 131072 pages, LIFO batch:31
[    0.000000] random: get_random_bytes called from 0xc08008d4 with crng_init=0
[    0.000000] percpu: Embedded 15 pages/cpu s29964 r8192 d23284 u61440
[    0.000000] pcpu-alloc: s29964 r8192 d23284 u61440 alloc=15*4096
[    0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs console=ttyS0,115200 blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)
[    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Memory: 510796K/524288K available (6144K kernel code, 170K rwdata, 816K rodata, 1024K init, 238K bss, 13492K reserved, 0K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0xc0008000 - 0xc0700000   (7136 kB)
[    0.000000]       .init : 0xc0800000 - 0xc0900000   (1024 kB)
[    0.000000]       .data : 0xc0900000 - 0xc092a840   ( 171 kB)
[    0.000000]        .bss : 0xc092f7b4 - 0xc096afd8   ( 239 kB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] arch_timer: cp15 timer(s) running at 13.00MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x2ff89eacb, max_idle_ns: 440795202429 ns
[    0.000006] sched_clock: 56 bits at 13MHz, resolution 76ns, wraps every 4398046511101ns
[    0.000017] Switching to timer-based delay loop, resolution 76ns
[    0.000141] clocksource: timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 147020034397 ns
[    0.000157] sched_clock: 32 bits at 13MHz, resolution 76ns, wraps every 165191050201ns
[    0.000368] Calibrating delay loop (skipped), value calculated using timer frequency.. 26.00 BogoMIPS (lpj=130000)
[    0.000384] pid_max: default: 32768 minimum: 301
[    0.000495] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000508] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000943] CPU: Testing write buffer coherency: ok
[    0.040025] Setting up static identity map for 0x80100000 - 0x80100060
[    0.060020] Hierarchical SRCU implementation.
[    0.100090] smp: Bringing up secondary CPUs ...
[    0.310560] smp: Brought up 1 node, 4 CPUs
[    0.310576] SMP: Total of 4 processors activated (104.00 BogoMIPS).
[    0.310583] CPU: All CPU(s) started in SVC mode.
[    0.315472] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 3
[    0.315745] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.315767] futex hash table entries: 1024 (order: 4, 65536 bytes)
[    0.315918] pinctrl core: initialized pinctrl subsystem
[    0.316648] NET: Registered protocol family 16
[    0.316884] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.317566] No ATAGs?
[    0.379190] usbcore: registered new interface driver usbfs
[    0.379246] usbcore: registered new interface driver hub
[    0.379318] usbcore: registered new device driver usb
[    0.380501] clocksource: Switched to clocksource arch_sys_counter
[    0.381610] NET: Registered protocol family 2
[    0.382332] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
[    0.382380] TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
[    0.382441] TCP: Hash tables configured (established 4096 bind 4096)
[    0.382533] UDP hash table entries: 256 (order: 1, 8192 bytes)
[    0.382564] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
[    0.382731] NET: Registered protocol family 1
[    0.382765] PCI: CLS 0 bytes, default 64
[    0.383764] No memory allocated for crashlog
[    0.383927] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.387325] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.387338] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.391901] io scheduler noop registered
[    0.391918] io scheduler deadline registered (default)
[    1.400515] mtk-scpsys 10006000.scpsys: Failed to power on domain mfg
[    1.400983] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.403285] console [ttyS0] disabled
[    1.423510] 11004000.serial: ttyS0 at MMIO 0x11004000 (irq = 193, base_baud = 1625000) is a ST16650V2
[    1.896991] console [ttyS0] enabled
[    1.901029] mtk_rng 1020f000.rng: registered RNG driver
[    1.901178] random: fast init done
[    1.909779] random: crng init done
[    1.909931] loop: module loaded
[    1.917023] mt6323-regulator mt6323-regulator: Chip ID = 0x2023
[    1.931833] libphy: Fixed MDIO Bus: probed
[    1.936100] mt7530 3.switch: MT7530 adapts as multi-chip module
[    1.965143] mtk_soc_eth 1b100000.ethernet: chip id = 7623
[    1.970754] libphy: mdio: probed
[    1.974450] drivers/net/ethernet/mediatek/mtk_eth_soc.c:mtk_mdio_init[412]0 dec1e400
[    1.982218] mtk_soc_eth 1b100000.ethernet: generated random MAC address c2:36:1f:7e:f6:d3
[    1.990767] mtk_soc_eth 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    2.001483] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xe08e0000, irq 198
[    2.010868] xhci-mtk 1a1c0000.usb: xHCI Host Controller
[    2.016096] xhci-mtk 1a1c0000.usb: new USB bus registered, assigned bus number 1
[    2.026580] xhci-mtk 1a1c0000.usb: hcc params 0x01401198 hci version 0x96 quirks 0x0000000000210010
[    2.035648] xhci-mtk 1a1c0000.usb: irq 197, io mem 0x1a1c0000
[    2.041961] hub 1-0:1.0: USB hub found
[    2.045718] hub 1-0:1.0: 1 port detected
[    2.049944] xhci-mtk 1a1c0000.usb: xHCI Host Controller
[    2.055172] xhci-mtk 1a1c0000.usb: new USB bus registered, assigned bus number 2
[    2.062547] xhci-mtk 1a1c0000.usb: Host supports USB 3.0  SuperSpeed
[    2.068922] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.077436] hub 2-0:1.0: USB hub found
[    2.081213] hub 2-0:1.0: 1 port detected
[    2.085563] i2c /dev entries driver
[    2.089488] mtk-thermal 1100b000.thermal: Device not calibrated, using default calibration values
[    2.099107] mtk-wdt 10007000.watchdog: Watchdog enabled (timeout=31 sec, nowayout=0)
[    2.107244] cpu cpu0: dummy supplies not allowed for exclusive requests
[    2.114771] sdhci: Secure Digital Host Controller Interface driver
[    2.120942] sdhci: Copyright(c) Pierre Ossman
[    2.180700] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.191552] NET: Registered protocol family 10
[    2.197171] Segment Routing with IPv6
[    2.201081] NET: Registered protocol family 17
[    2.205611] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    2.219766] 8021q: 802.1Q VLAN Support v1.8
[    2.226042] ThumbEE CPU extension supported.
[    2.230305] Registering SWP/SWPB emulation handler
[    2.266583] mmc0: new high speed MMC card at address 0001
[    2.272371] mmcblk0: mmc0:0001 008G70 7.28 GiB
[    2.277071] mmcblk0boot0: mmc0:0001 008G70 partition 1 4.00 MiB
[    2.283228] mmcblk0boot1: mmc0:0001 008G70 partition 2 4.00 MiB
[    2.289297] mmcblk0rpmb: mmc0:0001 008G70 partition 3 4.00 MiB, chardev (250:0)
[    2.297119]  mmcblk0: p1(recovery) p2(root)
[    2.347556] mtk-pcie 1a140000.pcie: Port1 link down
[    2.455477] mtk-pcie 1a140000.pcie: Port2 link down
[    2.460478] mtk-pcie 1a140000.pcie: PCI host bridge to bus 0000:00
[    2.466640] pci_bus 0000:00: root bus resource [io  0x0000-0xffff] (bus address [0x1a160000-0x1a16ffff])
[    2.476057] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    2.482889] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.488353] PCI: bus0: Fast back to back transfers enabled
[    2.493975] mt7530 3.switch: MT7530 adapts as multi-chip module
[    2.500038] DSA: switch 0 0 parsed
[    2.503449] DSA: tree 0 parsed
[    2.514384] libphy: dsa slave smi: probed
[    2.518593] Generic PHY dsa-0.0:00: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:00, irq=POLL)
[    2.529155] Generic PHY dsa-0.0:01: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:01, irq=POLL)
[    2.539647] Generic PHY dsa-0.0:02: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:02, irq=POLL)
[    2.550144] Generic PHY dsa-0.0:03: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:03, irq=POLL)
[    2.560661] Generic PHY dsa-0.0:04: attached PHY driver [Generic PHY] (mii_bus:phy_addr=dsa-0.0:04, irq=POLL)
[    2.574737] hctosys: unable to open rtc device (rtc0)
[    2.579861] clk: Not disabling unused clocks
[    2.584188] ------------[ cut here ]------------
[    2.588769] WARNING: CPU: 0 PID: 74 at drivers/clk/clk.c:606 0xc03c5100
[    2.590587] vusb: disabling
[    2.595327] Modules linked in:
[    2.598099] vmc: disabling
[    2.601115] CPU: 0 PID: 74 Comm: kworker/0:2 Not tainted 4.14.195 #0
[    2.601118] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    2.601130] Workqueue: pm 0xc040c21c
[    2.603812] vmch: disabling
[    2.615635] vgp1: disabling
[    2.619162] Function entered at [<c010e824>] from [<c010a89c>]
[    2.621948] vcamaf: disabling
[    2.624678] Function entered at [<c010a89c>] from [<c06025c8>]
[    2.639173] Function entered at [<c06025c8>] from [<c011d938>]
[    2.639177] Function entered at [<c011d938>] from [<c011da04>]
[    2.639180] Function entered at [<c011da04>] from [<c03c5100>]
[    2.639187] Function entered at [<c03c5100>] from [<c03cf8dc>]
[    2.662212] Function entered at [<c03cf8dc>] from [<c040bb7c>]
[    2.667995] Function entered at [<c040bb7c>] from [<c040c248>]
[    2.673777] Function entered at [<c040c248>] from [<c0134354>]
[    2.679559] Function entered at [<c0134354>] from [<c0134804>]
[    2.685341] Function entered at [<c0134804>] from [<c0139fd4>]
[    2.691122] Function entered at [<c0139fd4>] from [<c01075e8>]
[    2.696905] ---[ end trace 5cfd2da3f366d12c ]---
[    2.701503] ------------[ cut here ]------------
[    2.706086] WARNING: CPU: 0 PID: 74 at drivers/clk/clk.c:488 0xc03c5718
[    2.712667] Modules linked in:
[    2.715698] CPU: 0 PID: 74 Comm: kworker/0:2 Tainted: G        W       4.14.195 #0
[    2.723202] Hardware name: Mediatek Cortex-A7 (Device Tree)
[    2.728728] Workqueue: pm 0xc040c21c
[    2.732274] Function entered at [<c010e824>] from [<c010a89c>]
[    2.738055] Function entered at [<c010a89c>] from [<c06025c8>]
[    2.743836] Function entered at [<c06025c8>] from [<c011d938>]
[    2.749618] Function entered at [<c011d938>] from [<c011da04>]
[    2.755398] Function entered at [<c011da04>] from [<c03c5718>]
[    2.761179] Function entered at [<c03c5718>] from [<c03cf8e4>]
[    2.766960] Function entered at [<c03cf8e4>] from [<c040bb7c>]
[    2.772741] Function entered at [<c040bb7c>] from [<c040c248>]
[    2.778522] Function entered at [<c040c248>] from [<c0134354>]
[    2.784302] Function entered at [<c0134354>] from [<c0134804>]
[    2.790083] Function entered at [<c0134804>] from [<c0139fd4>]
[    2.795863] Function entered at [<c0139fd4>] from [<c01075e8>]
[    2.801661] ---[ end trace 5cfd2da3f366d12d ]---
[    2.809226] VFS: Mounted root (squashfs filesystem) readonly on device 179:2.
[    2.817259] Freeing unused kernel memory: 1024K
[    2.986885] init: Console is alive
[    2.991057] init: - watchdog -
[    3.220563] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.261658] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    3.271189] init: - preinit -
[    3.559606] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.566809] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock
[    3.575556] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.582742] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 2th superblock
[    3.590356] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.597629] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock
[    3.605248] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.612431] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 2th superblock
[    3.915866] device eth0 entered promiscuous mode
[    3.921332] IPv6: ADDRCONF(NETDEV_UP): lan1: link is not ready
[    4.970834] mt7530 3.switch lan1: Link is Down
[    7.369447] F2FS-fs (loop0): Mounted with checkpoint version = 8f5dc99
[    7.376861] mount_root: loading kmods from internal overlay
[    7.389018] kmodloader: loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[    7.397715] kmodloader: done loading kernel modules from /tmp/overlay/upper/etc/modules-boot.d/*
[    7.552185] block: attempting to load /etc/config/fstab
[    7.557492] block: unable to load configuration (fstab: Entry not found)
[    7.564249] block: no usable configuration
[    7.569083] mount_root: switching to f2fs overlay
[    7.585911] insmod: module is already loaded - nls_cp437
[    7.593588] insmod: module is already loaded - nls_iso8859-1
[    7.601665] insmod: module is already loaded - fat
[    7.608756] insmod: module is already loaded - vfat
[    7.622560] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    7.693082] urandom-seed: Seeding with /etc/urandom.seed
[    7.729383] device eth0 left promiscuous mode
[    7.738328] procd: - early -
[    7.741295] procd: - watchdog -
[    8.372676] procd: - watchdog -
[    8.376587] procd: - ubus -
[    8.537480] procd: - init -
[    8.792914] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.802964] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    8.812065] Loading modules backported from Linux version v4.19.137-0-gc076c79e03c6
[    8.814503] urngd: v1.0.2 started.
[    8.819669] Backport generated by backports.git v4.19.137-1-0-g60c3a249
[    8.830973] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.839763] nf_conntrack version 0.5.0 (8192 buckets, 32768 max)
[    8.867179] xt_time: kernel timezone is -0000
[    8.898025] PPP generic driver version 2.4.2
[    8.903140] NET: Registered protocol family 24
[    8.908958] kmodloader: done loading kernel modules from /etc/modules.d/*
[   11.998258] device eth0 entered promiscuous mode
[   12.004197] br-lan: port 1(lan0) entered blocking state
[   12.009404] br-lan: port 1(lan0) entered disabled state
[   12.015424] device lan0 entered promiscuous mode
[   12.022333] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   12.034099] br-lan: port 2(lan1) entered blocking state
[   12.039358] br-lan: port 2(lan1) entered disabled state
[   12.045420] device lan1 entered promiscuous mode
[   12.054254] br-lan: port 3(lan2) entered blocking state
[   12.059523] br-lan: port 3(lan2) entered disabled state
[   12.065913] device lan2 entered promiscuous mode
[   12.074074] br-lan: port 4(lan3) entered blocking state
[   12.079338] br-lan: port 4(lan3) entered disabled state
[   12.086108] device lan3 entered promiscuous mode
[   12.097788] IPv6: ADDRCONF(NETDEV_UP): wan: link is not ready
[   13.051165] mt7530 3.switch lan0: Link is Down
[   13.131332] mt7530 3.switch wan: Link is Down
[   13.132937] mt7530 3.switch lan3: Link is Down
[   13.133087] mt7530 3.switch lan2: Link is Down
[   16.171054] br-lan: port 1(lan0) entered blocking state
[   16.176248] br-lan: port 1(lan0) entered forwarding state
[   16.181858] mt7530 3.switch lan0: Link is Up - 1Gbps/Full - flow control off
[   16.183123] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   16.251300] IPv6: ADDRCONF(NETDEV_CHANGE): wan: link becomes ready
[   16.257766] mt7530 3.switch wan: Link is Up - 1Gbps/Full - flow control rx/tx
root@OpenWrt:/dev#

root@OpenWrt:/dev# dmesg |grep mmc
[    0.000000] Kernel command line: root=/dev/mmcblk0p2 rootfstype=squashfs,f2fs console=ttyS0,115200 blkdevparts=mmcblk0:3M@6M(recovery),256M@9M(root)
[    2.266583] mmc0: new high speed MMC card at address 0001
[    2.272371] mmcblk0: mmc0:0001 008G70 7.28 GiB
[    2.277071] mmcblk0boot0: mmc0:0001 008G70 partition 1 4.00 MiB
[    2.283228] mmcblk0boot1: mmc0:0001 008G70 partition 2 4.00 MiB
[    2.289297] mmcblk0rpmb: mmc0:0001 008G70 partition 3 4.00 MiB, chardev (250:0)
[    2.297119]  mmcblk0: p1(recovery) p2(root)
[    3.559606] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.566809] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock
[    3.575556] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.582742] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 2th superblock
[    3.590356] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.597629] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock
[    3.605248] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
[    3.612431] F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 2th superblock
[    7.622560] F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
root@OpenWrt:/dev#

This is not looking good. To repair this (if possible) you would need at least the partition layout of the device and probably a copy of some operation relevant partitions.

I don't own this device nor do I have enough knowledge to guide you through such a process. So you have to wait for a more competent user here.

The only thing what I could recommend is to make a tftp recover if the manufacturer is providing this for this device. But try this as a last resort for the moment.

I have updated the title and issue description

I was trying to recreate the mmc partitions based on the kernel command line and the offsets but It did not changed anything

root@OpenWrt:/proc# fdisk -l
Disk /dev/loop0: 253.26 MiB, 265551872 bytes, 518656 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0: 7.29 GiB, 7818182656 bytes, 15269888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00001d52

Device         Boot Start    End Sectors  Size Id Type
/dev/mmcblk0p1      12288  18431    6144    3M  b W95 FAT32
/dev/mmcblk0p2      18432 542719  524288  256M 83 Linux


Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
root@OpenWrt:/proc#

Well I'm not a pro if comes to embedded devices. But I'm pretty sure that you cannot change partition layout within OpenWrt like on a computer.

You have to work within a live system. So OS initramfs image has to be loaded into RAM (via serial console). And if I remember correct OpenWrt is locking writing partitions by default.

In general you do not edit partitions directly on those flash based devices (here mmc). For Linux there is an overlay driver/kernel module managing flash devices (mtd) which is presenting it partitions as a block device to the OS. So editing mmc is basically doing nothing. So you have to have build an OpenWrt image where write protection is disabled (kmod-mtd-rw).

I cannot give you more advises. There are only a few persons on this forum I know who have that knowledge and could give you some basic advises how you could recover. @slh @hnyman Sorry for pinging. :smiley:

But I don't want to make you hopes. It is very difficult to give advises if you don't have the device itself to look into. So it might be that others cannot or don't want to give any advise either (it is time consuming). In any case it will be a long way to get back a working device if even possible.

1 Like

Thanks again for your answer and time spent on this.
I am very grateful for this.

I talked with previous owner, trying to investigate what exactly was done on the device. More or less the actions were as follow:

  1. The original OpenWrt version was 18.XX (exact number unknown)
  2. Installed latest 19.04.7 downloaded from stable repository, via www GUI
  3. Refresh package list and update all pending updates
  4. Follow an article for a different router to enable eMMC:
    How to Install OpenWrt 18.06 on Onion Omega2 Pro
  5. There is a step to: fdisk /dev/mmcblk0 and create partitions, with an additional note "You may need to delete existing partitions with d command."
  6. I have copied this from the article:
opkg update
opkg install block-mount e2fsprogs fdisk kmod-fs-ext4 tar
fdisk /dev/mmcblk0

Here, delete partitions
Create new partition

mkfs.ext4 /dev/mmcblk0p1
block detect >/etc/config/fstab
uci set fstab.@mount[0].target=/overlay
uci set fstab.@mount[0].enabled=1
uci commit
mkdir /tmp/overlay
mount /dev/mmcblk0p1 /tmp/overlay
tar -C /overlay -cvf - . | tar -C /tmp/overlay -xf -

reboot

The last tar command was reporting some errors about missing disk space
After some time they installed a initramfs firmware, noticed that it is not possible to upgrade the firmware anymore via GUI and leave it that way.

I took over from here, installed 7623a-unielec-u7623-02-emmc-512m-squashfs-sysupgrade-emmc.bin.gz, the rest of the story was described in previous posts.

It might be very silly and naive but what you wrote makes me wonder, (assuming the actions taken were really the only that were taken).
If all that was done was deleting the partitions with fdisk on openWrt (not initramfs) installed, then the errors I see in dmesg could be not related to partition delete, but something else.
Maybe upgrading from initially installed openWrt to the recent version... or this router is not fully compatible with stable openWrt (the version installed by the vendor could be some modified one) or even the errors were there from the beginning?

My knowledge about this stuff is very limited.

F2FS-fs (mmcblk0p1): Magic Mismatch, valid(0xf2f52010) - read(0x0)
F2FS-fs (mmcblk0p1): Can't find valid F2FS filesystem in 1th superblock

How bad are these errors?
The router seems to operate normally, is it really bad?

As I wrote: I'm not an expert and ofc each device is different. I just gave you my knowledge as input. :smiley:

But I've searched for you:

MTD subsystem does not deal with block devices like MMC, eMMC, SD, CompactFlash, etc. These devices are not raw flashes but they have a Flash Translation layer inside, which makes them look like block devices. These devices are the subject of the Linux block subsystem, not MTD. Please, refer to this FAQ section for a short list of the main differences between block and MTD devices. And the raw flash vs. FTL devices UBIFS section discusses this in more details.

As my zyxel has SPI-NOR MTD applies here. But for your device it does not. So you have probably sth. like an SD-card in/on your device. I don't know. :wink:

I have no clue how severe this issues are. I would expect trouble if you do something like a sysupgrade. But I might be wrong. There are f2fs tools you could install and format the FAT partition (I would not do it without any advise!).

1 Like

Different router, different topic, but similar messages in kernel log:

1 Like