Duplicating identical BeagleBone Black setups

33,787

Solution 1

For anyone else that needs this, the best answer I've found to this is to do the following:

First setup your master Beaglebone Black the way you want it.

Backup the eMMC

  • FAT format a 4GB or larger SD card (must be a MBR/bootable formatted microSD card)
  • Download beagleboneblack-save-emmc.zip and extract the contents onto your SD card

    Note: this is an image from Jason Krinder at his github https://github.com/jadonk/buildroot using the save-emmc-0.0.1 tag

  • Put the card into your powered off Beaglebone Black
  • Power on your Beaglebone Black while holding the S2 Button
  • The USR0 led will blink for about 10 minutes, when it's steady on you have an SD card with a copy of your eMMC in a .img file

Use the eMMC to flash a new Beaglebone Black

  • On the SD card edit autorun.sh

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

    where <image-file> is the image file you got after copying backing up your eMMC

  • Insert the card into your powered off Beaglebone Black
  • Power on your Beaglebone Black while holding the S2 Button
  • The Beaglebone Black should go into rebuilding mode and within about 20 minutes you'll have a newly flashed Beaglebone Black (when all 4 USR LEDs are solid) with a copy of your original

eLinux reference used for this article - http://elinux.org/BeagleBone_Black_Extracting_eMMC_contents

Solution 2

As noted at the bottom of the eLinux article, there is a much easier way if you are running the Debian distribution:

  1. Boot master BBB with no SD card in
  2. Insert SD card
  3. Log in (e.g. with serial terminal, SSH etc.) and run sudo /opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh. LEDs will flash in sequence whilst SD card is being written.
  4. When the LEDs stop and the script terminates, remove the SD card.
  5. Insert SD card into new BBB then power on.
  6. eMMC will be flashed; LEDs on new BBB will flash in sequence until complete.

Solution 3

I have the same need and am using dd and nc (NetCat) to save directly on my desktop without having to use an intermediary SD Card. You can do this over the USB connection, or ethernet connection, by changing the IP address in the steps below.

After setting up your BBB with the applications you want, the basic steps are:

  1. On the desktop, run this command in a terminal:

nc -l 19000|bzip2 -d|dd bs=16M of=BBB.img

  1. On the BeagleBone Black, run this command in a terminal (you can SSH into it, or do it directly from the BBB):

dd bs=16M if=/dev/mmcblk0|bzip2 -c|nc 192.168.7.1 19000

The 192.168.7.1 address is for the USB connection. (BBB is 192.168.7.2) If you're doing this over an ethernet connection, you should use your desktop's IP address.

This is taken from instructions here.

Finally, follow any method to install onto the next BBB. Here's an example of how to flash the emmc.

Share:
33,787

Related videos on Youtube

Philipp
Author by

Philipp

Updated on July 09, 2022

