Cloning identical BeagleBone Black setups

(Question also asked on stackoverflow without much success)

After having set-up and customized my “master” BeagleBone Black with applications etc. on the on-board eMMC, I want to duplicate it on other BBB boards.

What is the best way to clone the BBB?

From the comment on SO, I understanding that one option would be to use a prepared SD-card to programm the new BBBs. To prepare it, I should use the scripts by Robert Nelson.

  • When I insert a (blank) SD-card in the master BBB to prepare the card, it doesn’t appear in /dev (I guess mmcblk0* is the on-board eMMC). How must I mount it?

  • Which script to use? Is there a doc?

  • How to do the programming of the default delivered BBBs.

Are other options (programming the eMMC using USB or LAN) also feasible/preferred (assuming the BB comes with a default Angstroem distrib)?

Regards Philipp

(Question also asked on stackoverflow without much success)

After having set-up and customized my "master" BeagleBone Black with
applications etc. on the on-board eMMC, I want to duplicate it on other BBB
boards.

What is the best way to clone the BBB?

From the comment on SO, I understanding that one option would be to use a
prepared SD-card to programm the new BBBs. To prepare it, I should use the
scripts by Robert Nelson.

Note: these scripts expect a pretty specific environment setup,
essentially if you dl/flash any image off rcn-ee.net (ubuntu/debian)
those set of scripts will work.. Anything else, well....

When I insert a (blank) SD-card in the master BBB to prepare the card, it
doesn't appear in /dev (I guess mmcblk0* is the on-board eMMC). How must I
mount it?

Unless you have the brand new Angstrom kernel from about a week ago..
mmc hotplug was broken, thus the card had to be placed on the bone
before boot..

Which script to use? Is there a doc?
How to do the programming of the default delivered BBBs.

Are other options (programming the eMMC using USB or LAN) also
feasible/preferred (assuming the BB comes with a default Angstroem distrib)?

Regards,

I’m currently using the Angström which comes preinstalled, so Robert C Nelson’s scripts are probably not working because of that.
My current kernel is:

`

root@dhcppc12:~# uname -a
Linux dhcppc12 3.8.11 #1 SMP Wed May 8 07:34:27 CEST 2013 armv7l GNU/Linux

`

`

root@dhcppc12:~# cat /etc/issue
.—O---.

.-. o o

-----.-----.-----.| | .----…-----.-----.
__ | —’| ‘–.| .-’| | |

— || --’| | | ’ | | | |
‘—’---’–’--’–. |-----’’----’’–’ ‘-----’-’-’-’
-’ |
‘—’

The Angstrom Distribution \n \l

Angstrom v2012.12 - Kernel \r

`

I could use a USB-card reader and dd to copy the eMMC to the SD-card and the same way around on the “new” BBB, to program it.
Is this a simpler solution? How should I mount the USB SD-card reader?

(Question also asked on stackoverflow without much success)

After having set-up and customized my “master” BeagleBone Black with
applications etc. on the on-board eMMC, I want to duplicate it on other BBB
boards.

What is the best way to clone the BBB?

From the comment on SO, I understanding that one option would be to use a
prepared SD-card to programm the new BBBs. To prepare it, I should use the
scripts by Robert Nelson.

Note: these scripts expect a pretty specific environment setup,
essentially if you dl/flash any image off rcn-ee.net (ubuntu/debian)
those set of scripts will work… Anything else, well…

When I insert a (blank) SD-card in the master BBB to prepare the card, it
doesn’t appear in /dev (I guess mmcblk0* is the on-board eMMC). How must I
mount it?

Unless you have the brand new Angstrom kernel from about a week ago…
mmc hotplug was broken, thus the card had to be placed on the bone
before boot…

With the blank but formatted card inserted, the BBB seems not to boot. Must I prepare it specially (uEnv.txt)?

I'm currently using the Angström which comes preinstalled, so Robert C
Nelson's scripts are probably not working because of that.
My current kernel is:

root@dhcppc12:~# uname -a
Linux dhcppc12 3.8.11 #1 SMP Wed May 8 07:34:27 CEST 2013 armv7l GNU/Linux

root@dhcppc12:~# cat /etc/issue
.---O---.
> > .-. o o
> > >-----.-----.-----.| | .----..-----.-----.
> > > __ | ---'| '--.| .-'| | |
> > > > > >--- || --'| | | ' | | | |
'---'---'--'--'--. |-----''----''--' '-----'-'-'-'
                -' |
                '---'

The Angstrom Distribution \n \l

Angstrom v2012.12 - Kernel \r

Correct... I've never tested it with that.. Patches welcome...

I could use a USB-card reader and dd to copy the eMMC to the SD-card and the
same way around on the "new" BBB, to program it.
Is this a simpler solution? How should I mount the USB SD-card reader?

So use dd...
dd if=/dev/mmcblk0 of=/dev/sdX

> (Question also asked on stackoverflow without much success)
>
> After having set-up and customized my "master" BeagleBone Black with
> applications etc. on the on-board eMMC, I want to duplicate it on other
> BBB
> boards.
>
> What is the best way to clone the BBB?
>
> From the comment on SO, I understanding that one option would be to use
> a
> prepared SD-card to programm the new BBBs. To prepare it, I should use
> the
> scripts by Robert Nelson.

Note: these scripts expect a pretty specific environment setup,
essentially if you dl/flash any image off rcn-ee.net (ubuntu/debian)
those set of scripts will work.. Anything else, well....

> When I insert a (blank) SD-card in the master BBB to prepare the card,
> it
> doesn't appear in /dev (I guess mmcblk0* is the on-board eMMC). How must
> I
> mount it?

Unless you have the brand new Angstrom kernel from about a week ago..
mmc hotplug was broken, thus the card had to be placed on the bone
before boot..

