BPI-M5 How to format emmc with lost password

Hello !

It’s been quite a time I have my BPI M5 and took one for my dad to setup a pihole server. With time and many changes his was not running for quite a time and when we wanted to put it back in service, we lost the root password (and other users too).

I tried to start with a freshly made SD card and I can’t boot on it. I searched on the forum if people had similar issues but none of the solutions I’ve found suit my problem.

How do I wipe my emmc without any cli access ?

Thanks for your help !

which image flashed on emmc? and which image try to boot from sdcard?

Hi ! There is an Ubunutu 20 on the eMMC installed using the BPI procedure.

On the SDCard and USB key, I have a Raspberry OS.

Try to flash ubuntu image to the sdcard, if nothing else, the board will bootup from sdcard and then you can erase the emmc or maybe try the following method to change the password of emmc system.

  1. after bootup from sd, mount emmc root partition /dev/mmcblk0p2 to /mnt
  2. open /mnt/etc/shadow file and look down the line of your user name. It should look like this. pi:$6$5e6upFQZunpdxxHH$DSodEfInqHSQDmTxa79VOKBeG2/ZfXPlaaDs.O38I3hudPWZ7Qnbfm2rj27v7KYbaFjsfM5xgIRg/OFG789Vh.:18607:0:99999:7:::
  3. replace the contents between the first and second colon with this string, $6$5e6upFQZunpdxxHH$DSodEfInqHSQDmTxa79VOKBeG2/ZfXPlaaDs.O38I3hudPWZ7Qnbfm2rj27v7KYbaFjsfM5xgIRg/OFG789Vh.
  4. save the shadow file.
  5. you should now shutdown the board, remove sdcard, bootup from emmc and login with password bananapi

After flashing the BPI Ubuntu on the SD card I could wipe my drive. I guess the raspberry OS is just not compatible ?

raspberry OS image is a third part image, it’s not compatible for booting from sdcard if emmc is not empty.

Once I formated the eMMC, no more partition or data on it. it refuse to boot on the RPI os. I wanted to try this since BPI documentation is a pain to make GPIO pins work …

Thanks for your help !

RPI os for bananapi is just a RPI GUI rootfs, almost of the hardware related RPI things are not work on it.