restoring eMMC backup img

I created a backup of the onboard eMMC filesystem using dd, and compressed and saved it to a microSD card:

dd if=/dev/mmcblk0 | gzip -1 > /media/sda1/sd_backup.img.gz

Can I just unpack the img.gz file, write it to another microSD card with Win32DiskImager and flash this image to the eMMC by holding the boot button (S2) with the SD card inserted to restore the backup?

Thanks in advance.

It is not that simple.

It is hard to give you advice without knowing what tools are at your disposal, but let’s assume you have a linux host and are capable of doing bitbake builds…

  1. Let’s say you have built a bootable, small image for an SD card (for example, the console-image).
  2. Further, let’s say you followed the procedure at:
  3. …and then just after the stage where you do the file system copy to the FS partition:

sudo tar -xzf Angstrom-systemd-image-eglibc-ipk-v2012.12-beaglebone.rootfs.tar.gz -C /mnt/Angstrom
4) You do the additional step of copying your image to the root of the file system:
cp /where-ever/sd_backup.img.gz /mnt/Angstrom
5) Then you unmount both SD partitions from your host (just like in Malloy’s procedure) and boot your BBB with that SD card (holding the button!)
6) Now, once you are all booted up, you would presumably do something like this:
gunzip /sd_backup.img.gz | dd > /dev/mmcblk0
7) Once this is done, do an orderly shutdown, remove the SD, and re-start. Hopefully you are off to the races.

Not so sure about the exact syntax in step #6, but I’ve made a system backup and my strategy is something like I have just mentioned.

I have used a very similar process like this successfully already, but my image was not in the same format as yours.

Once you have an SD card like this, you can always re-mount the FS partition to your host and put a different image in the root directory of the FS. You do not need to do the whole procedure over again. Really, any SD image that boots (without loading itself onto the MMC) will work if there is enough space in the FS partition to place your payload.

Others may have less complicated processes. If so, hopefully they will pipe up. I’m all for learning new stuff myself.

I think that it is important that you have booted up on an SD card so that the emmc is not the active file-system. Given that, you may be able to just:

gunzip your image onto a USB drive from a linux host (Why not? Space probably is not a problem on the USB drive!)
mount your usb drive to your BBB
mkdir /mnt/usb
mount /dev/sda1 /mnt/usb
then dd your image off of /mnt usb onto the emmc

I have not tried the thumb drive process…