Help with installtoemmc

Hi all,

Did a silly thing, tried to run installtoemmc without disabling all my NFS shares so the script tried to copy all those shares to the emmc and it became full.

Tried again, but it not working, getting the following…

 CoreELEC:~ # installtoemmc
This script will now erase the eMMC on your device
All data on this eMMC will be lost forever!

Type "yes" if you know what you are doing or anything else to exit: yes
Disabling eMMC timeout...
Stopping Kodi...
Unmount all partitions from mmcblk0...
Delete all partitions...
1+0 records in
1+0 records out
512 bytes (512B) copied, 0.005747 seconds, 87.0KB/s
Create new partitions...
Flash Bootloader...
Create Filesystem for new flash partition...
Create Filesystem for new storage partition...
/dev/mmcblk0p2 contains a ext4 file system labelled 'STORAGE'
        last mounted on /var/media/NEWSTORAGE on Thu May 16 15:20:20 2019
/dev/mmcblk0p2 is mounted; will not make a filesystem here!
Unmount all partitions from mmcblk0...
Mount new partitions...
Copy /flash files to new flash partition...
Copy template boot.ini...
Set UUIDs in new boot.ini...
Not enough space on the new storage partition. Skipping...
Unmount all partitions from mmcblk0...
umount: can't unmount /var/media/NEWBOOT: Invalid argument
umount: can't unmount /var/media/COREELEC: Invalid argument
umount: can't unmount /var/media/NEWSTORAGE: Invalid argument
umount: can't unmount /var/media/STORAGE: Invalid argument
All done! Please poweroff your device and remove the SD/USB.
CoreELEC:~ #

Any help appreciated.



Try this then reboot and run installtoemmc again

dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=1

Just to confirm the steps:

  1. Boot from SD with emmc not installed.
  2. Run installtoemmc and answer yes to reboot with the 30 sec delay.
  3. Reboot and during the 30 sec delay install the emmc.
  4. Run your command.
  5. Run installtoemmc to restart the transfer process.

Will have to fixup the script

In an effort to get this working I did the following:

mount /dev/mmcblk0p2 /var/media/NEWSTORAGE
cd movies  *(this is the share that filled up the emmc)*
rm *
umount /var/media/NEWSTORAGE

This completed with no errors so I removed the SD and the emmc is now booting.

is it mandatory (and why?) to remove emmc card before running installtoemmc script? I am asking that beacuse without removing emmc card I have got a bunch of errors while installtoemmc (cannot exactly remember … It was something about “umount: can’t unmount” …)
But I was able to run coreelec from emmc card after reboot just fine.

In case when I removed emmc card and attached it in “30 seconds window” then the script has showed no errors.

You have to remove the eMMC because the CPU will try to boot from the eMMC before the SD-card and if it has ever had any other OS on it then it can causes issues.

If you have the eMMC uSD adapter then you can use that instead of using installtoemmc to burn CE to your eMMC.

1 Like

I have one silly question regarding formatting existing emmc card. I have booted from SD card, and run command

dd if=/dev/zero of=/dev/mmcblk0 bs=512 count=1

and I have noticed that STORAGE partition remained intact.
How to “nuke” everything on emmc card and reformat it while running coreelec from SD card?