Jan:
I also had problems restoring and copying a BBB image for the Rev.C (4 GB eMMC) and
the new larger Debian distributions, particularly if you have added additional code and
updates to the distribution for your application.
I suspect that the existing instructions/methods assume smaller code and memory sizes.
I have been successful duplicating a Debian 8 (jessie) that has had upgrades
and my application code added to it on a Rev.C BBB.
1.) Use a uSD card larger than 4 GB. You will need something larger than 4 GB to
save a 4 GB image using dd. I used 16 GB, but you can not go larger than
32 GB at this time.
2.) Install one of the Debian distributions on the uSD card. I chose
bone-debian-7.7-console-armhf-2014-11-19-2gb.img
3.) If you examine the installation, it is using less than 2 GB of the card.
Use Gparted to expand the partition size to the full size of the card. In my case,
16 GB, which gives me room on the card to hold multiple 4 GB “.img” files.
4.) Plug the uSD card into the BBB for which you want to copy the eMMC and
apply power. The console distribution I chose boots straight onto the uSD
card, without pressing the S2 button. If you use some other distribution,
things may work differently.
5.) Sign in as ‘root’ and enter
dd if=/dev/mmcblk1 of=/mnt/BeagleBoneBlack-eMMC-image-$RANDOM.img bs=10M
6.) Wait 9 minutes for the command to return to the command line. It takes about
2 minutes per GB to build the “.img” file. type sync. The completed file will be located
at /mnt/ The “.img” file will be slightly less than 4 GB in size
7.) Shutdown this BBB, and plug the uSD card in the target BBB.
8.) Power up the target BBB and sign in as root, and type on the command line
dd if=/mnt/BeagleBoneBlack-eMMC-image-NUMBER.img of=/dev/mmcblk1 bs=10M
where NUMBER is the random number of the img that was generated in step (5).
9.) Wait 9 minutes for the command to return, sync, shutdown, remote uSD card
and re-power the target. The target should now be a duplicate.
Other thoughts:
You can compress the “img” file on the BBB by
xz BeagleBoneBlack-eMMC-image-NUMBER.img
BUT it will take 2 Hours on the BBB to compress a 4 GB file, when booted on an uSD card.
You are much better off moving the file to an external machine to compress it.
You can do a SSH copy of the “img” file to an external (Linux) machine via
the Ethernet connection by doing something like:
scp root@192.168.1.200:/mnt/BeagleBoneBlack-eMMC-image-NUMBER.img /home/your-name/Images/
It will transfer at around 8 MB per second, if the BBB is otherwise idle.
— Graham