Re: Backing up contents of eMMC

4,831 views
Skip to first unread message

Aubrey Sheldon

unread,
May 10, 2013, 7:38:33 AM5/10/13
to beagl...@googlegroups.com
So far I haven't been able to get mine updated.  I'd very much like to find an .img file that would work by being loaded onto an SD card with something like Win32diskimager.  I'm enough of a newbie to Linux that I haven't learned nearly enough about things like this to do it myself.  At 71, I'm a little slow picking up things I've read, but I'm working on it so please don't flame me for asking.

Jim - W0EB
_______________________________________________________________________________

On Monday, May 6, 2013 11:58:20 PM UTC-5, nrcs...@gmail.com wrote:
Hello,

I have managed to update my eMMC using Robert's awesome script. Now I'm wondering: how do I do the reverse? I would like to take what's currently on the eMMC and make an image file out of it for distribution. What's the best way to accomplish this?

Thanks for your help!

Nick

Aubrey Sheldon

unread,
May 10, 2013, 5:36:22 PM5/10/13
to beagl...@googlegroups.com

I have to retract my previous statements.  Today, the install disks arrived in the mail for Debian and I installed it on my desktop computer - dual boot with Windows 7 Pro.  I followed Robert's instructions and after a few misunderstandings I figured out all the parts of the script.  I did have to go out to the Debian website and install some missing dependencies that my Distro couldn't find (mainly u-boot-tools) but that turned out to be a piece of cake.  I managed to get the image installed onto a 16 gig micro SD card and it boots just fine on the BeagleBone Black.  Now all I have to do is get the user and passwords changed and figure out how to install and run one of the GUI's.  Good learning experience.  BTW, FLDIGI installed just fine using apt-get -- I do have a sound card dependency to resolve before it will run but that was because I didn't have it plugged into the hub when I did the FLDIGI install.

Thanks Robert for that published script -- it was a big help once I waded through it.

Jim - W0EB

Jason Stapels

unread,
May 12, 2013, 8:59:07 PM5/12/13
to beagl...@googlegroups.com, nrcs...@gmail.com
If you have access to a remote Linux / Mac system, you could use an SSH pipe to dump the contents of the MMC. I don't have a board handy to verify this, but it should work.

(From the BBB)
$ sync ; dd if=/dev/mmcblk0 bs=1M | ssh user@local_ip 'dd of=/path/to/image/myBBB.img bs=1M'
(Should ask for you for SSH password here, just enter it and press enter)

Be warned! This is kind of a hack. Try not to use the board while you're dumping the image as it'll increase the risk of corrupted log files. Ideally, you should really be running those commands after booting from the SDCard so you know processes aren't trying to access the MMC while you're trying to dump it.

Britton Kerin

unread,
May 19, 2013, 1:21:01 PM5/19/13
to beagl...@googlegroups.com
I think it would be good to ship BBB with an SD card backup of the eMMC
out of the box. Preferably on an 'industrial' type SD card (these so far seem
to work way better than the consumer electronics ones).

Britton

On Fri, May 17, 2013 at 7:51 PM, Duane Johnson <duane....@gmail.com> wrote:
> Very helpful, thank you.
>
> SSHing to my Mac I had to alter the 1M to 1m:
>
> dd if=/dev/mmcblk0 bs=1M | ssh du...@192.168.2.1 'dd
> of=/Users/duane/Desktop/origBBB.img bs=1m'
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Gerald Coley

unread,
May 19, 2013, 1:25:40 PM5/19/13
to beagl...@googlegroups.com
OK. So $45 goes to $65 or $75. Will that be an isuue for anyone?

Gerald


--
Gerald
 

William Hermans

unread,
May 19, 2013, 3:02:56 PM5/19/13
to beagl...@googlegroups.com
- OK. So $45 goes to $65 or $75. Will that be an isuue for anyone?

- Gerald

Not as long as that includes a second beaglebone black. 

Seriously though, no do not need a SD card to ship with the bbb . . .

Duane Johnson

unread,
May 19, 2013, 3:22:12 PM5/19/13
to beagl...@googlegroups.com
I like the idea but agree it shouldn't be mandatory. It would be a nice-to-have option, say a $20 upgrade or something.

Duane


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/vnXk58eMaPc/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Robert P. J. Day

unread,
May 19, 2013, 3:28:42 PM5/19/13
to beagl...@googlegroups.com
On Sun, 19 May 2013, Duane Johnson wrote:

> I like the idea [of an optional SD card] but agree it shouldn't be
> mandatory. It would be a nice-to-have option, say a $20 upgrade or
> something.

