[Q] Initial backup/ image for new device - Android Q&A, Help & Troubleshooting

Hi,
Very noob with a very noob questions
I read a lot about backups etc... Some have to be rooted first...
I'm used with my Windows computers to make a genuine unstarted system image (Ghost, now Acronis)
When I have a new computer, I take out the main HDD and make an image or boot with an Acronis boot disk and make an genuine image, can I do something similar with Android devices?
Is EFS the system image or just the system files, restoring an EFS backup is enough to make a device bootable again without Root?
Windows PC suitable for this? ADB I guess...
Perhaps it's not possible because I haven't see any topic about making an genuine image before first start of an new device or restoring a factory image... Every time Root is involved
Thank you to make me a little wiser Sorry for my poor english

You probably want an adb backup or a nandroid backup.

Hi GermainZ,
Thanks for the tip, I'll look for both alternatives, probably ADB I guess...
Will the backup be bootable or the simple fact to recopy all the files is sufficient to boot the device? Windows uses a boot sector, is there something equivalent in Android?
Thanks

cbx6 said:
Hi GermainZ,
Thanks for the tip, I'll look for both alternatives, probably ADB I guess...
Will the backup be bootable or the simple fact to recopy all the files is sufficient to boot the device? Windows uses a boot sector, is there something equivalent in Android?
Thanks
Click to expand...
Click to collapse
The backup can be restored from your recovery (nandroid backup) or using adb (for adb backups.) You can't directly boot from it, not really.
For the boot sector, I'm not sure what that is for Windows. The bootloader, maybe? Android has that too, of course.

of course the bootloader I lost my brain I think
Is the bootloader a part of the firmware or is it copiable as a file, I'll find it out
On a Windows HDD it's a track (boot sector) but UEfI bios modifies the game now
So a full Android system restore is firmware + backup I guess

Related

[Q] Make a backup before flashing

Hi.
Last time I flashed a new firmware I made a backup of the phone. The problem was that I couldn't get it back after flashing.
So, my question is:
How on earth do I make a backup of everything before flashing. And how do I restore it afterwords.
Thanks in advance
Pemell
Hi pemell,
How did you generate the backup? Yesterday I generated a full backup of my Lumia 800 and the command that I executed was the following:
sudo dd if=/dev/sdX of=~/fulldump
This generated the fulldump file (16GB).
David Ortega.
I'd suggest that you back up in two ways: First in Zune and then via the DD. I would suggest that you create a separate backup of each partition in order to make reflashing easier.
davortsan - I didn't update by cab sending so aren't that familiar with these commands. I guess of course I could find out by some testing and reading.
chrisKringel - two partitions? are there two partitions? If the phone had a memorycard I would get where you're going.
kind of strange there are no step by step guide of how to backup pre flashing and restore afterwords. I'm too much of a noob to write it myself.
pemell said:
chrisKringel - two partitions? are there two partitions? If the phone had a memorycard I would get where you're going.
Click to expand...
Click to collapse
Let's take a computer for example. When you open up explorer on said computer you see multiple HDD-icons. One for the system, one for Music and Pictures and one for games. This doesn't necessarily mean that this computer has 3 physical HDDs as you can split up a storage device into multiple logical partitions. The computer can easily have only one physical drive.
Same thing goes for our Lumias. They have (as far as I know) only one NAND chip that stores all the data. But this chip is split up into 9 logical partitions, containing the bootloader, serialnumber, mac etc. (head over to the Development Section, a few of the early posts discuss the partitions). When you have a Linux at your hands you can use the DD command to dump every single partition. Of course you should only touch the 9th partition later but better safe than sorry. In order to backup with Linux you have to either run the full dump command from above. When you want to reflash the fulldump every single partitions gets reset to the state from when you created the backup. I never tried this but I would not advise to reflash all partitions. I'd rather advise you to create a single backup of each partition. Charge your phone and enter QUALCOMM mode. Plug it into your Linux and run the commands
Code:
dd if=/dev/sdX1 of=backup1.bin
Code:
dd if=/dev/sdX2 of=backup2.bin
... repeat for every number until the following ...
Code:
dd if=/dev/sdX9 of=backup9.bin
X refers to the mount point where your device is connected. You can use fdisk -l to get the right letter. When you need to restore your device you need only partition 9, but better safe than sorry You never know, these additional backups might come in handy sometime...
What do you intend to do? Do you want to have your Apps back after you flashed your phone?
Thanks Chris, a perfect post!
I know that most of the information on the phone comes from the cloud, but some doesn't. For exemple I use the call history a lot and I would like to keep all of my sms+mms. Reinstalling all the apps is, of course, something i would prefer not to do at every update (even though they don't come that often).
I'll look into the information you posted and see what I can come up with. / Pemell
pemell said:
Thanks Chris, a perfect post!
I know that most of the information on the phone comes from the cloud, but some doesn't. For exemple I use the call history a lot and I would like to keep all of my sms+mms. Reinstalling all the apps is, of course, something i would prefer not to do at every update (even though they don't come that often).
I'll look into the information you posted and see what I can come up with. / Pemell
Click to expand...
Click to collapse
Keeping the specified data like messages, settings and call history during a reflash is not easily possible. When you reflash (or flash) your phone all the data gets wiped and completely new data is written to the phone. There are some homebrew solutions for texts in the WP7 Dev & Hacking boards that might work, depending on your current ROM. Another thing is that the flash you do when using the methods described in this board is different from a flash in a Nokia Care Point. The official flashing flashes in a certain way that the first boot writes all the phone data in the registry, like the WP activation key and some other serials. This won't happen when you write the file in Qualcomm mode. This could cause problems when you try to restore a backup from Zune. I'm not really sure about this, though.
Another thing to note is that some ROMs are not updateable through Zune, on these ROMs you have to do a manual update or a new flash to get up to date.
I would suggest that you wait a few weeks if you can. Maybe Microsoft will announce a cloud backup for text messages when the introduce WP8. A official backup would be the safest way.
Thanks Chris, a good advice.

