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.
#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! )
#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
#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!
#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.
#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
#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?
#18
I would love it if someone could put a "Backup/Restore" section in the Pinebook Pro wiki with clear instructions on the best way to do a full system image backup and then how to restore that to the eMMC. 

Would I have to boot to a separate microSD OS and have an external hard drive or memory stick plugged in?  What's the best way to do it?

I'm a noob and I've got the default Debian system in a place where I'm pretty happy with it, but I want to do a good backup before learning and messing around with too much more.
#19
I have ordered a second emmc card from pine store and the usb hardware for it. I just use dd to transfer the internal /dev/mmcblk2 to external /dev/sda. In case of panic, I just swap the emmc modules and i am running again in 3 minutes.
I do weekly backups. It is enough for me and no complications.
#20
Alright, I think I have my noob friendly system backup procedure.

  1. Get a MicroSD card the same size as your eMMC, and insert it into the PineBook Pro 

  2. In Terminal, run:  lsblk 

  3. Figure out which disk is the one you want to back up and which one is the one you want to back up to. 

  4. In Terminal, run:  dd if=/dev/mmcblk1 of=/dev/mmcblk0 status=progress 
       (where the first one (if=) is the name of the drive you want to copy, and the 2nd one (of=) is the name of the drive you want to copy to.) 


  5. When finished, reboot Pinebook Pro with microSD card inserted and confirm that it boots to a copy of your eMMC's drive. 

  6. Keep MicroSD card as backup, or create an image of it on another hard drive in another computer. 


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,596 03-08-2022, 10:14 AM
Last Post: frank-zappa
  How to transfer customised OS from SDcard to emmc quixote 1 3,040 01-07-2022, 06:38 AM
Last Post: alanwake82
  eMMC boot linux distros for Pinebook. frank-zappa 14 20,400 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 7,838 03-02-2019, 06:51 AM
Last Post: frank-zappa
  Is it possible to choose between SD/eMMC boot programmatically? UltraBloxX 2 4,723 01-28-2019, 11:41 AM
Last Post: UltraBloxX
  Move Installation from SD Card to eMMC? soupbowl 4 8,682 11-10-2018, 10:47 AM
Last Post: acruhl
  Dual Boot on eMMC? d97 1 3,548 08-30-2017, 10:04 AM
Last Post: abrmx
Question Whether 64GB emmc for Pinebook Siliconserf 7 8,649 08-19-2017, 06:50 AM
Last Post: combs
  Pinebook wont boot from eMMC priyamjani 2 3,984 08-06-2017, 09:22 AM
Last Post: priyamjani
  SD CARD - EMMC jmbernabotto 3 5,554 07-14-2017, 12:54 AM
Last Post: pfeerick

Forum Jump:


Users browsing this thread: 1 Guest(s)