Copy core elec from usb to sdcard

Hi.
I have a mini 2 with a successfull corelec insrallation on a usb drive. Unfortunately my drive is slow and i want to clone core elec to the sdcard class10. Can i do it with core elec ?
I cant install my sdcard on a computer because i dont have any mini sdcard adapter or sdcard usb adapter.

Thanks

Cloning CoreELEC from CoreELEC cannot be done, nor can it be from Android. In short, you need a PC.

What you can do is:

  • Boot CoreELEC from your USB flash
  • Make a backup of CoreELEC on your USB flash
  • Turn off and remove your USB flash
  • Make a new clean installation of CoreELEC on your SD card
  • Start CoreELEC from your SD card
  • Insert your USB flash
  • Restore the backup from your USB flash

Hi thanks.

I have a android phone and a computer. Unfortunately i dont have any sd card reader on my computer. Like sdcard/usb adapter or a minisdcard to sd adapter.
My sdcard is actually non bootable.
Can i use my android phone as a sdcard reader to format the sdcard like with rufus and install openelec?

Why not buy a cheap USB-SD card reader ?

It’s very much possible to write the sd card from CoreELEC.

It does however involve using ssh, and some linux command line stuff that could cause you grief that would be hard to recover from if you make a mistake. So make sure you read the instructions once before doing this, and don’t just blindly copy and paste your way through without reading anything else.

I will use the amlogic-ng nightly build from the December 29th as an example image. be sure to change the img name in the relevant commands below if you use a different build.

1.) ssh into the device.

2.) get the disk image to burn. (Replace the link with the correct one for the image you wish to use)

wget https://relkai.coreelec.org/CoreELEC-Amlogic-ng.arm-9.2-nightly_20191229-Generic.img.gz

3.) decompress the disk image. (replace the file name with the one you just downloaded)

gunzip CoreELEC-Amlogic-ng.arm-9.2-nightly_20191229-Generic.img.gz

4.a) Important!!! Verify that internal emmc does not have the same name as we are expecting the microsd card to have.
ls

ls /dev/mmcblk1

If the output of this command is anything other then
ls: /dev/mmcblk1: No such file or directory
when the microsd card is not inserted then DO NOT CONTINUE with these instructions.

4.b) insert micro sd card.

5.) unmount the micro sd card. (CoreELEC will auto mount removable media, and you can’t burn the image with the device mounted)

umount /dev/mmcblk1p?*

6.) burn the image to micro sd card. (make sure you replace the name of the image if you are using one different then in the example)

dd if=CoreELEC-Amlogic-ng.arm-9.2-nightly_20191229-Generic.img of=/dev/mmcblk1 bs=1M conv=fsync

7.) then just to be sure everything is written and the device doesn’t still have anything waiting in a buffer

sync

8.) copy the dtb file.

CoreELEC should auto mount the filesystem for the newly burned card.

cp /flash/dtb.img /var/media/COREELEC/dtb.img

(note if you are burning this card for a different device or burning a different build of CoreELEC then what you had on the usb drive be sure to copy the correct dtb for that device instead. They can be found in /var/media/COREELEC/device_trees )

9.) unmount the sd card

umount /dev/mmcblk1p?*

10.) power off device. remove usb drive. you can now boot from the micro sd card, just like if you had used a computer to burn the card.

11.) restore backup made of previous usb install on to microsd card install.

3 Likes