eMMC backup
#11
I would suggest using tar to make backups. It been with us for ages, is much simpler to use and won't detroy your drive.

Simple recipe:
tar cvzf /media/pine64/uuid/mybackup.tgz /home/pine

this will backup your data in your home folder.
restore using
cd /home/pine64
tar xvzf /media/pine/uuid/mybackup.tgz

c = create, x = extract, z = compress gzip on the fly, v = verbose (if you like to know whats going on;-) f = filename (if absent it will use tapedrives which are there (for your pinebook , I assume you won't have those.

As far as system backup, I keep a SD-card from which installing is only a few minutes. So don't care for system backup.
All extra programs are in an .sh file in my home folder (so this will be in my backup). This consists of a series of apt install commands, so when the pinebook will break another one will be up and running in no time (asuming I will have an internet conection at that time and a spare pinebook ;-)

Jut my 2p,

Erik
Delft.
  Reply
#12
(07-03-2017, 11:58 AM)Erik Wrote: I would suggest using tar to make backups. It been with us for ages, is much simpler to use and won't detroy your drive.


I also prefer tar for backups of filesystems on gnu+linux;  particularly my favorite unix command:

tar  -cvf  -  -C  /home  save_directory  |  tar  -xvf  -

... which, while preserving permissions (and can be run recursively) backs-up the save_directory via standard output! 

-------

Here is the problem with using tar in the case of eMMC:  what we are backing up is actually about seven (or more) partitions !  The only way to really backup the eMMC so that it can be restored is to backup the disk 'image' including all partitions ( this is a bit for bit copy of the disk structure ).  Only dd (or dd like) utility can do this effectively.
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! )
  Reply
#13
I agree with above - it is plausible to create backups of the two unmounted boot partitions with dd and then tar xvfz root, but you'd still have to fdisk and build out 4 partitions before restoring, and while it's pretty easy to feed n,enter,enter,enter,enter,w into fdisk to wite a single partition to a drive, writing 4 of them takes more care and could be a PITA.

now, if you are using the same version of linux as what you backed up, you should be able to overwrite the mounted filesystems using tar, but you will need to install and then untar to the drive.
------
it doesn't get happy
it doesn't get sad
it just runs programs
  Reply
#14
As commented above, for multi-partition / whole drive backups... tar goes out the window with the cat. And dd when used with the if command is perfectly safe, as that is only for read... it's only a worry when you start using the of side of things Wink

But yes, for file system backups, tar is indeed a better choice, especially when used with the -z option so your backup doesn't end up the exact same size as your input (baring file system wastage). 

But I also like Erik's system of using scripts to basically automate the initial setting of up things... I'm slowly working towards that with the rock64 due to wiping it every week or so to try the latest development image, so want to re-install and reconfigure it to a standard working state each time.. so have a configuration script which I can pull from my local network upon logging in for the first time. And soon it will probably start pulling in /home folder backups, but for the moment it is only setting up my preferred login account, installing some basic 'essentials', pulling down a couple of git repos that I want available and restoring ssh keys from my server. All adds up once you realise what you want when you start from scratch!
  Reply
#15
Hi, I have a atrange problem for backup and restore.

Once I tried the ayufan 0.7.2 linux kernel from 0.6.2, and I got problem that can not boot after upgrade.
So I installed ayufan's Android 7.1, but I think that is not fit my requirements.
And then I use dcfldd to restore the backup that I made before.

The following was how that made.

sudo dcfldd bs=4M if=/dev/mmcblk0 | gzip > image.img.gz
sudo sync

I restore by this.

gunzip -c image.img.gz | sudo dcfldd bs=4M of=/dev/mmcblk0
sudo sync

And then, eject the sd card and reboot, it works for booting into my ubuntu mate.
And I shutdown the pb, restart again, It will hang after boot.

Sometimes it will bot into desktop, sometimes not.

I restore again and again, always works at first time after restore boot, and then almost hang.

Very strange.

I had installed newest os (q4os) now.
  Reply
#16
Hello,
I use either DD or Partclone[1]. DD is reliable in recreating the whole image but backing up 64gb of data when 6gb is used is time consuming..
Partclone will back up a partition to a file and backs up only used space. I use sfdisk --dump to keep the partition layout the same.
I usually do something like

sfdisk --dump /dev/mmcblk1 > mmcblk1.sfdisk.dump
partclone.ext4 -s /dev/mmcblk1p1 -o ./pinebookpro-mmcblk1p1.partclone -c -N
partclone.ext4 -s /dev/mmcblk1p2 -o ./pinebookpro-mmcblk1p2.partclone -c -N

You can restore to a larger partition without issue and I *think* you can restore to a smaller partition if the used space of the back is (obviously), less then the available space. And it works with a wide variety of file system types.

[1] https://partclone.org
  Reply
#17
(07-16-2017, 08:25 PM)sujunmin Wrote: Hi, I have a atrange problem for backup and restore.

Once I tried the ayufan 0.7.2 linux kernel from 0.6.2, and I got problem that can not boot after upgrade.
So I installed ayufan's Android 7.1, but I think that is not fit my requirements.
And then I use dcfldd to restore the backup that I made before.

The following was how that made.

sudo dcfldd bs=4M if=/dev/mmcblk0 | gzip > image.img.gz
sudo sync

I restore by this.

gunzip -c image.img.gz | sudo dcfldd bs=4M of=/dev/mmcblk0
sudo sync

And then, eject the sd card and reboot, it works for booting into my ubuntu mate.
And I shutdown the pb, restart again, It will hang after boot.

Sometimes it will bot into desktop, sometimes not.

I restore again and again, always works at first time after restore boot, and then almost hang.

Very strange.

I had installed newest os (q4os) now.

At what point does it hang? Any output on screen and do you have serial output from the UART?
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  eMMC boot linux distros for Pinebook. frank-zappa 14 1,482 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 645 03-02-2019, 06:51 AM
Last Post: frank-zappa
  Is it possible to choose between SD/eMMC boot programmatically? UltraBloxX 2 367 01-28-2019, 11:41 AM
Last Post: UltraBloxX
  Move Installation from SD Card to eMMC? soupbowl 4 941 11-10-2018, 10:47 AM
Last Post: acruhl
  Dual Boot on eMMC? d97 1 880 08-30-2017, 10:04 AM
Last Post: abrmx
Question Whether 64GB emmc for Pinebook Siliconserf 7 1,107 08-19-2017, 06:50 AM
Last Post: combs
  Pinebook wont boot from eMMC priyamjani 2 760 08-06-2017, 09:22 AM
Last Post: priyamjani
  SD CARD - EMMC jmbernabotto 3 1,375 07-14-2017, 12:54 AM
Last Post: pfeerick
Exclamation Flashing New OS Images to eMMC / Booting from SD Luke 0 5,563 06-30-2017, 12:26 PM
Last Post: Luke
Information eMMC modules are available in-store Luke 0 1,015 04-18-2017, 03:18 AM
Last Post: Luke

Forum Jump:


Users browsing this thread: 1 Guest(s)