Having problems cloning eMMC

I am trying to clone an existing BBB, so my first try is using the scripts on http://elinux.org/BeagleBone_Black_Extracting_eMMC_contents . So first thing I notice is the .img file created was only 2GB, whereas this is a newer BBB that has 4GB eMMC. So when I updated script to write the img to new BBB, it no longer boots from eMMC. i would like to make exact copies including uENV.txt, etc. Does anyone know why this is not working?

The read command script is

#!/bin/sh
echo timer > /sys/class/leds/beaglebone:green:usr0/trigger
dd if=/dev/mmcblk1 of=/mnt/BeagleBoneBlack-eMMC-image-$RANDOM.img bs=10M
sync
echo default-on > /sys/class/leds/beaglebone:green:usr0/trigge

there is another thread here Duplicate BeagleBone black setup dated Nov 28, where you will find a solution to your problem.
Good luck.
Jan

So in that other thread, it was instructed to use the same dd command “dd if=/dev/mmcblk1 of=/mnt/BeagleBoneBlack-eMMC-image-$RANDOM.img bs=10M” to create image, so why would mine only end up 2GB instead of 4GB? I cannot follow those instructions exactly, as I only have a 4GB SD card, so maybe this is the problem since the eMMC is 4GB also.

I think you will have two problems.

First, you can not put a 4GB file on a 4 GB card, because there must also be room for the
Linux OS, and depending on the version, this can be another 1 GB, or more.

Second problem is that when you install a 2 GB image on a 4 GB card, the partition as
installed is typically about 2 GB, and the rest of the card can not be used, until you
expand the partition to the full size of the card.

So, for working with the 4 GB eMMC version of the Beaglebone Black, you must use
at least an 8 GB card. I use 16 GB, so that there is room for about three images
that are not compressed. You can not go larger than 32 GB at this time.

— Graham

So I got my 8gb flash, and resized original boards partition to be smaller than second board. So now the problem is I have flashed new board, and it will not boot up. I can mount and view both partitions correctly, and everything looks ok, but I only get “CCC” when trying to boot and viewing with FTDI cable. Any ideas?

`
Disk /dev/mmcblk1: 3867 MB, 3867148288 bytes

4 heads, 16 sectors/track, 118016 cylinders, total 7553024 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x00000000

Device Boot Start End Blocks Id System

/dev/mmcblk1p1 * 2048 198655 98304 e W95 FAT16 (LBA)

/dev/mmcblk1p2 198656 7571455 3686400 83 Linux
`

Did you set the “boot” bit on the 8gb flash card?

The later versions of the OS can not see or boot from the uSD card unless the “boot” bit is set.

The “CCCCCC” string means that the BBB can not see the card, and is trying to boot from

the serial port.

— Graham

It is not a uSD but internal eMMC. And you can see from fdisk output boot flag is set.

and how exactly did you install the bootloader to the eMMC?

Regards,

I’m not sure what you mean by bootloader. But I just read in entire mmcblk1 (When booting off a SD card to image) on one BBB using dd, and output to another using dd.

// BBB 1
dd bs=4M if=/dev/mmcblk1 of=image.bin

// BBB 2
dd bs=4M if=image.bin of=/dev/mmblk1

At which point, it's likely your original "/dev/mmcblk1" didn't have
the bootloader installed either.

Regards,

So the original BBB does boot fine. But how can I re-install bootloader for BBB2? But it is my understanding, the bootloader is what is in the Fat32 partition? It looks the same as the other one.

`

total 9820

drwxr-xr-x 2 root root 2048 Apr 23 16:22 App

-rwxr-xr-x 1 root root 223 Apr 23 16:22 autorun.inf

drwxr-xr-x 2 root root 2048 Apr 23 20:21 debug

drwxr-xr-x 4 root root 4096 Apr 23 16:22 Docs

drwxr-xr-x 5 root root 2048 Apr 23 16:22 Drivers

drwxr-xr-x 2 root root 2048 Apr 23 16:22 dtbs

-rwxr-xr-x 1 root root 51 Apr 23 16:22 ID.txt

-rwxr-xr-x 1 root root 2869999 Apr 23 20:20 initrd.img

-rwxr-xr-x 1 root root 41174 Apr 23 16:22 LICENSE.txt

-rwxr-xr-x 1 root root 81264 Apr 23 20:22 MLO

-rwxr-xr-x 1 root root 16822 Apr 23 16:22 README.htm

-rwxr-xr-x 1 root root 292 Apr 23 16:22 README.md

drwxr-xr-x 2 root root 2048 Apr 23 16:22 scripts

-rwxr-xr-x 1 root root 313 Apr 23 16:22 SOC.sh

-rwxr-xr-x 1 root root 16822 Apr 23 16:22 START.htm

drwxr-xr-x 2 root root 2048 Aug 15 2014 System Volume Information

-rwxr-xr-x 1 root root 401800 Apr 23 20:22 u-boot.img

-rwxr-xr-x 1 root root 1513 Sep 15 2014 uEnv.txt

-rwxr-xr-x 1 root root 1514 Aug 21 2014 uEnv.txt~

-rwxr-xr-x 1 root root 2870063 Apr 23 20:20 uInitrd

-rwxr-xr-x 1 root root 3717760 Apr 23 16:22 zImage

`

MLO/u-boot.img is the bootloader..

MLO must be the first thing copied to the partition.

Regards,