Copy existing Ubuntu installation from SD-Card to eMMC?

Hi,

I installed Ubuntu on an SD-card which works fine but boots only when I hold down the boot-switch on power-up. So it seems the BB still wants to to something with the eMMC. My idea would be to copy the existing Ubuntu installation to the eMMC, but its structure is somewhat weird, so I don’t know what to put where. These are the devices I have:

brw-rw---- 1 root disk 179, 768 Apr 6 09:16 /dev/mmcblk0
brw-rw---- 1 root disk 179, 769 Apr 6 09:16 /dev/mmcblk0p1
brw-rw---- 1 root disk 179, 0 Apr 6 09:16 /dev/mmcblk1
brw-rw---- 1 root disk 179, 256 Mar 2 12:58 /dev/mmcblk1boot0
brw-rw---- 1 root disk 179, 512 Mar 2 12:58 /dev/mmcblk1boot1
brw-rw---- 1 root disk 179, 1 Apr 6 09:16 /dev/mmcblk1p1
crw------- 1 root root 241, 0 Mar 2 12:58 /dev/mmcblk1rpmb

Amazingly, when doing a “parted /dev/mmcblk0” or “/dev/mmcblk1” it does not show me all these different drives but exactly one partition. For the eMMC this partition looks like that:

Model: MMC M62704 (sd/mmc)
Disk /dev/mmcblk1: 3825MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 102MB 101MB primary fat16 boot, lba

So…any idea how I can move my existing Ubuntu installation from SD to eMMC or at least how I can force it to boot from SD-card (without hard-wiring the Boot-button)?

Thank you!

1 Like

How much space does the Ubuntu image take up on the SD card ?

If you are happy to just boot from SD and you may want too as space is limited on the eMMC, you can do this by just overwriting the start of the eMMC device.

If no valid boot image is found on the eMMC, the chip will try to boot from SD card

dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=1
2 Likes

On BeagleBone Black, a common approach is to zero-out the eMMC such that no bootloader is found and it will fail-over to the uSD. I don’t believe that will work on BeaglePlay.

Anyway, you could do something like:

sudo dd if=/dev/zero of=/dev/mmcblk1 size=1024 count=1024

Make double-sure /dev/mmcblk1 is the eMMC before executing this command. I don’t know what the ideal amount of 0s to write is off-hand.

1 Like

@jkridner I think wiping the MBR and partition table is enough to prevent booting, so something like 1K would probably work.

I just assumed this was a normal Beaglebone board, but I would imagine the same would still hold true for a Play board as well.

The Play is who another can of worms… eMMC boot up is controlled from a binary in dev/mmcblk0boot0

echo '0' >> /sys/class/block/mmcblk0boot0/force_ro
dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k

Regards,

That’s interesting. What is the binary blob ?

Is that directly loading Linux, or does it then load U-boot ?

It’s tiboot3.bin which is u-boot SPL, TIFS, with k3’s extra stuff wrapped around it…

See here for more details:

Regards,

Do you know if the play will always be GP or will it be switch to HS at a later date?