bad idea. the beauty of the sale of the BBB is that there is *one*
product, and for your money, you get that one product. it's a single
box, and everybody gets the same thing. the instant you start adding
options, someone has to read the order carefully, add extra doodads,
possibly requiring a larger box and so on, maybe increasing the
value, which could affect customs or duty ... etc etc etc.

regardless of how complete you try to be, some people are going to
have problems for no apparent reason. i can't see a good defence for
complicating the purchase process for the occasional glitch. just
leave it the way it is, and allow people to get everything they need
via downloads.

rday

--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================


Duane Johnson

unread,
May 21, 2013, 6:02:09 PM5/21/13
to beagl...@googlegroups.com
The frustrating experience that led me to want this was:

1. opkg update; opkg upgrade
2. restart

OMG, my BBB is dead.

It wasn't obvious to me (a new user) what version "shipped" with the BBB. It was relatively hard to get it back to a working state. Sucked the joy out of it for sure :)

Duane


On Tue, May 21, 2013 at 3:01 PM, <digita...@gmail.com> wrote:
I've only just got my BBB but so far I can't see any reason whatsover for shipping an SD card, industrial strength or otherwise. The original, or even upgraded image can be easily downloaded and flashed to eMMC with very little effort.
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/vnXk58eMaPc/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Gerald Coley

unread,
May 21, 2013, 6:34:34 PM5/21/13
to beagl...@googlegroups.com
Did you read the card that came in the box?


Gerald


--

Britton Kerin

unread,
Jun 2, 2013, 9:22:04 PM6/2/13
to beagl...@googlegroups.com
On Sun, May 19, 2013 at 9:25 AM, Gerald Coley <ger...@beagleboard.org> wrote:
> OK. So $45 goes to $65 or $75. Will that be an isuue for anyone?

No, it goes to about $53, and probably a lot less if you're doing a lot
of these:

http://www.mouser.com/Search/ProductDetail.aspx?R=AP-MSD04GCS4P-TMvirtualkey51630000virtualkey908-AP-MSD04GCS4P-TM

These have eliminated all the awful problems caused by the cheap SD cards my
BBW came with. From all the flash problems people have had with BBB I bet
it would have been worth it for them too.

Britton

Gerald Coley

unread,
Jun 2, 2013, 9:47:04 PM6/2/13
to beagl...@googlegroups.com
Exactly what Flash problems are you referring to?

Gerald



--
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.
For more options, visit https://groups.google.com/groups/opt_out.


Juanjo

unread,
Jun 3, 2013, 1:19:08 AM6/3/13
to beagl...@googlegroups.com
BTW,

Those on Robert's Debian image might want to try flashybrid. Basically a bunch of scripts that mount the filesystems ro and mount on top of them a ramfs with the corresponding commands to sync the ramfs overlay on the flash/sd. I use it to make my SD/eMMC last longer.

