"Win32 Disk Imager" can backup/restore Android !

21 11740
dlanor  
Post Last Edited by dlanor at 2014-7-16 01:59

As you all know we must use the PhoenixCard program for an initial install of the Android system, since "Win32 Disk Imager" and similar tools are unable to install the Android image file correctly. And I (mistakenly) took this to mean that we had no working backup method, since PhoenixCard only handles initial installs, never backup or restoration.

But after losing 10GB of installed apps and data on my corrupted SD card after a power loss I decided that it was time to look for a good backup method, so I wouldn't be forced to start over from scratch again, like I had to do this time.

So after installing a lot of the basic stuff I tried making a full image backup using "Win32 Disk Imager", and then writing that backup image to a different SD card of the same size, which I then booted to verify that the backup was valid. And fortunately that turned out to be the case !

It's rather wasteful to make 16GB backup files when the used data so far is less than 2GB, but it's well worth it for the safety I gain in never again having to start over from scratch, even if the new card is corrupted again. I'll just have to restart from the point of the latest backup, which will save me a lot of effort (and worry). And in any case it's always possible to ZIP the wasteful backups, when storage space is a priority.

Best regards: dlanor
Thanks for your try

Raymond  
I think it can Read first and Write to another SD card for backup purpose.

dlanor  
I think it can Read first and Write to another SD card for backup purpose.
Raymond Posted at 2014-7-16 03:22


Yes, that's exactly what I did. I used 'Win32 Disk Imager' to make a backup copy of the Android image I was using, and then restored that backup to a different SD card, which I inserted into the Banana Pi and continued my work with no problems, as if it had been the original card.

And this means that I can safely make continuous backups at crucial points, to prevent loss of all new additions to the setup since the last backup. This way I will always be able to restore the Android system after SD card corruptions (which seem inevitable at unplanned power loss, like mains glitches etc ), and will on those occasions only lose the most recent additions, allowing faster recovery.

Best regards: dlanor

mattrix  
Yes. I found this as well.

But, I hate waiting for huge images to write, so I make all my modifications directly to the initial image for quicker burning.

However, I can't work out how to setup app settings so android installs them after the apps install.

But Win32 is great if you have an SD pre-setup with all the good settings etc.

I have also started modding some of the factory APK's.
For starters: Have removed lots of unrequired settings in the settings APK.
Also, modified the framework-res.apk to change the default background.
& modified the settingsProvider APK to set Ethernet on by default.

dlanor  
Yes. I found this as well.

But, I hate waiting for huge images to write, so I make all my modifications directly to the initial image for quicker burning.
mattrix Posted at 2014-7-16 23:38

Yes, that would of course be better, for such things as can be included in an initial image. But a lot of things can't be...
Commercial paid apps for example. Including them in an image intended for purely private use would be legal, but at the time of initial launch there will be no google account settings, so at that time any commercial paid apps will 'consider' themselves as running illegally...

However, I can't work out how to setup app settings so android installs them after the apps install.

That is one case, and another is the case of those commercial apps which can only be downloaded and transferred from PC to devices as an installer stub.

These will still require a lengthy installation phase during their first runs, for download of the real payload app.
(eg: Most of the Final Fantasy games from Square-Enix work this way.)

But Win32 is great if you have an SD pre-setup with all the good settings etc.

Exactly, and after investing a lot of time in installing and configuring lots of software it's a great relief to have everything backed up.

I have also started modding some of the factory APK's.
For starters: Have removed lots of unrequired settings in the settings APK.
Also, modified the framework-res.apk to change the default background.
& modified the settingsProvider APK to set Ethernet on by default.

That sounds very interesting, and I look forward to a future post with another modified image for us to test.
Now that I can backup my working setup I have no qualms about testing other setups, even if/when I have to reuse my current cards.

Best regards: dlanor

liab  
Post Last Edited by liab at 2014-10-10 06:39

Thank you dlanor for the good tip. For me it is very important too, to save a good system card. Your hint works for me fine. The only disadvantage is, it only works on sd-card with the same bigness. So I remember my very old way to save a complete OS with rar.

The following way I use with success with the Android 4.2 Stock Image. I love this Image because it has a good xbmc. My good sd-card with all my favourite apps and all setting. So it's time to save it:

1. Save the sd-card, a Linux PC is necessary, I use kubuntu

I find out, sd-card with the stock image has seven readable partitions, only 3 are important for restore, they are:
sdx1 with the data like movies, settings etc. (important)
sdx2 for boot
sdx7 with the android OS and apps (important)
sdx8 with installed apps, libs, data etc. (important)
sdx11 - sdx13

First job is to save all 3 partitions behind one another. I mount it to /mnt/sd and save it as root with tar -cvlpzf ...

2. Restore to same or other sd-card

2.1 Preparation, a windows PC is necessary
Write with PhoenixCard a new sd-card, for me it's the stock image.
Put this Card into the banana pi and start it. Do all normal and wait until  the 7 standard apps are ready. This is necessary, because a fresh card has no sdx8 partition!

2.2 Write back, a Linux PC is necessary

We mount first sdx7 and write back the saved sdx7.tar.gz with the command (as root) and delete the complete content and write the content from the saved image.

tar -p --same-owner -xvzf sdx7.tar.gz

next same with sdx8 and last sdx1. Very, very important is the Parameter
"-p --same-owner"!!

The apps have unusual groups and users, such as 30001. The whole thing will not work when there something is wrong!

If all partitions on the sd-card are ok, it suffices to restore the 3 partitions.

I tried it with the stock image on several different cards (16 and 32 GB) and it works fine.

It would be wise, if the system expands with new apps, to make a new backup from the 3 partitions.

A tip: I could not install some apps like MeyPro HD and AndroidDreamer in Android 4.2. But in Android 4.4 they could be installed. The only thing to do, copy them from 4.4 and insert them in 4.2. It works!

liab  
With this manner it is even possible to copy xbmc from the stock image into the android 4.4 image. It works fine. Necessary are the folders:

sdx1/Android/data/org.xbmc.xbmc
sdx8/app/org.xbmc.xbmc-1.apk
sdx8/app-lib/org.xbmc.xbmc-1
sdx8/data/org.xbmc.xbmc

Important same rights, same group and same user - like the original!

dlanor  
@liab:
Have you found it possible to move and/or resize the individual backup partitions in restoration ?
Or is it only possible to replace partition contents without modifying the partition storage space ?

Best regards: dlanor

liab  
Edited by liab at 2014-10-23 11:54

I shall try it in some days, at the moment I'm not @home.

You have to log in before you can reply Login | Sign Up

Points Rules