Comments

  • Philipp
    Philipp almost 2 years

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

    What is the best way to duplicate the BBB?

    My understanding of options:

    1. SD-Card: Programming each board by inserting a prepared SD card containing an image and pressing the "boot" switch while powering up.
      • How should I prepare that .img file or the SD card from my master BBB?
      • The image should copy to the on-board eMMC, so that the SD-card can be removed afterwards.
    2. USB: Programming by connecting the board over USB to a (Win7) PC.
      • Is it possible to write the full on-board eMMC from the PC?
      • With which app to do the writing?
      • How to prepare the image which will be written, starting from the master BBB?
    3. Ethernet: Programming over LAN after boot-up with default angstrom distro.
      • Is it even possible over LAN?
      • How to do the writing?
      • How to prepare the image which will be written, starting from the master BBB?

    Which is possible/best?

    Edit: My current solution is to flash with a standard image (from the BeagleBoe website) and then have a script do all modifications as expected. This includes disabling many services I don't need, installing applications and configuring stuff etc. If there is an easier way for making a SD card with a full image on it, I'm still interested.

    • Ottavio Campana
      Ottavio Campana almost 11 years
    • Chris Stratton
      Chris Stratton almost 10 years
      New user @Master tried found this and found it worked on Angstrom Rev 6, but on Rev C Debian board, "it simply doesn't start when booting while holding the S2 Button pressed, all of the LEDs remain turned off and nothing else happen until I Restart the BBB normally." Anyone have any thoughts?
    • Robert C Edwards
      Robert C Edwards over 9 years
      @ChrisStratton I'm having the same problems. It backs up a copy of the eMMC to the SD card, but I can't get S2 to work when I go to boot…have you had any luck?
    • Chris Stratton
      Chris Stratton over 9 years
      @RobertCEdwards - I was merely relaying a comment from someone else who had improperly posted it as an answer. I have not personally experimented with one of these particular boards.
  • Paul Ryan
    Paul Ryan almost 10 years
    Thanks for the edit. This is correct that the S2 button needs to be held until the USR lights start flashing (about 3-10 seconds).
  • Robert C Edwards
    Robert C Edwards over 9 years
    I was running into problems getting the BBB to boot from the SD card. Turns out you need to mark the SD partition as active in order to boot from it. See Talk section from eLinux article referenced above.
  • zabumba
    zabumba over 9 years
    this almost worked, I spent a while before realizing that you need to actually do nc -l -p 19000 or that won't work on Linux Debian
  • zabumba
    zabumba over 9 years
    SevakPrime, I did manage to get my image BBB.img, and copied it on microSD, inserted in BBB, hold S2 while power it up but I am still not able to flash it back to my eMMC. I may be missing something in your workflow
  • SevakPrime
    SevakPrime over 9 years
    @joelmaranhao, copying it as a file to the microSD card won't work. You need to write it as an image to the microSD card. (See step #5 in the second link above.) See this link for how to write an image: embeddedarm.com/support/faqs.php?item=10
  • zabumba
    zabumba over 9 years
    I didn't formulate my sentence correctly, that is actually exactly what I have done. I used the dd command to write the image, I didn't copy the file img onto the microSD. May be it's an issue with the revision of my BBB
  • kevinc
    kevinc over 9 years
    Is it safe to use dd to capture an image of an active system that is writing back to the device constantly?
  • Luca Lenardi
    Luca Lenardi about 9 years
    I would also recommend, to disconnect everything connected to the board (e.g. USB adapters, eth cable etc.) before powering it on. I was getting just two leds blinking briefly and the nothing before removing every connected device.
  • Timothy Vann
    Timothy Vann about 9 years
    I'm trying the above instructions and can't get it to work. I have a BBB Rev B. I have a 8GB SD card formatted FAT32. I don't see how you can format it just FAT as I think that only supports 2GB partitions. In either case neither windows 7 nor OSX will allow me to format it non-32 FAT. I disconnect all cables, put the card in, hold down S2 and plug the power in. After about 10 seconds the USR0 LED comes on solid (no flashing), USR2 just barley flashes. I leave it for hours and come back and USR0 is still on solid. I take card out, BBB-eMMC-2967.img is only 10 bytes. What is wrong?
  • Hristo Ivanov
    Hristo Ivanov about 9 years
    @kevinc I think it's not. That's why I booted from the micro SD, unmounted the eMMC and then transferred it to my Desktop. I think this is the only safe way to do it without using any software.
  • Shawn Jacobson
    Shawn Jacobson almost 9 years
    Anyone know why this wouldn't work on the older 2G version of BBB? I have it working fine with the newer 4G version, but when I try to run it on a 2G one, it goes to a solid LCD immediately, and I only get a 1K image file. I wrote the contents of ls /dev/ to the card and noticed that there mmcblk1 is not there, only mmcblk0 (the SD card). Why would the eMMC not mount on the 2G version when it works fine on the 4G version?
  • Paul Ryan
    Paul Ryan almost 9 years
    @LucaLenardi This would be the case if your using usb to power the board you may need to power it via the barrel so that you're getting enough amperage for your peripherals.
  • Paul Ryan
    Paul Ryan almost 9 years
    @TimothyVann The only thing I can think of is that your card is not using the MBR partition table, try reformatting with that.
  • Paul Ryan
    Paul Ryan almost 9 years
    @ShawnJacobson Sorry I've only done this with Rev B and C boards I don't know about other ones. You could try posting your question in the discussion thread at elinux.org/BeagleBone_Black_Extracting_eMMC_contents, Jason seems to have a wider breadth of experience and has been answering questions there.
  • Shawn Jacobson
    Shawn Jacobson almost 9 years
    I am using Rev A6 and I am powering with a 2A power supply. I ensured that I have an MBR and still got the same result. I will also post to the main article.
  • Julian Gold
    Julian Gold over 8 years
    The result of backing up the eMMC is a .img.gz file, not .img. Does dd cope with the gz archive, or do I need to unpack it before editing the autorun.sh file?
  • Paul Ryan
    Paul Ryan over 8 years
    I've always done the unpack myself prior to running dd.
  • Aderbal Nunes
    Aderbal Nunes over 6 years
    /opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flashe‌​r-from-eMMC.sh <-- more easy
  • Aaron
    Aaron about 6 years
    This is much easier than the @Paul Ryan post. Thank you Debian!
  • mrid
    mrid over 5 years
    @TimothyVann I'm having the same issue. Were you able to resolve this ?