Make a backup of contents of one beaglebone black and install said contents on a second BBB

Hello Beagleboard Forum,

First time post, thanks so much for this resource.

I am a complete newbie, trying to copy the contents of one beaglebone black to a second beagle bone black. The original BBB was part of a 3D printer kit- I am trying to make a second printer which will be repurposed.

Info on-line suggests that the a beaglebone black can be backed up to a micro SD card, but the procedures I have found to date are over my head.

Any suggestions would be MOST appreciated.

Many thanks,
canis

First question, is your system running from an SD card or the eMMC?

If running from an SD card, just “clone” or duplicate the card using Windows or Linux tools. If its running from the eMMC (on-board storage). It’ll require knowing some Linux commands. For a beginner, I’d suggest downloading an image as close to what is in your eMMC as you can, write it to an SD and then mounting the SD card using a USB to SD card adapter (this gets you the correct partition layout) on the BBB and using rsync or dd to clone (copy) the / (root) and /boot partitions from your eMMC to the SD card.

rsync is “easier” in that it uses mount points instead of raw device names for the partitions but could easily run out of space while copying the partitions. dd is problematic if your SD card is smaller than the eMMC (not all 4GB cards are really 4GB), using an 8GB card should fix this, but for rsync you’d have to boot the SD card image on your BBB and run the grow_partition.sh script to make the extra space available before rebooting the eMMC and mounting the SD card over USB.

I don’t know if you can “hot plug” and SD card into the BBB slot, it could very well depend on your software version which is why I suggest mounting it on the BBB using a USB SD adapter.

uname -a will tell you the kernel and cat /etc/dogtag will tell you the image – something like 2015-03-01 Debian or Angstrom. If Angstrom, docs are pretty scarce :frowning:

I’m sure there are other cloning tools, but if its Angstrom you may be limited to dd or rsync. I gave up on Angstrom as soon as the Debian images came out because I was frustrated by the differences from Ubuntu/Debian and its dearth of documentation.

Maybe a link to the procedures you’ve found would clarify what exactly is “over your head”.

If you have a recent Linux computer, when you plug in the BBB over the USB it should mount the rootfs and boot partitions of the eMMC so you could use rsync, dd or other tools to clone their contents to an SD card. I don’t know if tools exist for current Windows versions mounting of Linux partitions, although years ago I mounted Linux ext2 partitions on Windows 2000.

Once you succeed with the clone you’ll have to edit /etc/hosts and /etc/hostname on one of the systems before plugging them into the same network so they have different names.

Unfortunately this is all made more difficult than most anyone is happy with by the rapid evolution of Linux during the Beaglebone’s existance.

Out of curiosity, I just “hot plugged” an SD card into my BBG booted from the eMMC and dmesg shows mmcblk1: p1 p2 are created, although they don’t auto-mount. So if your BBB image is new enough it may be pretty easy to plug in an 8GB SD card and use dd to clone the eMMC to the SD card (no SD card formatting would be required).

debian@beaglebone:~$ ls /dev/mmc*
/dev/mmcblk0 /dev/mmcblk0boot1 /dev/mmcblk0p2 /dev/mmcblk1p1
/dev/mmcblk0boot0 /dev/mmcblk0p1 /dev/mmcblk1 /dev/mmcblk1p2

I’m currently using the “latest” 7.9 image 2015-11-12 so I don’t know at what image this started working.

Hi Wally

Many thanks. I’ll apologize in advance- there are terms I’m not familiar with; I fear I’ll have to take small steps

First question, is your system running from an SD card or the eMMC?

Running the eMMC

If running from an SD card, just “clone” or duplicate the card using Windows or Linux tools. If its running from the eMMC (on-board storage). It’ll require knowing some Linux commands. For a beginner, I’d suggest downloading an image as close to what is in your eMMC as you can, write it to an SD and then mounting the SD card using a USB to SD card adapter (this gets you the correct partition layout) on the BBB and using rsync or dd to clone (copy) the / (root) and /boot partitions from your eMMC to the SD card.

Is the image the list of files & folders visible upon opening BBB on my laptop OR the list of folders and files within Cloud 9 OR something else?

Thanks again,
canis

I’ll try to walk you through this, step by step but it may take awhile. I’ll try to check this thread everyday.

Since you are using the eMMC the easiest backup will be if you can “hot plug” a micro SD card. Get an 8GB Class 10 card. After you boot your Beaglebone open a terminal window (the root console tab in Cloud9 will work, although putty or ssh will be better) and do the command: ls /dev/mmc*
you should see something like:
/dev/mmcblk0 /dev/mmcblk0p1 /dev/mmcblk1boot0

Next plug in the SD card and repeat the ls /dev/mmc* command, you should then see something like:
/dev/mmcblk0 /dev/mmcblk1 /dev/mmcblk1boot1 /dev/mmcblk1p2
/dev/mmcblk0p1 /dev/mmcblk1boot0 /dev/mmcblk1p1

If these appear you should be able to use dd to clone your eMMC to the SD card. Try this and let me know what you find. Use a card larger than the eMMC so the command won’t fail if your SD card is a bit smaller than the eMMC, that is why I suggest an 8GB card.

Hope this helps, If your card doesn’t “hot plug” post the links to what procedures you’ve found and I can try to help you follow the one I think should work with the least hassle.

Hi Wally,

Thanks for getting back. Missed getting back yesterday- I’ll try following your suggestions tonight.

(I’m a bit fearful of accidentally altering the board I’m trying to copy).

Canis