Preserving flashable eMMC image

38 views
Skip to first unread message

rattus

unread,
May 14, 2015, 10:02:59 PM5/14/15
to beagl...@googlegroups.com
Hi - I'm making many changes to the contents of my eMMC, and will need to clone this to other BBB devices. How would I dump an eMMC-flashable image to SD card to be able to produce clones?

Robert Nelson

unread,
May 14, 2015, 10:46:17 PM5/14/15
to Beagle Board
Depending on "cat /etc/dogtag" there's any easy answer. ;)

Regards,

--
Robert Nelson
https://rcn-ee.com/

gehl...@gmail.com

unread,
Oct 31, 2015, 1:29:56 PM10/31/15
to beagl...@googlegroups.com
Hi - revisiting this after a hiatus...

My /etc/dogtag gives: 

rcn-ee.net console Debian Image 2015-05-08

I want to preserve this image as a "known good" before I start screwing with the newer kernels and device tree again...

Thanks,

Mike


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/8G61AQECz08/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Oct 31, 2015, 1:35:28 PM10/31/15
to beagl...@googlegroups.com
Hi mike,

Any reason why you do not wish to use an sd card ? For "screwing around" with ? It makes things really easy to change, and backup. Plus it is not really that much slower than the eMMC. At least, I've not been able to tell much of a difference.

You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

gehl...@gmail.com

unread,
Oct 31, 2015, 1:54:46 PM10/31/15
to beagl...@googlegroups.com
I have made many mods to my eMMC image, and wish to preserve it as my "gold master", so that it may be flashed onto my other BBBs.

Is there a documented procedure to dump my eMMC image onto an SD card?

Thanks, 

Mike

arsi

unread,
Oct 31, 2015, 2:52:45 PM10/31/15
to beagl...@googlegroups.com
Hi,

I'm doing a backup via rsync over SSH to a directory on my Linux PC..


10.0.12.100 - beagle
/disk2/beagleBackup - dir on PC

To dir on PC:

