23

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.

4
  • 1
    check these scripts: github.com/RobertCNelson/tools/tree/master/scripts Jul 24, 2013 at 14:16
  • 1
    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? Jul 30, 2014 at 19:15
  • @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? Aug 6, 2014 at 15:26
  • 1
    @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. Aug 6, 2014 at 15:28

5 Answers 5

23

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.
1
  • 1
    This is much easier than the @Paul Ryan post. Thank you Debian!
    – Aaron
    Apr 20, 2018 at 20:55
14

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

13
  • 1
    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).
    – Paul Ryan
    Jul 4, 2014 at 23:22
  • 1
    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. Aug 6, 2014 at 16:17
  • 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. Feb 18, 2015 at 20:35
  • 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? Feb 26, 2015 at 5:20
  • 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? May 19, 2015 at 14:29
9

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.

6
  • 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
    Nov 12, 2014 at 19:34
  • 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
    – zabumba
    Nov 13, 2014 at 1:47
  • @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 Nov 13, 2014 at 20:08
  • 1
    Is it safe to use dd to capture an image of an active system that is writing back to the device constantly?
    – kevinc
    Nov 17, 2014 at 16:50
  • 2
    @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. Apr 19, 2015 at 15:46
0

Copying your emmc Image back to a SD card is a bit tricky, since it will need to be formated in a certain way to get it to mount. Here are some tips to get that working: http://dev.gentoo.org/~armin76/arm/beagleboneblack/install_emmc.xml#expand

What might be easier is using an USB thumb drive, or USB SD card reader. Note, currently there are some issues hot-plugging USB devices, so boot with it plugged in.

You can copy your entire FS to the USB drive, then compress it. Create a new bootable linux sd image, and put your compressed FS on there and use one of the scripts Ottavio linked to to copy over the compressed image. you can make a systemd service to launch the script on startup.

0

We have noticed that on Beaglebones with the Jan 23rd 2015 release of Debian, the only way to successfully copy the image from SD is not to hold the boot button down when powering up.

Not the answer you're looking for? Browse other questions tagged or ask your own question.