Cannot execute binary file: Exec format error after copying DietPi to eMMC on NanoPi R5C

Hello DietPi community,

I’m trying to copy my DietPi installation from an SD card to the eMMC on my NanoPi R5C following the instructions from this DietPi blog post.

The process seemed to complete without errors, but after rebooting from the eMMC, whenever I try to run a command, I get:

bash: <command>: cannot execute binary file: Exec format error

Here’s what I’ve checked so far:

  • The SD card version works fine.
  • I verified the architecture on the SD card: uname -m returns aarch64 (64-bit ARM).
  • I used dd to copy the SD card to the eMMC, targeting what I believe is the correct eMMC device.

I’m not sure if this is:

  1. Something wrong with the way I copied the SD card to the eMMC.

Could someone advise the correct way to clone DietPi to eMMC on the NanoPi R5C without running into this “exec format” problem?

Any guidance would be greatly appreciated!

Thanks in advance.

this was my solution NanoPi R5S image - #9 by Joulinar

Means it is working now?

Yes but not according the how to on the blog I flashed the image directly on emmc

That blog post is more meant for used instances, where you want to avoid starting from scratch with installing software etc. But it should work, of course.

Did you remove the SD card before trying to boot from eMMC?

Since you obviously did have console access, most commands seem to work fine, systemd, bash itself, and all the libraries and executables involved to bring up the system to that point. I guess all bash internals at least work, so command -v <commen> can be used to check the path of the command that fails with this error. And then that one could be further checked, its ELF headers etc, to see which architecture it has, comparing that to the kernel loaded.

However, seems to be irrelevant now, just in case someone else lands here with a similar issue.