Create a full image to redeploy

Hi,

I’ve searched around and found many related questions but not exactly what I need.

I have a BBB completely set up (including uBoot/kernel/…) and want to make an image that I can give to scientists to replicate my setup. I specifically want to include the bootloader as well.

I used to boot from an sd card and dd the whole /dev/mmcblk1 to an file and redeploy that image to the same block device on the target device. Now, for the first time, this results in a device where the bootloader isn’t starting.

I can’t imagine this isn’t a common thing to do, so I would think better options exist. I believe creating a flasher image won’t copy everything, right?

Thanks,
dieter

For what it’s worth, I use

sudo mount /dev/mmcblk0p2 /mnt/temp/
sudo dd if=/dev/mmcblk1 bs=1M of=/mnt/temp/$1 bs=10M status=progress

in a batch script to create an image, and

sudo mount /dev/mmcblk0p2 /mnt/temp/
sudo dd of=/dev/mmcblk1 bs=1M if=/mnt/temp/$1 bs=1M status=progress

where /dev/mmcblk0p2 is a partition on the sd card where I keep my images.

This depends on the image, for Bullseye i cleaned up this process…

For the BeagleBone Black, there are two directions you can copy:

  • microSD → eMMC
  • eMMC → microSD

microSD → eMMC: (this is how the default flasher is configured)

Copy configuration file:

sudo cp -v /etc/beagle-flasher/beaglebone-black-microsd-to-emmc /etc/default/beagle-flasher

Then enable the “flasher” and reboot the board to have it flash the eMMC:

sudo enable-beagle-flasher

eMMC → microSD

Copy configuration file:

sudo cp -v /etc/beagle-flasher/beaglebone-black-emmc-to-microsd /etc/default/beagle-flasher

Then enable the “flasher” and reboot the board to have it flash the microSD:

sudo enable-beagle-flasher

Regards,

1 Like

I’m afraid I’m using Linux JAGUAR 5.10.162-ti-r58 #1buster SMP PREEMPT Sat Feb 25 19:28:34 UTC 2023 armv7l GNU/Linux.

There is no /etc/beagle-flasher so I presume this is something added to the Bullseye images?
Would this method include the bootloader etc?

I have no idea why the image I made with dd (from the whole block device) fails to even start the bootloader when copied on another BBB. Up until now, that worked fine. Any ideas? I’m lacking lots of knowledge there and find that is becoming a problem from time to time. Decided to start reading up but this has just come up as an issue…

So I back-ported this to buster it just wasn’t in older versions. You can also get u-boot for the BBB with this package bb-u-boot-am335x-evm

sudo apt update
sudo apt install bb-beagle-flasher bb-u-boot-am335x-evm

Can we assume your on the eMMC right now?

I would test:

sudo cp -v /etc/beagle-flasher/beaglebone-black-emmc-to-microsd /etc/default/beagle-flasher

Insert blank microSD, then run, the manual flasher:

sudo beagle-flasher

and watch it copy over your eMMC to microSD…

Then test this new microSD on another device to see if it’s what you expected…

Regards,

Unfortunately I’m at home and only have access through a reverse ssh connection right now, so no access to the SD card :).

The system runs from the eMMC indeed, and that is what I want to copy to another BB eMMC.

Is there any “obvious” reason why an image made with dd would not work for one specific image? Just wondering because up until now that was working and “good enough” for what I needed. I’m really in the dark as to why that could happen and would like to read up on it. I thought that if I copied everything sector-by-sector and the target device was similar to the source, it should work, but the last configured BBB deployment I tried to image that way just won’t work on other boards. Is there an offset of some sorts that needs to be set for some reason? Clearly I’m just guessing, and have not much knowledge…

I’ll test on Friday and report back. In any case, thank you for your help. Truly much appreciated.

dd would work if both devices had the exact same block size…

Hi Robert,

Got it to work but it seems the u-Boot does not get copied. The original BBB (where I made the image from) has 2019.04-g923f8b8 (jan 02 2022), the one on the deployed/new bbb has 2019.04-00002-g07d5700e21 (Mar 06 2020).

