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.

Join the Conversation

3 Comments

  1. 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

    1. 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

Leave a comment

Leave a Reply to Michael Darling Cancel reply

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