How to backup BBB eMMC card

Ok, so you’ve been playing with your BBB and you’ve installed this package and that package, oh and that package you forgot about.  So now you want to setup another BBB in exactly the same way but wait… oh no, what did you install again and how did you configure things… this could take some time.

That was me recently when I wanted to set up a second BBB.  I’d installed qt4-embedded on the eMMC as well as lots of other stuff and really didn’t want to start from scratch on another board.

Fortunately there is a way to make a copy of the file system on the eMMC.  First thing though is to download and write a BBB disk image to an SD card.  This new card is then inserted into the BBB so that it can boot without needing access to the eMMC.

The idea is that once booted, we can ssh into the BBB and use the linux dd program to create a disk image.  We do however need somewhere to put the image that we create and fortunately we can get the dd program to push the created image out via an ssh pipe.

dd if=/dev/mmcblk0 bs=1M | ssh martin@192.168.1.67 'dd of=/home/martin/Documents/path/to/backup/origBBB.img bs=1M'

This will create an image file at the specified location – obviously you will need to change the IP address and path to suit your intended destination.

3 Responses to How to backup BBB eMMC card

  • Michael Darling says:

    Hi, Martin. I’ve used your “How to backup BBB eMMC card” post to create a backup image. I’ve somehow bricked my BBB and want to restore it from the image I’ve saved so I can get back to my thesis. I’ve tried doing the reverse, but I end up with:

    dd: /dev/mmcblk0: Permission denied
    Pseudo-terminal will not be allocated because stdin is not a terminal.

    I’m trying to do this on a Mac, so I had to modify your command to read something like:
    root@beaglebone:~# dd if=/dev/mmcblk0 bs=1M | ssh michael@192.168.7.1 ‘dd of=/Users/michael/Desktop/BBB_Angstrom_Backup.img bs=1m’

    As I said, I tried reversing that to read variations of:
    michael$ sudo dd if=BBB_OpenCV_30fps.img bs=1m | ssh ubuntu@192.168.7.2 `dd of=/dev/mmcblk0 bs=1m`

    Can you offer any tips?

    Thanks,
    Mike

    • Martin says:

      Hi Mike,
      It sounds like somehow you have corrupted the contents of the eMMC but that does not mean your BBB is bricked (which would tend to mean unrecoverable without Jtag or similar). Having said that, if the eMMC is corrupt then presumably the BBB is not booting correctly and therefore that would explain why you cannot connect via SSH.
      I think your best option is to write an image (could be that image or a generic one) to an external SD card then plug that in and boot to that. The onboard eMMC will not then be in use and once the BBB is alive, you can then try writing the image back to the eMMC using the technique above.
      Let me know how you get on

  • Tumbleweed says:

    Thanks for this tutorial. Another alternative is to simply backup the eMMC to a microSD card and then restore that image to the same (or another) BBB when needed. The instructions are provided here:

    http://elinux.org/BeagleBone_Black_Extracting_eMMC_contents

    I’ve found this very useful for replicating the same eMMC image onto multiple BBBs.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>