How to install from a USB stick to a SD card on Raspberry Pi 5?

  • I do not have access to a machine with an SD card slot other than the raspberry pi itself. So, I want to create a USB stick from which I want to boot the pi and then I want libreelec to install to the SD card. I _think_ this is possible...

    I've gotten the USB stick written, no problem. Then I boot the pi with the stick and the SD card inserted, but when libreelec starts, I do not see any options and it just resizes the file system on the stick. There's got to be an easy way to get to some kind of install-from-live-USB, but I have looked through the forums and have found nothing.

    I see this step:

    After this it libreelec just starts and then resizes the file system, at that point - I think - I'm too far, right?

  • ARM SoC images like RPi5 intentionally have no "installer" function and there's no tooling to create boot media from inside the OS (as there's not really a requirement to do that) but it's possible:

    Code
    cd /storage
    wget https://releases.libreelec.tv/LibreELEC-RPi5.aarch64-12.0.0.img.gz
    umount /dev/mmcblk0p1  <= Unmount existing partitions
    gunzip -c LibreELEC-RPi5.aarch64-12.0.0.img.gz | dd of=/dev/mmcblk0 bs=1M
    umount /dev/mmcblk0p1
    umount /dev/mmcblk0p2
    shutdown

    This sequence ^ assumes the SD card is pre-formatted with a single partition (which is usually the case). LE auto-mounts the default partition(s) so you must unmount them before writing data to the card.

    After running 'shutdown' remove the USB, leave the SD in, and power on again. If all went well it should boot from the card.

  • Well, thanks for the suggestion... In the meantime I had realized (I'm embarrassed to admit how long this took) that I do now have a computer with an SD card slot... namely the Pi. So, what I had done was to install Raspberry Pi OS to the USB stick, boot that on the Pi and use the imager to write LibreElec to the SD card.

    All is well!

    I was also very happy that upon copying my old .kodi folder to the new installation on automatic migration was done: very nice.