eMMC backup
#1
Simple question, how to backup OS installed on eMMC?
#2
Where are you looking to back it up? on an SD drive? a USB drive? Another local host? cloud or similar?
------
it doesn't get happy
it doesn't get sad
it just runs programs
#3
(06-30-2017, 12:26 PM)zer0sig Wrote: Where are you looking to back it up? on an SD drive? a USB drive? Another local host? cloud or similar?

USB drive.
#4
Any feedback?
#5
(07-01-2017, 03:52 PM)amilino Wrote: Any feedback?

hi,  you use a dangerous tool called  dd  to write an 'image' file to another device, like usb, and then you compress it with gzip.

dd stands for 'humorously'   Disk Destroyer

kidding;

... be careful ;  it will destroy your drives if you're not careful or don't know what you're doing.

read the man page:   man dd

Join us on chat (see below for irc address) and we'll help you with it.
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )
#6
Information 
The basic idea is to use dd to read the eMMC, and save it to a file. To image the eMMC, it's best to boot from a SD image, so you don't have to deal with issues from backup up a "live" system. When you boot from the microSD, the eMMC is visible as /dev/mmcblk1. You'll want some progress whilst copying, and you'll probably want to compress the file so you don't have a 16GB file which really only has around 3GB of stuff in it. Hence the use of gzip, as it'll compress stuff a bit, and also ignore all the empty space.

So you could do something like this (where /media/pine64/64GB_USB3 was the mount folder for my usb drive, and eMMC_backup.img.gz was the name I chose to save the file as):


Code:
dd status=progress bs=512 if=/dev/mmcblk1 | gzip > /media/pine64/64GB_USB3/eMMC_backup.img.gz

But we can do better than that. gzip is a bit slow still, it only uses one of the four pinebook cpu cores, which seems a bit of waste, as that wil make it so the copy will take a quite a long time. pigz, on the other hand, is a gzip compatiable compressor with a difference... it will use all the cpu cores available. Consequently a 2516 second transfer instead took 970 seconds, just by switching to pigz. And is even faster if the  --fast parameter is used, still with light compression and no storage of empty space benefits. So my prefered option, after doing a sudo apt install pigz to install it, is the following:


Code:
dd status=progress bs=512 if=/dev/mmcblk1 | pigz --fast > /media/pine64/64GB_USB3/eMMC_backup.img.gz


And to restore the backup? The traditional:

Code:
gunzip -c /media/pine64/64GB_USB3/eMMC_backup.img.gz | dd of=/dev/mmblk1 bs=512 status=progress 

or the much faster:

Code:
pigz -d -c /media/pine64/64GB_USB3/eMMC_backup.img.gz | dd of=/dev/mmblk1 bs=512 status=progress

should do the trick. However, since the of parameter of good 'ol disk destroyer is being used here... make sure you don't type this one wrong.... as you might find yourself writing the image to the wrong drive with disasterous consequences!
And as a side note, as the OP found out, if you are using NTFS formatted drives, ntfs-3g isn't installed by default, so a quick sudo apt install ntfs-3g is needed to enable NTFS write support.
#7
For backup purposes maybe also look into dcfldd , which is a fork of dd that also supports hashing and verification on the fly...
Come have a chat in the Pine IRC channel >>
#8
Thank you, it is working. Created backup successfully.
#9
pfeerick's suggestion is probably what I would do. It is clear, works on almost any unix-type OS build from the past 30-35 years (though I doubt you'll find pigz easily available for early 90s SCO boxen, heh), and it's good to know what these userland utils do.
------
it doesn't get happy
it doesn't get sad
it just runs programs
#10
(07-03-2017, 10:49 AM)zer0sig Wrote: pfeerick's suggestion is probably what I would do. It is clear, works on almost any unix-tpe OS build fro the past 30-35 years (though I doubt you'll find pigz easily available for early 90s SCO boxen, heh), and it's good to know what these userland utils do.


Indeed !   ... and pfeerick was actually brave enough to explain it on-line , in front of God and everyone , without qualification and with poise !   (and the OP actually used it without destroying anything!)    (impressive)

Tongue
marcushh777    Cool

please join us for a chat @  irc.pine64.xyz:6667   or ssl  irc.pine64.xyz:6697

( I regret that I am not able to respond to personal messages;  let's meet on irc! )


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinebook with a broken screen and 2 eMMC's for sale. UK ONLY. frank-zappa 0 1,937 03-08-2022, 10:14 AM
Last Post: frank-zappa
  How to transfer customised OS from SDcard to emmc quixote 1 4,090 01-07-2022, 06:38 AM
Last Post: alanwake82
  eMMC boot linux distros for Pinebook. frank-zappa 14 23,312 09-06-2019, 08:39 AM
Last Post: frank-zappa
  These fell out of my Pinebook when I tried to replace the eMMC. frank-zappa 6 8,863 03-02-2019, 06:51 AM
Last Post: frank-zappa
  Is it possible to choose between SD/eMMC boot programmatically? UltraBloxX 2 5,374 01-28-2019, 11:41 AM
Last Post: UltraBloxX
  Move Installation from SD Card to eMMC? soupbowl 4 9,687 11-10-2018, 10:47 AM
Last Post: acruhl
  Dual Boot on eMMC? d97 1 3,885 08-30-2017, 10:04 AM
Last Post: abrmx
Question Whether 64GB emmc for Pinebook Siliconserf 7 9,896 08-19-2017, 06:50 AM
Last Post: combs
  Pinebook wont boot from eMMC priyamjani 2 4,546 08-06-2017, 09:22 AM
Last Post: priyamjani
  SD CARD - EMMC jmbernabotto 3 6,195 07-14-2017, 12:54 AM
Last Post: pfeerick

Forum Jump:


Users browsing this thread: 1 Guest(s)