With the blank but formatted card inserted, the BBB seems not to boot. Must
I prepare it specially (uEnv.txt)?

Yeap.. "specially".... Or patch u-boot...

Regards,

Guys (and Robert, if you are out there!)

I am trying to clone my BBB (which is running Debian Wheezy, some other open source software, and some home-grown HTML stuff) , using Robert Nelson’s scripts: (https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-eMMC-to-microSD.sh )

If I boot my BBB without a uSD card in it, I get the following devices in /dev

mmcblk0

mmcblk0boot0

mmcblk0boot1

mmcblk0p1

mmcblk0p2

but if I then put in a uSD (freshly formatted) , I get

mmcblk0

mmcblk0boot0

mmcblk0boot1

mmcblk0p1

mmcblk0p2

mmcblk1

mmcblk1p1

mmcblk1p2

So the uSD is being recognizes as mmblk1 with two partitions. First question is “why not /dev/sdb”…or have I misunderstood that bit?

Second question…why two partitions on a freshly formatted uSD?

Aside from that issue, I was going to try Robert’s scripts, but then I looked at the start of the script and I saw:

source="/dev/mmcblk1"

destination="/dev/mmcblk0"

which looks “back to front”…if the eMMC is mmcblk0 and the uSD is mmcblk1 (as shown by the lists above) then shouldn’t the source/destination be the other way about? That looks very much like it will copy mmcblk1 (the formatted uSD) to mmcblk0 (eMMC) and effectively erase the running image/software the BBB.

Any comments or suggestions would be welcome; I don’t want to brick the existing eMMC image because it works, but at some point I’ve got to bite the bullet and do something if I’m to clone this device. Apologies if these are silly newbie questions, but I’ve migrated from the R-Pi and an on a vertical learning curve (again!)

Thanks

Jim

(Question also asked on stackoverflow without much success)

After having set-up and customized my “master” BeagleBone Black with
applications etc. on the on-board eMMC, I want to duplicate it on other BBB
boards.

What is the best way to clone the BBB?

From the comment on SO, I understanding that one option would be to use a
prepared SD-card to programm the new BBBs. To prepare it, I should use the
scripts by Robert Nelson.

Note: these scripts expect a pretty specific environment setup,
essentially if you dl/flash any image off rcn-ee.net (ubuntu/debian)
those set of scripts will work… Anything else, well…

When I insert a (blank) SD-card in the master BBB to prepare the card, it
doesn’t appear in /dev (I guess mmcblk0* is the on-board eMMC). How must I
mount it?

Unless you have the brand new Angstrom kernel from about a week ago…
mmc hotplug was broken, thus the card had to be placed on the bone
before boot…

Which script to use? Is there a doc?
How to do the programming of the default delivered BBBs.

Are other options (programming the eMMC using USB or LAN) also
feasible/preferred (assuming the BB comes with a default Angstroem distrib)?

Regards,


Robert Nelson
http://www.rcn-ee.com/

Guys (and Robert, if you are out there!)

I am trying to clone my BBB (which is running Debian Wheezy, some other open source software, and some home-grown HTML stuff) , using Robert Nelson’s scripts: (https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-eMMC-to-microSD.sh )

If I boot my BBB without a uSD card in it, I get the following devices in /dev

mmcblk0

mmcblk0boot0

mmcblk0boot1

mmcblk0p1

mmcblk0p2

but if I then put in a uSD (freshly formatted) , I get

mmcblk0

mmcblk0boot0

mmcblk0boot1

mmcblk0p1

mmcblk0p2

mmcblk1

mmcblk1p1

mmcblk1p2

So the uSD is being recognizes as mmblk1 with two partitions. First question is “why not /dev/sdb”…or have I misunderstood that bit?

Second question…why two partitions on a freshly formatted uSD?

Aside from that issue, I was going to try Robert’s scripts, but then I looked at the start of the script and I saw:

source="/dev/mmcblk1"

destination="/dev/mmcblk0

Just reverse those variables now that mmc hot plug works and make things interesting.

Hey Robert, thanks for the quick answer!

I’m thinking this process through to completion before I do anything, and another question comes to mind:

If I understand things correctly, to get the system that is on the eMMC onto uSD I need to reverse the order in your script and run the scrip from the running BBB .

Having done that, I then install the uSD into a “virgin” BBB, hold the User/Boot button and power on, and that will cause the “virgin” BBB to boot from the uSD.

Will that sequence of actions flash the eMMC from the uSD, or do I need to use your other script: https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh

from the OS running off the uSD to flash the eMMC on the “virgin” BBB with source and destination suitably adjusted to get a bootable eMMC?

Thanks once again for your help

Jim

Hey Robert, thanks for the quick answer!

I’m thinking this process through to completion before I do anything, and another question comes to mind:

If I understand things correctly, to get the system that is on the eMMC onto uSD I need to reverse the order in your script and run the scrip from the running BBB .

Having done that, I then install the uSD into a “virgin” BBB, hold the User/Boot button and power on, and that will cause the “virgin” BBB to boot from the uSD.

Will that sequence of actions flash the eMMC from the uSD, or do I need to use your other script: https://github.com/RobertCNelson/tools/blob/master/scripts/beaglebone-black-copy-microSD-to-eMMC.sh

from the OS running off the uSD to flash the eMMC on the “virgin” BBB with source and destination suitably adjusted to get a bootable eMMC?

Thanks once again for your help

Jim

All my scripts where written assuming microSD is device 0 and emmc is device 1. To achieve that the micro SD must be installed before power up. If you hotplug the microSD that assumption no longer applies as I have not adjusted the script for the recently added hot plug support.

In that repo if you look very close at both the microsd to emmc vs emmc to microsd scripts you notice they are exactly the same except for the source an d destination variable.