Duplicating identical BeagleBone Black setups
Asked Answered
N

5

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.

Nansen answered 24/7, 2013 at 12:51 Comment(4)
check these scripts: github.com/RobertCNelson/tools/tree/master/scriptsKeelung
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?Heathcote
@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?Wyman
@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.Heathcote
M
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

Marinmarina answered 10/5, 2014 at 15:41 Comment(13)
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).Marinmarina
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.Wyman
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.Mycenaean
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?Raddle
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?Stoma
@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.Marinmarina
@TimothyVann The only thing I can think of is that your card is not using the MBR partition table, try reformatting with that.Marinmarina
@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.Marinmarina
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.Stoma
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?Pannell
I've always done the unpack myself prior to running dd.Marinmarina
/opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh <-- more easyMyungmyxedema
@TimothyVann I'm having the same issue. Were you able to resolve this ?Assailant
H
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.
Hammerfest answered 22/3, 2016 at 12:2 Comment(1)
This is much easier than the @Paul Ryan post. Thank you Debian!Aitken
M
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

Marinmarina answered 10/5, 2014 at 15:41 Comment(13)
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).Marinmarina
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.Wyman
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.Mycenaean
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?Raddle
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?Stoma
@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.Marinmarina
@TimothyVann The only thing I can think of is that your card is not using the MBR partition table, try reformatting with that.Marinmarina
@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.Marinmarina
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.Stoma
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?Pannell
I've always done the unpack myself prior to running dd.Marinmarina
/opt/scripts/tools/eMMC/beaglebone-black-make-microSD-flasher-from-eMMC.sh <-- more easyMyungmyxedema
@TimothyVann I'm having the same issue. Were you able to resolve this ?Assailant
W
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.

Walburga answered 5/9, 2014 at 12:36 Comment(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 DebianKelp
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 workflowKelp
@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=10Walburga
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 BBBKelp
Is it safe to use dd to capture an image of an active system that is writing back to the device constantly?Carbajal
@Carbajal 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.School
C
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.

Correspond answered 21/8, 2013 at 7:29 Comment(0)
P
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.

Pannell answered 1/2, 2016 at 16:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.