SD-card bad blocks on MIKROTIK

Mikrotik hex with built-in SD card slot, OWrt 22.03.0

I tried both:
kmod-sdhci-mt7620 - 5.10.138-1
kmod-sdhci (5.10.138-1)

Getting errors:

e2fsck /dev/mmcblk0p1
e2fsck 1.46.5 (30-Dec-2021)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/mmcblk0p1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Using the same SD-card via USB all works perfectly.

Driver issue?

TNX

  • Does this error apply to your SD card?
  • If so, did you correct it (i.e. change the card from Windows to a Linux ext file system)?

Most cards purchased from a store would get this error until corrected - which is why I'm asking.

@lleachii Obviously filesystem is not the problem, because:

I didn't glean the obviousness from the statement, but cool.

(i.e. the USB SD slot tested could be on a Windows system.)

Ah ok, I thought that @portuquesa connected the USB SD card reader to the very same Mikrotik hex device (which got a USB port as well) and in contrast to using the built-in SD card reader, using the external USB SD card reader worked with the same card.

1 Like

Thanks for your interest, guys ))

  1. Of course I formatted (and partitioned) SD-card (to ext4). BTW, I did it natively, in the router's slot and under OWrt system.

  2. I plugged USB card reader (actually it's a USB modem with SD-card slot) into router's USB port, formatted and partitioned using the same card(s), and all worked. Daniel is right and totally in picture.

  3. If I then insert those formatted cards into the router's slot, errors occur again.

Point is I bought Mikrotik hex exactly because of built-in slot. Would be so sad if it's impossible to use it.
I found some similar cases:
https://forum.openwrt.org/t/kmod-sdhci-mt7620-problem-couldnt-find-valid-filesystem-superblock/22287
Still no solution. I suspect this is OWrt driver problem, as slot works OK with Mikrotik's native OS.

Actually the MMC controller of the MT7621 SoC has long been supported by the upstream Linux driver while in OpenWrt we kept using the downstream legacy driver from MediaTek. This is because the upstream driver doesn't work on older SoCs like MT7620. You could try to build and use the upstream driver on this MT7621 device, and that will most likely improve the microSD situation.

Daniel, you mean to compile from sources? For whole chipset? If so, highly likely it will break something else and may entail number of incompatibilities. OpenWRT provides endless chain of bugs and fixes without need to add some more ))
Although it would be nice experiment, sometimes you need to stop at some point, and start using device, not fixing it. You heard about musicians that are tuning guitar all time, but never play?..

Another thing is particular driver for the reader, but I'm not sure if it's possible at all...