Anyway I haven't find the datasheet of the eMMC used on the BBB to have a ballpark on it's life :(

The beauty of the sysboot pins is that even if you break your eMMC you always can boot from uSD; please note that the factory shipped uBoot has some environment variables to always try uSD first in case it is plugged (importing uEnv.txt from it) but those variables can be changed; that would solve the problem people that want to use the uSD as storage and have to put the VFAT partition on it to boot.

William Hermans

unread,
Jun 3, 2013, 3:24:44 AM6/3/13
to beagl...@googlegroups.com
I do not think there is any kind / brand of SD that is immune to user error .  ..

Britton Kerin

unread,
Jun 3, 2013, 1:15:54 PM6/3/13
to beagl...@googlegroups.com
On Sun, Jun 2, 2013 at 5:47 PM, Gerald Coley <ger...@beagleboard.org> wrote:
> Exactly what Flash problems are you referring to?

Out of three different 4G SD cards (two then came with bones, one
cheap one that I bought), 2/3 died. One eventually became completely
unbootable, the other would frequently cause the terminal to freeze
for 10 or 20 seconds at a time after a command, and occasionally
caused errors in fread() etc. My app does quite a lot of small
writes, and uses the watchdog so there were a lot of inadvertent power
cycles involved in some stages of development.

Incidentally, my smartphone SD card also died after first becoming
gradually less and less reliable and eating/munging data. And the one
in my camera silently ate a bunch of photos.

Your average SD card is *really* unreliable. The APacer SD cards I
replaced them with have so far entirely obviated these problems
(through quite a lot more development work).

Of course I originally thought SD cards were reliable, since they are
so common and tended to blame the bone. I would try to avoid
blemishing your lovely creation with them if possible (eMMC is great,
but many people are still likely to try to use SD cards for one reason
or another and have bad experiences).

Britton

Britton Kerin

unread,
Jun 3, 2013, 1:18:54 PM6/3/13
to beagl...@googlegroups.com
On Sun, Jun 2, 2013 at 5:47 PM, Gerald Coley <ger...@beagleboard.org> wrote:
> Exactly what Flash problems are you referring to?

The two failed SD cards mentioned in my last email also couldn't be
read with the widely used dd backup method once they were broken.

Britton

Gerald Coley

unread,
Jun 3, 2013, 1:24:41 PM6/3/13
to beagl...@googlegroups.com
I would like put more expensive cards in the box, but that would raise the price of the product, significantly, and I am sure everyone will complain about that. Plus sooner or later they will buy more cards, all of them cheap, and end up at the same point anyway.

This was the reason for going to eMMC, which a lot of people do not seem to like because they prefer the uSD cards.

So, there is no winning solution for this other than to keep telling people SD card are not reliable as they are made out of Flash that nobody wants and they count on the controller identifying those bad blacks and not use them. But then the more bad clocks go bad and you get stuck.

So, if you need a more reliable solution, you need to buy the expensive solution form the SD card providers.


Gerald



Britton

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


Gerald Coley

unread,
Jun 5, 2013, 8:59:34 AM6/5/13
to beagl...@googlegroups.com
A 2A is NOT required. A GOOD power supply is required. Do not confuse amperage rating with a GOOD power supply. 

Gerald


On Wed, Jun 5, 2013 at 7:52 AM, <cwrse...@gmail.com> wrote:


On Monday, June 3, 2013 6:24:41 PM UTC+1, Gerald wrote:
I would like put more expensive cards in the box, but that would raise the price of the product, significantly, and I am sure everyone will complain about that. Plus sooner or later they will buy more cards, all of them cheap, and end up at the same point anyway.

This was the reason for going to eMMC, which a lot of people do not seem to like because they prefer the uSD cards.

So, there is no winning solution for this other than to keep telling people SD card are not reliable as they are made out of Flash that nobody wants and they count on the controller identifying those bad blacks and not use them. But then the more bad clocks go bad and you get stuck.

So, if you need a more reliable solution, you need to buy the expensive solution form the SD card providers.


Gerald

 
I suspect that part of the problem is that the BeagleBone Black was designed for a difference use-case to that of its current purchasers.

From my own case, I know that uSD cards are unreliable, but I boot from one anyway.  That lets me reboot from the eMMC if all goes
sideways (and sometimes in developing software that does happen ...) and use Ubuntu rather than Angstrom, since thanks to Robert
Wilson it's easier to modify.  I use a cross-compiler to limit the load on the uSD card, and keep everything on the card backed up.
When I've got everything working I'll copy the files across to the eMMC and boot from there, freeing the uSD for data.

I'd be inclined not to add a reliable, hence expensive, uSD card to the BeagleBone Black kit; just keep the list of known-good cards
up to date.

The other problem starting out is adding a battery-backed clock.  Since it's apparently expected that the BeagleBone Black will be
used only with a permanent net connection it doesn't need a clock; but in my case, for instance, it won't be used anywhere near
a network.  That means installing a clock, especially since I haven't used an OS without one for thirty years, and that was CP/M 2.2
which didn't even have a date-stamped file system.  Anyway, make gets upset without one.

Building the hardware trivial, albeit the clock was half the price of the board,  but getting a working SPI port (I'm using a DS3234, since
I need SPI for other reasons) not so easy.  Most of the information can be found somewhere, but it's taken me two weeks with Google
to find out where.

Finally, if you want to limit the number of user problems, write in in large red letters across the top of every forum page:
  GET A REGULATED 5V 2A POWER SUPPLY !!!!!

Will

"Five exclamation marks, the sure sign of a diseased mind." 
  -- T Pratchett.

 

--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Michael Darling

unread,
Sep 11, 2013, 5:59:24 AM9/11/13
to beagl...@googlegroups.com, nrcs...@gmail.com, duane....@gmail.com
I'm trying to do the same thing, but end up with the data transfer stalling and eventually displaying an error message about a broken pipe.  I can confirm that no additional data is being transferred by running "ls -l *.img" on my Mac and checking the size of the file in bytes.  The size grows with repeated calls, but eventually stops. If I try executing anything in the BeagleBone terminal, the "dd" command returns with the broken pipe error.

I have made sure that my Mac is set up for Remote Login  from System Preferences -> Sharing -> Remote Login, and confirmed that I can "ssh" into the Mac from the BeagleBone.
I am executing the following command from the BeagleBone:

     root@beaglebone:~# dd if=/dev/mmcblk0 bs=1M | ssh michael...@192.168.7.1 'dd of=/Users/michaeldarling/Desktop/BBB_Angstrom_Backup.img bs=1m'


Is it possible that the transfer was completed correctly?  I end up with a final byte size of 1,919,287,296 for BBB_Angstrom_Backup.img, but I am not sure what size the file should actually be.  I tried to compare md5sums of the BBB_Angstrom_Backup.img and /dev/mmcblk0 but they do not match -- should they?

Any tips?


On Friday, May 17, 2013 8:51:29 PM UTC-7, Duane Johnson wrote:
Very helpful, thank you.

SSHing to my Mac I had to alter the 1M to 1m:

dd if=/dev/mmcblk0 bs=1M | ssh du...@192.168.2.1 'dd of=/Users/duane/Desktop/origBBB.img bs=1m'


On Sunday, May 12, 2013 6:59:07 PM UTC-6, Jason Stapels wrote:

Dale Schaafsma

unread,
Sep 11, 2013, 2:11:19 PM9/11/13
to beagl...@googlegroups.com, nrcs...@gmail.com, duane....@gmail.com
md5sum for the raw device won't be the same as for the running system...the only way you'd have a shot at having the md5's match is if you boot off of an SD card. Which actually is probably a better idea since a running system is going to modify the data you're trying to backup.

You might want to make sure that your BBB & Mac are on a wired network, the broken pipe sounds like you're maybe seeing network drops?
I'd also make sure that for each attempt that you're trying a new filename (more precisely a file that doesn't exist at the start of the dd).

As a last resort, you can start trying to look at whether packets are streaming across correctly with wireshark/tcpdump.

-Dale
ps. this process worked ok for me going to a Debian laptop.

Michael Darling

unread,
Sep 11, 2013, 3:19:26 PM9/11/13
to beagl...@googlegroups.com
I finally got it to work by changing (creating) the ~/.ssh/config file on my Mac to include the lines:

ServerAliveInterval 300
ServerAliveCountMax 3
ClientAliveInterval 300
ClientAliveCountMax 3

The transfer also seemed to occur much faster than what I was trying before.  Thanks for the tips anyways, Dale!


--
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/vnXk58eMaPc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Michael Darling

unread,
Nov 11, 2013, 9:39:02 PM11/11/13
to beagl...@googlegroups.com
Just wondering, has anyone tried to restore an image using the reverse of this process?  I can't seem to restore my "bricked" BBB.  I would like to restore to my most recent backup so that I can get on with my thesis, but I'm struggling to get this working. I've tried the reversing the command, while booting the BBB from the microSD with an Ubuntu image, but /dev/mmcblk0p2 won't unmount.

Any help is much appreciated!

Thanks,
Mike
To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.

Michael Darling

unread,
Nov 12, 2013, 3:59:00 PM11/12/13
to beagl...@googlegroups.com
To follow up, I was eventually able to restore my image using the "dd" command with ssh. It turns out that when you boot from the microSD the eMMC is actually mmcblk1 -- not mmcblk0. I was confused by that because the examples that I found on the internet all copied from mmcblk0, assuming you were creating a backup while booted from the eMMC. Even those examples conceded that it would be wiser to be booted from the microSD while backing up to avoid potential corruption of the image.

For me, the following commands worked:

To create a backup:
1) Create a bootable microSD with a standalone image (Not an eMMC flasher image.  I used Ubuntu http://elinux.org/BeagleBoardUbuntu#Raring_13.04_armhf)
2) Insert the microSD card with the board powered off. I think the board should automatically boot from the microSD card when power is applied.
3) Connect to the BBB through ssh
4) From the BBB, copy the eMMC contents to the host computer
sudo dd if=/dev/mmcblk1 bs=1M | ssh mdar...@192.168.7.1 "dd of=/home/mdarling/Desktop/BBB_Backup.img bs = 1M"

To restore the backup:
1) Boot from a microSD card as described above
2) Connect to the BBB via ssh
3) From the BBB,
ssh mdar...@192.168.7.1 "dd if=/home/mdarling/Desktop/BBB_Backup.img bs=1M" | sudo dd of=/dev/mmcblk1 bs=1M

For me, a backup/restore using the "dd" method took under 10 minutes.


- Mike


To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages