OrangePi PC Plus - install/copy to emmc?

Hi,

I’m using OrangePi PC Plus with DietPi 144 (base plus Squeezebox server and squeezelite), and everything runs just fine from SD card, no troubles at all :slight_smile:
However, I would like to move everything to emmc and remove the SD card completely…
The instructons for OrangePi Plus don’t work - when using “blkid”, I don’t see /dev/mmcblk1 at all, just /dev/mmcblk0p1 (and /dev/mmcblk0p2).

So, what I’ve done is make an image of my “live” SD card system (e.g. “working.img”), put it on an external USB flash dongle, booted armbian from another SD card, and did a “dd” copy of the image stored on the external USB to /dev/mmcblk1 - which worked OK, the image was copied to emmc (/dev/mmcblk1), since armibian sees the emmc just fine, under /dev/mmcblk1(xxx)
But, when I remove the SD card, the OrangePi won’t boot from emmc and the copied DietPi image. I also set the “boot” partition as bootable - that didn’t change anything, still no go…

Emmc is working, previously I could boot the Chinese Android that came with it - and the armbian can see it and mount the DietPi partitions on it when I boot armbian from the SD card.

Perhaps there is something I need to change in the config - what puzzles me is that with DietPi I could not see the /dev/mmcblk1 at all, just the SD card (/dev/mmcblk0p1 and /dev/mmcblk0p2…) - therefore the trick with the armbian SD card, which I used to copy my working DietPi image to emmc…

Anything I could do to solve this?

TIA,
Denis

Hi Denis,

Please try this method, should work fine “Install DietPi on the eMMC (you must have DietPi up and running on a SDcard prior to this):”: EDIT: REMOVED OBSOLETE LINK

On reboot, no SD should be detected and mmc1 will change to mmc0. If not, let me know and i’ll test it on mine.

Hi,

Thanks for the info.

Let me run a test here on my OPi plus just to confirm no issues our end: DietPi Community Forum - Welcome to the DietPi OS Community Forum

Also, if you run the ARMbian image again, please can you check the kernel version so we can compare (may be a bug related to kernel version)?

uname -a

My Armbian image kernel version:

Linux orangepipcplus 3.4.112-sun8i #14 SMP PREEMPT Wed Sep 14 20:29:31 CEST 2016 armv7l GNU/Linux

and the DietPi image is:

Linux OPi 3.4.113-sun8i #10 SMP PREEMPT Thu Feb 23 19:55:00 CET 2017 armv7l GNU/Linux
  • if that is of any help…

The dietpi image blkid command gives:

root@OPi:~# blkid
/dev/mmcblk0: PTUUID="0000b6e5" PTTYPE="dos"
/dev/mmcblk0p1: SEC_TYPE="msdos" LABEL="BOOT" UUID="CB13-72D2" TYPE="vfat" PARTUUID="0000b6e5-01"
/dev/mmcblk0p2: UUID="7175cdfb-fb8c-4533-8090-a22948e645ac" TYPE="ext4" PARTUUID="0000b6e5-02"
root@OPi:~#
  • and that is obviously just the inserted SD card with the DietPi installed…

When I insert the SD card with Armbian (desktop version), blkid gives me the following:

root@orangepipcplus:/home/dpleic# blkid
/dev/mmcblk0p1: UUID="d52b4ff7-0d71-49d6-ace5-6993806629a7" TYPE="ext4" PARTUUID="3807645c-01"
/dev/mmcblk1p1: UUID="1e4e467f-213d-420a-a15f-e565ab745ed6" TYPE="ext4" PARTUUID="4ce465f2-01"
/dev/mmcblk0: PTUUID="3807645c" PTTYPE="dos"
/dev/mmcblk1: PTUUID="4ce465f2" PTTYPE="dos"
root@orangepipcplus:/home/dpleic#

It is obvious that it sees both the mmcblk0 (SD card from which it booted Armbian desktop) and mmcblk1 (the emmc memory, where I managed to install armbian server version with the same kernel as listed above under “armbian”).

So, it’s obvious that Armbian desktop version has normal access to emmc…

I ran a test here, all working fine on my board (revision v1.1):

The only thing I believe it could be:

  • ARMbian 5.25 (kernel 3.4.113) current, breaks EMMC detection on your board. Nothing we can do about that. I believe if you run apt-get update and apt-get dist-upgrade on the ARMbian image, issue should re-occur once 5.25 is installed via their repo (which we use).

You could try (if its disabling EMMC when SD is plugged in):

  • Load up ARMbian with lower version on SD
  • Write to EMMC as per: EDIT: REMOVED OBSOLETE LINK

Thanks for your efforts, Daniel…

One thing I noticed - on the Github issues, you marked this topic as “Opi Plus”. I have an OPi PC Plus - so i’ts not exactly the same board (although DietPi installs and runs quite nice, thank you… :slight_smile:

Also, I’ve successfully installed Armbian 5.25 (server version, no desktop) to emmc, using the armbian “nand-sata-install” script: the script offered me the option to “boot from emmc, run from emmc” (or something like that), and I chose that and started the emmc copy.
After a while, the script installed the system to emmc, I shut the system down, took out the SD card, and booted from emmc without any issues.
BTW, kernel for that Armbian server (5.25) I have is:

root@orangepipcplus:~# uname -a
Linux orangepipcplus 3.4.113-sun8i #10 SMP PREEMPT Thu Feb 23 19:55:00 CET 2017 armv7l GNU/Linux

So, I somehow suspect that it’s not the kernel issue… since this arbian version uses the same kernel.

As for your final suggestion, that is exactly what I did: I used armbian SD image to boot the Opi PC Plus, and copied the DietPi image (which I had copied on an external USB flash) to the emmc. The copy went without any issues, but when I took out the Armbian SD card, and tried to boot from emmc, no dice… - although the complete (working) DietPi image was copied to emmc (using “dd”) :frowning:
I also marked the boot partition as bootable, just in case (using gparted in armbian desktop booted from SD card), but that didn’t help, either…

Solved thans to Daniel (Fourdee)!

Just for future reference, here’s the solution (a different ‘script.bin’ is required):
https://github.com/MichaIng/DietPi/issues/823

Now, another question:

The above solution works for installing to emmc from scratch (“fresh” downloaded DietPi image).
Would it be possible to “clone” the existing DietPi system which is already installed and set up on the SD card?

Explanation:
I have a system installed on SD card, with everything I need, with lots of additions and custom installs, etc… which works the way I want.

Now, instead of redoing and reinstalling everything from scratch on a “virgin” (new) DietPi install to the emmc, would it be possible to just “clone” everything from root partition on the SD card to root partition on the emmc? That would save me a lot of trouble and repetitive work (and I’m not even sure I would be able to repeat everything “just right” :frowning:

Yep, so the way I would do it:

  • Power on system with SD card (different one, DietPi, doesnt matter)
  • For the SD card you want to copy, use a USB card reader and plug SD into it, then into OPi.

Then you can DD from USB card reader to EMMC:
eg:

dd if=/dev/sda of=of=/dev/mmcblk1

If the SD card is bigger than EMMC, you may need to resize the SD partitions before hand.

It took some fiddling to get this done, but it was my fault: I messed up firmware, by using the command “update firmware”, and now upon boot, the system throws some complaints, but boots anyway :slight_smile:

So, I finally managed to clone my existing root partition from the SD card to emmc, and it works now.
I also had some issues with wifi, but managed to sort it out. It wasn’t exactly “plug and play”, but I have a working system now :slight_smile:
I might try this again on another, fresh Opi PC Plus, and see if it will go faster (and easier) next time…