[Q] Best way to backup and restore on a number of devices

Hi
I've done a bit of searching but can't find anything too specific to what I'm trying to do. Basically we have 10 Android tablets, and I want to make them all standardised e.g. have the same Apps on, configured in the same way (e.g. enterprise wireless network added).
Now the thing is if anyone messes around with them I want a really easy way to restore them to the original config which I've done.
One way I thought was to configure one fully, install Titanium Backup on it, do a full backup of apps/system data etc, and put the backup onto an SD card. Then I already have the base ROM on an SD card so if theres any problems, I can just flash the ROM over it again, install TB, and restore all the data. Would this be suitable to do to duplicate the data onto 10 tablets, and also restore the data if required?
The other thing I looked into was customising a ROM myself, don't want to do anything too tricky it'll just be a case of removing all the preinstalled crap I don't want, preloading the Apps we do want, and if possible preloading the wireless key and getting rid of the first boot initial set up wizard.
PS I've looked at installing CWM and doing whole image backups, but supposedly the tablet isnt supported (its an Ainol Novo 7 Elf 2)
Any advice would be great, hopefully theres some fairly straight forward way of managing this
Thanks
One of the reasons I integrated a full blown GNU/Linux on my devices, was the need to run full and automated backups. If you are looking into the possibility making a custom ROM, this might be a solution for you as well. I'm using BackuPC to run backups nightly, backing them up as any other GNU/Linux machine (using tar over ssh).
See the link in my signature for more information about this.
kuisma said:
One of the reasons I integrated a full blown GNU/Linux on my devices, was the need to run full and automated backups. If you are looking into the possibility making a custom ROM, this might be a solution for you as well. I'm using BackuPC to run backups nightly, backing them up as any other GNU/Linux machine (using tar over ssh).
See the link in my signature for more information about this.
Click to expand...
Click to collapse
Hi
Thanks for the reply, not too sure this would be the right option for us. I don't really need to take nightly backups, I just need to make a backup of a preconfigured image, and then put that image onto 10 other devices. Then I want to keep the original backup and have an easy way to restore it onto any devices which have been messed up. Sort of like image cloning for PCs, I want to prepare a base image, and then flash it over all the devices.
fro5tie said:
Hi
Thanks for the reply, not too sure this would be the right option for us. I don't really need to take nightly backups, I just need to make a backup of a preconfigured image, and then put that image onto 10 other devices. Then I want to keep the original backup and have an easy way to restore it onto any devices which have been messed up. Sort of like image cloning for PCs, I want to prepare a base image, and then flash it over all the devices.
Click to expand...
Click to collapse
Ok, I see. Compile the image to you likings (boot image and system partition), and then flash it using fastboot onto you devices.
Hi
Does anyone have any more thoughts on this?
I have experimented with Titanium Backup and this seems to work quite well. I have installed a ROM, and customised it e.g. installed the apps I need and configured the apps, wireless settings and home screens etc. Then I do a full apps + system backup in TB to my SD card.
Then the plan is, I can reflash the ROM onto the other device, install TB and then restore this backup. This saves my user state and wireless settings etc.
Only problems is when I flash the ROM, I have to go through all the initial set up again and also remove some preinstalled apps which I dont want. Any ways around this?
There must be something I'm missing. Why don't you install the device, walk through the setup, remove the bloatware you don't want and then dumps the disk partitions into images you flash the other devices with using fastboot? This way you'll get'em cloned, isn't it this you want..?
Of course there's still some tinkering needed once restored/cloned, such as giving them individual Google accounts etc, but you can easily fix this without re-running the setup wizard.
kuisma said:
There must be something I'm missing. Why don't you install the device, walk through the setup, remove the bloatware you don't want and then dumps the disk partitions into images you flash the other devices with using fastboot? This way you'll get'em cloned, isn't it this you want..?
Of course there's still some tinkering needed once restored/cloned, such as giving them individual Google accounts etc, but you can easily fix this without re-running the setup wizard.
Click to expand...
Click to collapse
Hi
Yes that's what I want to do! How would I go about dumping the disk into an image and then flashing?
fro5tie said:
Hi
Yes that's what I want to do! How would I go about dumping the disk into an image and then flashing?
Click to expand...
Click to collapse
There are several methods. Some boot loaders (such as nvflash for tegra based devices) can actually read back the disk partitions to a computer via the USB port. You can also on the tablet read the raw mtd device with busybox/dd. I assume you've unlocked the bootloader and gain root access to the device, since this is a requirement for flashing them as well. A third alternative is using busybox/tar, and then recreate the filesystem image using mkyaffs (or if ext3/ext4 even easier, just loopback mount an image on you linux maching to unpack the tar archive to). Once you got the images (system and userdata partitions), you flash the devices with "fastboot flash system system.img" and "fastboot flash userdata data.img". I don't believe you'll need to tamper with the other partitions.
kuisma said:
There are several methods. Some boot loaders (such as nvflash for tegra based devices) can actually read back the disk partitions to a computer via the USB port. You can also on the tablet read the raw mtd device with busybox/dd. I assume you've unlocked the bootloader and gain root access to the device, since this is a requirement for flashing them as well. A third alternative is using busybox/tar, and then recreate the filesystem image using mkyaffs (or if ext3/ext4 even easier, just loopback mount an image on you linux maching to unpack the tar archive to). Once you got the images (system and userdata partitions), you flash the devices with "fastboot flash system system.img" and "fastboot flash userdata data.img". I don't believe you'll need to tamper with the other partitions.
Click to expand...
Click to collapse
Hi
Thanks for the quick reply, much appreciated.
Unfortunately you've lost me a bit here!
Yes the device is rooted, I dont have a linux machine though.
Any chance you'd be able to provide some more specific instructions? The device is a chinese tablet from manufacturer Ainol, the model is a Novo 7 Elf 2. Unfortunately there isn't much discussion on these online so specific help is hard to find!
fro5tie said:
Any chance you'd be able to provide some more specific instructions? The device is a chinese tablet from manufacturer Ainol, the model is a Novo 7 Elf 2. Unfortunately there isn't much discussion on these online so specific help is hard to find!
Click to expand...
Click to collapse
I can provide you specific answers to specific questions, but I have no experience of the tablet in question, so you'll have to do some digging yourself first. Make sure it supports fastboot, investigate what the proprietary bootloader is capable of, see how/if you can obtain an original image etc.
One maybe easier solution, especially if you plan to restore the tablets on a regular basis, is to only make a new boot image to reflash the devices with. The only modification done is that you change the /init.rc script to mount /data and /system from the SDcard instead of from the internal nand disk device.
Once this is done, you'll power up and run the installation wizard and everything on your master tablet. Then power it down, and clone the SDcard. This SDcard now contains everything, so you'll simply restore a device by replacing its SDcard with a copy of this master card. I guess it's easier to clone a SDcard than reflashing several internal partitions. Easier to make the master as well - you don't need to dd or tar them, they are already in "image" format. If you can get hold of the original firmware, this should be quite easy without the need to preserving data from the device itself.
fro5tie said:
Any chance you'd be able to provide some more specific instructions?
Click to expand...
Click to collapse
Issue the commands "cat /proc/mtd" and "mount" on your device at command prompt (e.g. via "adb shell" or the "ConnectBot" terminal app). This shows you if the device allows you to copy the boot image from it. Paste in the output into this thread. If you believe the "clone the tablet via the SDcard" is a good solution for you, the process is in short terms something as below;
Copy the boot image to the sdcard:
# dd if=/dev/mtd/mtd2ro of=/mnt/sdcard/boot.img bs=2048 (device dependent of contents of /proc/mtd)
Remove the sdcard, insert into a computer, split the boot image info kernel + initramfs. Read http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images for instructions about how to work with the boot.img file. I really recommend a GNU/Linux environment for this.
Then edit /init.rc replacing the "mount yaffs2 [email protected] /system" with "mount ext3 /dev/block/mmcblk0p2 /system" for system and data (use p3 for data partition, the device name may be different on your tablet, see mount output).
Create an SDcard with three partitions: #1 vfat (standard), #2 and #3 ext3. Insert into you device and boot it up again.
# mount -t ext3 /dev/block/mmcblk0p2 /root
# cd /system
# tar cf - . | (cd /root ; tar xf - )
# umount /root
# mount -t ext3 /dev/block/mmcblk0p3 /root
# cd /data
# tar cf - . | (cd /root ; tar xf - )
# umount /root
This copies your partitions to the SDcard. Shutdown the tablet again.
Make a new boot.img using the instructions in the link above, using the edited init.rc script.
Now you can non-destrutive give this a try.
Place you tablet in fastboot mode (often vol-up (or vol-down) during power on).
$ fastboot devices
This vill verify the tablet is in fastboot mode. It should be listed. Then:
$ fastboot boot boot.img
Note here, only BOOT the tablet, do NOT use the "flash" keyword. This in case of the image isn't working, you'll just have to restart you tablet, and no harm's done.
Look around. Do a "mount" command. Everything works? Mount shows /data and /system from sdcard? Perfect. Now you can reflash it. Shutdown and flash:
$ fastboot flash boot boot.img
Now the device will use /data and /system from the SDcard every time. Customize your device, and then clone your SDcard and try it in tablet #2 you'll booting with your new boot.img and the cloned SDcard. Verify that #tablet #2 is a perfect clone of tablet #1. It is? Now you can flash the boot,img into all your tablets.
--------------------
But don't forget, there may be other solutions as well, maybe more suitable. This you'll have to investigate yourself.
And the usual disclaimer - you can probably not follow above by the letter. There sure is some obstacle you'll have to overcome, something non-standard, etc.
Also keep the original boot.img file for safekeeping in the case you want to restore the device's boot image some day.
Wow! Thanks for the info! This is really helpful, I need to set aside a bit of time to work through this and have a look. Thanks again its really appreciated, I'll be back with info once I've had chance to give it a go!
I certainly can't offer more detailed info than the fellow from Sweden who seems to really know his stuff...but what about making a nandroid backup of your fully configured reference tablet (I'm assuming all tablets are rooted). Ensure all your tabs have CWM recovery and copy your nandroid file to each one.
If any of your fleet get 'corrupted' you can simply restore the original, fully configured ROM.
In fact that sounds too obvious..likely I missed something about your scenario which precludes this option from consideration!
Good luck mate.
tweeny80 said:
I certainly can't offer more detailed info than the fellow from Sweden who seems to really know his stuff...but what about making a nandroid backup of your fully configured reference tablet (I'm assuming all tablets are rooted). Ensure all your tabs have CWM recovery and copy your nandroid file to each one.
If any of your fleet get 'corrupted' you can simply restore the original, fully configured ROM.
In fact that sounds too obvious..likely I missed something about your scenario which precludes this option from consideration!
Good luck mate.
Click to expand...
Click to collapse
Hi
Yes that was my first thought as well, tablets are rooted yes but there is no CWM for the tablet. Its an obscure Chinese branded tablet.
Unless there is another way to do nandroid backups?
hmm tricky situation. Catch 22 ! From what I know, your best bet is to backup all possible things through Titanium Backup given that you don't have the use of Nandroid backups. You can include wifi settings, messages etc but it's modular & not systemic.
I did a quick google search with no luck - time to upgrade your fleet dude :-0
Best of luck.