sudo rsync -aAXv  ro...@10.0.12.100:/*
/disk2/beagleBackup --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}

Back to beagle ..booted from SD card, flash mounted to /tmp/rootfs

sudo rsync -aAXv
/disk2/beagleBackup/* root@10.0.12.100:/tmp/rootfs


Here is my modified version of beaglebone-black-copy-microSD-to-eMMC.sh ( format flash, copy uboot and mount flash to /tmp/rootfs)

#!/bin/bash
#
# Copyright (c) 2013 Robert Nelson <robert...@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

    if ! id | grep -q root; then
    echo "must be run as root"
    exit
    fi
   
    source="/dev/mmcblk0"
    destination="/dev/mmcblk1"
    mkfs.vfat -F 16 ${destination}p1
    mkfs.ext4 ${destination}p2
    mount ${destination}p1 /mnt/flashBoot
    mount ${source}p1 /mnt/boot
    cp /mnt/boot/* /mnt/flashBoot
    mkdir -p /tmp/rootfs/ || true                                                                                                                                                                                 
    mount ${destination}p2 /tmp/rootfs/                                                                                                                                                                           
    sync                                                                                                                                                                                                          
    echo ""
    echo "This script has now completed it's task"
    echo "-----------------------------"
    echo "Note: Actually unpower the board, a reset [sudo reboot] is not enough."
    echo "-----------------------------"

ArSi




From: Rattus
Sent: Friday, May 15, 2015 4:02AM
To: Beagleboard
Subject: [beagleboard] Preserving flashable eMMC image


gehl...@gmail.com

unread,
Oct 31, 2015, 3:41:33 PM10/31/15
to beagl...@googlegroups.com
Hi Arsi, that was my backup plan, but that's a *little* bit less efficient than a direct write to the SD card on the BBB.

I found Robert's 2 year old eMMC-to-SD script on GitHub; wonder if that's still up-to-date. Guess I'll try!

Mike

--

arsi

unread,
Oct 31, 2015, 4:03:46 PM10/31/15
to beagl...@googlegroups.com
Hi,

I have about 10 versions of images, so this is for me the best solution.. and  micro SD card is easier to lose than NB ;)
A change in my java application are automatically transmitted in the directories.. So there is always the latest version.
I have not measured it, but at least the transfer to the PC is in my opinion faster..
Arsi



From: Mike
Sent: Saturday, October 31, 2015 8:41PM
To: Beagleboard
Subject: Re: [beagleboard] Preserving flashable eMMC image


Robert Nelson

unread,
Oct 31, 2015, 4:14:28 PM10/31/15
to Beagle Board


On Oct 31, 2015 2:41 PM, "mi...@gehlvail.net" <gehl...@gmail.com> wrote:
>
> Hi Arsi, that was my backup plan, but that's a *little* bit less efficient than a direct write to the SD card on the BBB.
>
> I found Robert's 2 year old eMMC-to-SD script on GitHub; wonder if that's still up-to-date. Guess I'll try!

It is, but it's a little risky on old rootfs, specially prior to Sep 2014.. As we made major changes to the location of the boot loader and kernel location on disk, that summer. (Since that major change we haven't broken it.)

I'd recommend, NFS/rsync backup the boot/root.. Install the 2015-07-28 image, double check the new kernel works for you. (3.8.13 based in that image).  Then rsync back just the 'root'.. Double check it still works with your changes.. Then you can use the built in emmc to SD backup across.

Regards,

William Hermans

unread,
Oct 31, 2015, 4:36:07 PM10/31/15
to beagl...@googlegroups.com
Or even rsync to sdcard . . .

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

gehl...@gmail.com

unread,
Oct 31, 2015, 5:10:40 PM10/31/15
to beagl...@googlegroups.com
You're right - the script looks like it was set up for the old /boot/uboot structure. 2 questions:

a) where can I find the 2015-7-28 image? 
b) are we SPI-safe on any of the 4.x images?

Thanks, 

Mike

--

gehl...@gmail.com

unread,
Oct 31, 2015, 5:32:49 PM10/31/15
to beagl...@googlegroups.com
After slapping myself a few times, that's what I ended up doing. dd'ing would be faster, but I was not comfortable that I'd get the options right. 

Next experiment...

You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/8G61AQECz08/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

William Hermans

unread,
Oct 31, 2015, 7:35:39 PM10/31/15
to beagl...@googlegroups.com
You pretty much have 5 options. dd, cp, rsync, tar, and cpio. But if you want a really good discussion about whats best, you can google stuff like "unix exchange rsync" and just read everything. I was actually reading a post last night about rsync versus cp I think.

Anyway, it honestly does not get any easier than rsync -a <source> <destination> . . . But I like dd too for variou occations, as well as tar. I've never realy used cpio but have read about it, and cp . . . well it's not up to snuff if you ask me.

gehl...@gmail.com

unread,
Oct 31, 2015, 7:52:22 PM10/31/15
to beagl...@googlegroups.com
I've found if there are block devices involved, nothing beats dd in terms of speed, if you're within the domain that contains both devices (i.e. BBB has both the eMMC and SD card. Once a network is involved, and in my case, a wireless one, it's network bandwidth that determines the speed.

rsync is great when we're doing incremental updates, but not so much when you just need a block copy.

cpio I haven't touched since the 80's ;-)

any idea of the location of the images?

Robert Nelson

unread,
Oct 31, 2015, 8:01:22 PM10/31/15
to Beagle Board


On Oct 31, 2015 6:52 PM, "mi...@gehlvail.net" <gehl...@gmail.com> wrote:
>
> I've found if there are block devices involved, nothing beats dd in terms of speed, if you're within the domain that contains both devices (i.e. BBB has both the eMMC and SD card. Once a network is involved, and in my case, a wireless one, it's network bandwidth that determines the speed.

bmaptools is faster then dd. ;)

>
> rsync is great when we're doing incremental updates, but not so much when you just need a block copy.
>
> cpio I haven't touched since the 80's ;-)
>
> any idea of the location of the images?

http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#2015-07-28

Regards,

William Hermans

unread,
Oct 31, 2015, 8:46:05 PM10/31/15
to beagl...@googlegroups.com
rsync is great when we're doing incremental updates, but not so much when you just need a block copy.

true enough, but do you honestly need to do more than backup the rootfs most of the time ? Also, for backing up the "MBR", copying the first Meg of the raw block device is all that is needed. Actually more than what is needed but . . .

Regards,

--

William Hermans

unread,
Oct 31, 2015, 8:48:04 PM10/31/15
to beagl...@googlegroups.com
bmaptools is faster then dd. ;)

heh, honestly man, do you sleep at all ? I tried reading up on bmaptools back when you first mentioned it, and I guess started using it. And . . . I do not know. I love to play with new stuff,  but sometimes I guess I just give up, and stick to what I know :(


Reply all
Reply to author
Forward
0 new messages