Extracting eMMC content of Dragonboard 410c


#1

Hey guys, I installed some applications on my Board and changed some stuffs. I need to do the same for a bunch of board, is there a way to extract to content of the emmc of the first board and store it in an sd-card to flash other boards? It will spare me a lot of times typing commands and installing stuffs.
Thank you


Requesting help with two issues: cloning a custom image and installing a fresh image
How to generate sdcard installation image?
#2

Good question, I’d also be interested to know if a system level backup is possible.


#3

I have used dd to install the boot partition after recompiling, this works great:

sudo dd if=boot-db410c.img of=/dev/mmcblk0p8

I imagine that you can use dd to copy the partitions to a SDCard, and then use dd to copy from the SD card back to your new system. I haven’t tried it, but I suspect that a variant of this command is a possible solution for you.

Full disclosure, I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.


#4

Cheers LJ.


#5

Thanks I’ll try this.


#6

HI, Hicham. I also want to know if is there a way to extract to content of the emmc of the first board and store it in an sd-card to flash other boards(as you mention),if you had already solved the problems?
Thank you very much!


#7

Same question here ! Thanks in advance


#8

Same here. How to simply connect to the board with a microUSB cable and save the content of the eMMC to an image.


#9

There’s no easy way to copy out the eMMC content using a microUSB cable.

The simplest approach would be to shutdown cleanly, then boot the DB410C from SD card and use regular Unix commands, such as dd, to copy the contents of the onboard eMMC to the SD card.

For example:

dd if=/dev/mmcblk0pXX of=YY.image bs=4096

What is the fastest way to copy the entire eMMC content to another DragonBoard?
#10

@danielt, in my DragonBoard I see mmcblk0p1, mmcblk0p2 , …, mmcblk0p10, and also mmcblk1p1, …

So your ‘XX’ refers to what? Should I do this command to each one of them? (that won’t be nice). When I flash the DragonBoard I used only 3 images: bootloader, boot and rootfs, so I guess the reverse should create around 3 images as well…

If you can clarify it more it would be great.


#11

Sorry. I assumed you’d know which filesystems you wanted to backup.

To find out what filesystems are mounted by default (and therefore which ones you might need to backup) try:

mount | grep mmcblk0

#12

Thanks!

This method that you suggest basically will save 7GB - bitwise. Is there a way to ‘shrink’ the image, in a similar way to the images made by Linaro? I guess most of the image is empty…

In addition, do you think that booting from the SD card is crucial, or can I simply boot from the eMMC?

Moreover, after I create the image, can I burn it to the eMMC using the microUSB with the fastboot, or must I do it by booting with an SD card and doing the reverse operation with ‘DD’?


#13

yes, you are correct.

to shrink the image you can use ‘cp’ instead but you need to be cautious and ensure:

  • you preserve all files attributes when you copy (cp -a should be enough)
  • you make sure you don’t have any mount point in your source folder which is being cp’d.
  • you use a dst file system which is Linux friendly (ext4 but no FAT)

the Linaro images are ext4 images. when we create the image we make them as small as possible to fit the content. then the image is converted to sparse image using img2simg utility. on first boot the file system is resized to match the size of the physical partition.

so if you want to implement something similar you need resize the file system before doing the copy/mirroring.


#14

There are any number of more space efficient ways to clone a Linux filesystem and none are unique to 96Boards so you can trying hunting them down using a search engine if you want to.

However a simple way to save size is simply to pipe the image through gzip (if the disk you are copying contains never used space then this tends to compress very well). Something like:

dd if=/dev/mmcblk0pXX bs=4096 | gzip > YY.img.gz

If you boot from eMMC then the filesystem will be in use and may change whilst you are copying it which can result in some files being corrupt. As with the reduced size copy there are alternative approaches possible (including just hoping for the best). You are welcome to research alternatives but booting from SD card is simple, convenient and robust so its what I recommend. Install instructions are here (middle section):