[Q] Cloning partition without root but with CWM ?

Hi,
I need to recover deleted sms messages (from a Samsung Galaxy SIII I9300) and there is no backup of the mmssms.db database.
It's for a customer and I would like avoiding to root and to alter the operating system.
This mean that I would be very happy if the procedure could be as much "read only" as possible.
I'm however aware that I will have to write something to the phone, and I plan using the recovery partition for this.
After reading this much interesting thread http://android.stackexchange.com/questions/28296/full-backup-of-non-rooted-devices
my main hope is based on flashing ClockWorkMod (CWM) or TWRP to the recovery partition with Odin (or maybe Heimdall).
This seems a priori possible without root access. (see http://forum.xda-developers.com/showthread.php?t=2313072)
Afterwards, I would like to clone the whole DATA partition, in order to not only get the current "mmssms.db" file, but to also possibly find older versions of it through file carving.
The adb shell seems being a feature of CWM (source: http://forum.xda-developers.com/wiki/ClockworkMod_Recovery) but I'm not sure whether the adb shell resides on the recovery partition or on another one and if root privilege is required to apply commands like push or pull to exchange files between partitions and the sdcard.
Furthermore, I'm not sure if I could run commands like "dd" from recovery partition.
Something like having Busybox commands available also when starting the phone on the recovery partition.
Else, saving a Nandroid backup to the sdcard seems possible, but this sounds saving a directory structure and appears to me being not equal as cloning a partition (at low level). Hence, it would not be possible to carve dereferenced files from the Nandroid backup. Correct ?
TWRP also sounds interesting, as being able to backup only specific partitions like the "DATA" one.
But the fact that its navigation is based on the touch screen appears me being unsafe if the touch screen had to dysfunction in a later time.
I'm familiar to Linux but a newbie in Android-based smartphones.
Thank you very much for your help.

RemixOS backup problem

Hi, xda-developers
I want to backup my remix os system because i want to use and try different versions of remix os(like 2.201,202,3.xxx,..., x86 or x64).
Whenever i want to try different version i have to;
1-Write .iso image to usb
2-Install again from usb
3-Update Google Play components
4-Install some specific programs
This looks like basic to do but when you tried again and again and again, you will get bored. (about 1hour to done)
So i'm trying to copy system folders with root actions, it doesn't worked. It says 'Can't copy special file', so i tried to copy with 'cp -r /file /topath' it worked BUT when i use my backup MY SYSTEM WILL NOT BOOT UP. Stuck on RemixOS logo BUT when i try to backup with clonezilla it WORKED! I don't know why so i just want to know and find alternative method without 'imaging' to 'cp -r' backup. I'm not expert with computer or developer. I just want to try some different version of RemixOS.
I don't want to use 'IMAGING' method because i'm using linux on same partition so when i use 'image' i lost my latest personal data.
Best regards, Please help me about this situtation
Thank you

How to be foolproof when attempting flashing

Hello,
I am new to xda, but with what I would say a good understanding of computers in general, and good knowledge of c programming (if that matters)
I am structuring a guide for myself to be as foolproof as possible when attempting flashing my new phone. Please fill in any voids, comment, or answer questions if you can. This should prove useful to other users as well as it's not so model-specific.
1) It appears that the custom recovery of choice in most situations and for the time being is TWRP (correct?).
2) If I can get a backup of EVERY partition on my stock phone (as it came from the factory) using TWRP, could I conceivably restore ALL of them and be in a factory default setting? Excluding stuff like eFuse and similar mechanisms.
3) If the phone supports fastboot, unlocked bootloader and there is a compatible TWRP for it, would it be possible to boot the TWRP recovery through fastboot (without flashing that particular partition to phone), open a shell and take backups of all partitions on the phone? That should give us a file for each partition.
4) If one accomplishes step 3 successfully, in what scenarios would he/she NOT be able to bring the phone back to life after software bricking?
Minor questions:
a) "To have root" on a phone, is basically the same as having a root account on a BOOTED OS partition (like the admin accoun on a booted windows machine, or a root account on a linux machine)? If that's the case, booting a different partition (for example the recovery partition) could also give you root priviledges without affecting the booted partition, correct?
b) Why do some custom ROMs require a certain version of the stock/OEM rom to be installed PRIOR to flashing, since they are going to replace those partitions anyway?
c) How is Xiaomi's Anti Roll Back (ARB) feature implemented, if one restores all partitions to stock from step (3) ? There must be some other places of storing of information on the phone, besides internal memory, correct?

Categories

Resources