dd between boards

Hi all,

I have several BBB in my system (all rev C). I need them to be configured the same way so I thought about setting up one and copying the setup using dd between boards. In order to do this I used a uSD with 2 partitions, the first one containing a full system and the 2nd one aimed at storing the image from the eMMC.

I create the custom image from eMMC of the source board to the uSD card via:

root@beaglebone:~# dd if=/dev/mmcblk1 of=/dev/mmcblk0p3 bs=16M
234+0 records in
234+0 records out
3925868544 bytes (3.9 GB) copied, 306.985 s, 12.8 MB/s

and copy it from the uSD board to the eMMC of the destination board via:

root@beaglebone:~# dd if=/dev/mmcblk0p3 of=/dev/mmcblk1 bs=16M count=234
234+0 records in
234+0 records out
3925868544 bytes (3.9 GB) copied, 583.641 s, 6.7 MB/s

The operations run correctly but when I restart the destination board, I can never reach (whether its is via SSH to 192.168.7.2 or to the IP set for eth0, it does not work). I have also tried doing the dd to a file rather than to a partition, and changed the bs, but none of these options work. The only configuration that works is when the source and destination boards are the same (which is useless).

I initially thought I had bricked all my boards except the source, but then I tried to install an official flasher image (from Robert C. Nelson) on the destination boards, and it worked fine (at least with BBB-eMMC-flasher-debian-8.4-console-armhf-2016-04-10-2gb.img.xz and BBB-eMMC-flasher-debian-7.5-2014-05-14-2gb.img.xz). So my boards are actually not bricked.

I then tried to dd an official non-flasher image (also coming from Robert C Nelson), by putting the non-flasher image on the 2nd partition of my uSD card, mounting this partition and doing dd if=bone-debian-8.4-console-armhf-2016-04-10-2gb.img of=/dev/mmcblk1p1 but I had no luck.

So it seems I can install the official flasher images (using the auto-flashing system), but when I flash using dd it does not work (whether I flash custom or official images). This gives me the feeling that the different boards are slightly different in hardware, could this be possible? Could this come from dead sectors in the eMMC? Is there a way to use the auto-flashing system with a custom image?

I have looked for days on the internet how to go forward and get my dds right but cannot find any answer.

Any idea of what I am doing wrong?

Thanks,

Antoine.

Don't bother with dd. :wink:

Under:

/opt/scripts/tools/eMMC

run "git pull" then

sudo ./beaglebone-black-make-microSD-flasher-from-eMMC.sh

It'll "create an eMMC flasher based on the contents of the eMMC".. Make
sure to insert a new microSD card..

Regards,

This works like a charm though I am not sure I understand why dd does not work and what the script does to make it work. Any idea?

Thanks!

This works like a charm though I am not sure I understand why dd does not work and what the script does to make it work. Any idea?

Because you were not doing it right. Your out file ( of= ) was to a raw block device, instead of a file onto a file system. A block device that does not exist on a stock Beaglebone black I might add. Secondly, you specified a block count for the second copy( device to be cloned I assume ) which gains you nothing, as the image is still 3.9G in size. Which would not be a problem if you cloned to a file, onto a file system.

So if you did all that to potentially save you some time, you’d be better off cloning using tar on the rootfs, and then dd on the MBR to get your first and second stage boot loaders.

Hello William, the block count is needed because my uSD card is much larger than the emmc.

Now for the raw block device vs file, I am not sure why you say the BBB does not have such a thing…

Also what do you mean by using tar on the rootfs?

Kind regards

Now for the raw block device vs file, I am not sure why you say the BBB does not have such a thing…

Sorry I read mmcblk0p3 as mmcblk3p0 . . .

Also what do you mean by using tar on the rootfs?

How big is your actual rootfs ? Not the whole partition, just how much space is being used on that partition ? So if your partition is 4G but you’re only using a few hundred M, then using tar would save a lot of time, and space for storage. I talk about it here: http://www.embeddedhobbyist.com/2015/09/beaglebone-black-working-with-debianlinux-images/

Your link was an interesting reading, thanks.