Flashing modified Debian on Beaglebone

I’ve flashed Debian 7.1 (kernel 3.8) on my beaglebone black and intalled all the packages I need to build my project. Now, I wanna to create a IMG of the system or something like this to restore it when I need, with the packages already intalled.
How can I do it?

Sorry for the bad english…

Find a microSD >= 2Gb, fully erase microSD via (dd if=/dev/zero of=/dev/sdX)

Plug in microSD, Power board (should boot off eMMC)..

If you downloaded the image off my domain (rcn-ee.net), use the script:

wget https://raw.github.com/RobertCNelson/tools/master/scripts/beaglebone-black-copy-eMMC-to-microSD.sh
chmod +x ./beaglebone-black-copy-eMMC-to-microSD.sh
sudo ./beaglebone-black-copy-eMMC-to-microSD.sh


(eMMC(/dev/mmcblk1) -> microSD(/dev/mmcblk0))
sudo dd if=/dev/mmcblk1 of=/dev/mmcblk0



If I understand your question correctly, you want to install all the packages you need, and then make a backup of the rootfs ? In this case you can remove the sd card from the BBB, put the sd card into a SD card reader on a PC and …

sudo lsblk or fdisk -l
to find which device the SD card is then once you’re sure you know which device it is. Make sure your distro does not automount if it does use umount to remove the mount, or just use the existing mount point as the target.

mkdir /mnt/rootfs
sudo mount /dev/sdx2 /mnt/rootfs
cd /mnt/rootfs

sudo tar -zcvf ~/rootfs.tar.gz .

this places a tarball archive of the rootfs from the sdcard into the current users home directory.
Then when you want to reinstate the backup

sudo tar xzvf rootfs.tar.gz -C ~/mnt/rootfs

Of course when it comes time to reinstate the backup you will have to remount the SD card. First.

I’m trying to do a similar thing, to clone one BBB internal flash to another one. I use the dd command to write the internal flash to the memory card, but when I boot from the memory card I lose the network interface for some reason. Any idea why that could be happening?



I’ve changed my mind… I’ve a img file that I copy to the SD card and boot it in the beaglebone and so the debian is copied to the internal emmc… what I wanna now is edit this img file to it copy debian to the internal emmc with the packages already installed… can I just copy the root of the file system with the packages installed to the partition ROOTFS of the SD card with the flasher image?

Basically here’s what happens with the Debian image you download from beagleboard.org:
The entire installed system on the SD card gets copied to the internal eMMC. If you want to modify anything on the SD card, say to install new packages or change configuration files, it is best to insert the SD card into an SD card reader, mount the card and remove the “flash-eMMC.txt” file from the boot partition. Unmount the SD card and then insert it into the Beaglebone Black and boot to the SD card. Make your changes to the system and then create /boot/uboot/flash-eMMC.txt file before properly shutting the system down (typing halt is sufficient). Now when you boot to the SD card it will copy the SD card contents to the internal eMMC and includes your changes.

Thanks very much, bro! I’ll try this…I can’t believe it was just this hahahah Thanks!

It works! Thanks a lot!