I know I can just update the u-Boot on each new deployment, but the idea is that I need to make it as simple as possible for the people using the images. Each option for errors will be exploited ;). Additionally, the network interface is configured to a static IP to be used inside a larger system. So they would have to change the network config, update, change network config again… I can add a shell script for them to run but still…

I realize that having an older version of the bootloader probably isn’t that much of a deal, but as I don’t really know too much about what happens during the imaging process I am wondering what else is missing?

Or maybe I’m wrong and there’s another explanation…

dd would work if both devices had the exact same block size

If anyone ever encounters the same issue as I had (making an image with dd, but having issues when deploying it on a chip with smaller size): I got around the size issue by:

  • mounting the image file to a loopback device (ie /dev/loopXX),
  • then used Parted to resize the partition to fit on the target chip,
  • unmount the image

After that I could use the image just fine.

1 Like

Robert,

Any idea why the bootloader would not get copied but I get an older version on the restored BBB? And most of all, how I could fix this so that it is included?

Thanks!

While it’s not 100% perfect, run beagle-version, to see what it detects, it’s packaged in the bb-beagle-version debian package:

debian@BeagleBone:~$ sudo beagle-version | grep bootloader
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2022.04-gd0771d53 (Jul 21 2022 - 02:13:23 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2022.04-gd0771d53 (Jul 21 2022 - 02:13:23 +0000)]:[location: dd MBR]

Regards,

Hello all.

I have played with am335x-debian-13-base-v5.10-ti-armhf-2025-09-05-4gb image, adjusting it for my company needs. I am able to use it in eMMC and SD card, the beagle-flasher script does well.

Now I just want to create a image from what I have changed and send to my colleague. The thing is, I have tried dd the sd card, but when I dd it back to another sd card, the beagleboneblack does not boot.

Is there a way to create a booting image from either my SD card or eMMC so I can send my colleague and he can play with that?

Thanks in advace.

the beagle-flasher script goes both ways… once you finalize your eMMC, just run it again…

Boot with eMMC, insert new blank microSD, run sudo beagle-flasher

Regards,

But that would flash the SD, right? I actually want an image file so I can send it to my colleague.

Part of the problem every eMMC model varies in actual bits, this is why a straight dd won’t work as the size is different.

It works best to get your image off the eMMC onto a microSD, which you can then image using standard tools, send the image to your other user, and as long as they use a ‘bigger’ microSD, it’ll dd over just fine.

if you stop boot, and use u-boot, you can usb-mount your eMMC, and then get a raw image more easier..

Thanks, that worked, so just for future reference, that is what I did in order to make this to work:

  1. booted from SD and dd if=/dev/mmcblk1 of=/home/image.img bs=10
  2. plugged SD in laptop and copied the image.
  3. The image can be used to boot from SD (sudo dd if=image.img of=/dev/sdx bs=10M)
2 Likes

if you stop boot, and use u-boot, you can usb-mount your eMMC, and then get a raw image more easier..

I only recently found out that you can actually do that using u-boot. Makes me feel like a fool for all the times I booted from an SD card to then image the eMMC to a second partition on the SD card, then finally copy that on a laptop…

Goes on the list of “wish I had know this earlier” :wink:

yeah it’s so useful, but it doesn’t use dma, so there are times the microSD method is faster.. With 4GB RevC it was okay, the RevD has 16GB eMMC.. :wink:

Does documentation exist on how to stop boot and usb-mount the eMMC?

I guess first step would be to setup the BBB as a standalone development platform in a desktop PC configuration like explained here Connecting Up Your BeagleBone Black — BeagleBoard Documentation

Second step would be to stop boot. How can I achieve this?

u-boot.

Try a TTL to USB adapter and use u-boot. Now, about the usb-mount method. No clue. I am not sure about it.

Seth

P.S. So, tio /dev/ttyAMA0 or whatever pops up in the /dev/ files for your TTL to USB adapter will get you to u-boot. I think there is about a second to interrupt the boot process. Type the spacebar over and over once booting to get into u-boot.

1 Like