dd between boards

80 views
Skip to first unread message

Antoine Rennuit

unread,
May 25, 2016, 12:20:06 PM5/25/16
to BeagleBoard
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.

Robert Nelson

unread,
May 25, 2016, 12:24:15 PM5/25/16
to Beagle Board, antoine...@gmail.com
Don't bother with dd. ;)

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,


--
Robert Nelson
https://rcn-ee.com/

Antoine Rennuit

unread,
May 26, 2016, 2:38:25 PM5/26/16
to BeagleBoard, antoine...@gmail.com
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!

William Hermans

unread,
May 26, 2016, 2:47:49 PM5/26/16
to beagl...@googlegroups.com
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.

On Thu, May 26, 2016 at 11:38 AM, Antoine Rennuit <antoine...@gmail.com> wrote:
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!

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/227db2b2-e3ed-411d-8a66-96aaa622e057%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Antoine Rennuit

unread,
May 26, 2016, 3:40:22 PM5/26/16
to BeagleBoard
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 

William Hermans

unread,
May 26, 2016, 3:59:13 PM5/26/16
to beagl...@googlegroups.com
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/


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

Antoine Rennuit

unread,
May 27, 2016, 3:09:35 AM5/27/16
to BeagleBoard
Your link was an interesting reading, thanks.
Reply all
Reply to author
Forward
0 new messages