How to make a bootable disk copy for BBBw? I have flashed eMMC with pre-built image (buster), and installed and updated some deb packages and application programs. I would like to make it as a new pre-built image for easy production release. Any suggestions are greatly appreciated.
Oh, in that case, just dd the file system to a USB Flash drive. Sync’ing it back to the eMMC will be a little fun, as the USB flash isn’t bootable* if the eMMC is blank… (not by default, but thru u-boot, you can run the correct sequence of commands…)
I am currently flashing eMMC with BalenaEtcher. Can you give me a little more details regarding Sync-ing it back to eMMC? using dd command? The u-boot is also flashed using dd command. I am not sure that there is a way to combine u-boot and debian image into one to flash back to eMMC?
While it’s trivial to backup the image to USB from the eMMC.
You need to boot into ‘something’ that is not the eMMC, to use dd to write back to the eMMC.
U-Boot, does support reading from USB devices. So while in U-Boot, you’ll need to init the USB Flash Drive, read the USB Flash drive, thus load the kernel/dtb and ‘boot’ into the USB… Then dd from the USB to eMMC…
For testing, I think I can create a bootable USB, then dd from USB back to blank eMMC. ( In this case, is the u-boot automatically included/combined from the backed up image?)
Final goal is to ship the image to a vendor to flash the eMMC. Hope that image format can be used by them.
I tried it out on BeagleBone Black wireless dev board by running the script:
It finished copying everything from eMMC to SD card. But after I rebooted the BBBw from the original eMMC ( I had to add root=/dev/mmcblk1p1 and remove the cmdline= in order to boot ), it seems that the original eMMC copy has corrupted:
sudo ifconfig doesn’t. Wifi failed. I can reflash the BBBw with prebuild image through usb. I am ok to bring the BBBw back. I am more concerned with a successful duplicate eMMC into a SD Card image. Also, even it is duplicated into SD card, is there a way to create an image as bone-debian-10.0-iot-armhf—.img.xz file format? So the image file can be transferred?
I recovered BBBw and the SD card image is good from eMMC, even though eMMC got corrupted. I booted from SD card, and dd eMMC into SD card as an image file. And then converted into xz file format.
I dd-ed the entire driver mmcblk1 and only the mmcblk1p1 partition. Don’t know mmcblk1p1 partition is enough as bootable image ( u-boot is also included in that partition, I guess). I am going to test them out.
eMMC is successfully flashed using the SD card that was created from original eMMC. Only one small issue that after eMMC is flashed, I have to edit uENV to change/set root=/dev/mmcblk1p1, otherwise, it won’t root from eMMC.
The .img file created from mmcblk1p1 partition (converted to .img.xz) cannot be flashing using BalenaEtcher. It complains “no bootable partition”. I am wondering any way to add bootable partition. The script to flash eMMC from SD card must have created a bootable partition in the process, am I right?