[Q] Best way to backup and use system from device to emulated device? - Android Q&A, Help & Troubleshooting

So while i know how to normally backup and restore phones or apps through any number of different applications or recovery software. I had an issue today where i need to backup the state of the phone as it is now, and thrn modify or test with it on an emulated device (if possible, i was thinking my laptop runninng aosp android via some form of emulation.)
Is this possible? What is the difficulty of it?
What i would be taking the device backup from is a nexus 5 with lollipop, and then from there using that as a base, figure out what is going on with the software.

i had that same problem .. and i found a way to backup bootloader and recovery partitions, and i applied it to all partitions and it worked
http://www.theandroidhow.com/2014/05/how-to-make-backup-stock-boot-recovery.html
i had a trouble using flashtool, till i realized the flashtool version itself wasnt good
so i recommend
SP Flash Tool v3.1328.0.183: https://doc-14-c4-docs.googleuserco...8341683716159190/0B_r6upjBMmyGWWpSZHRmTHJLa0k
you will also need
mtkdroid : http://www.mediafire.com/download/w55w2j3l18nt1ws/Mtk_Droid_Tool_v2.5.3.rar
the method in the 1st link is illustrated for bootloader and recovery partition, i used it to backup all partition includidng system(android partition) and other partition i have no idea what are they, i just dont like to lose a useless digit
NOTICE: i didnt try it in restoring , but i think it works like bakcup/restore process of pc HDD

Related

[Q] How to make a FULL backup of Android phones?

Hello! I have a little experience using computers from late 1995 Year, and from year 2000 I am using also Linux from time to time, and very rare but it was a delight freeBSD. I have no experience on Android and MacOs.
Now, I all my family (father, mother, girlfriend and I) changed the phones on Android which is Linux based, but for ARM processors.
Anyway, I have played a little with Android 4 x86 on my laptop.
Please considering that I am new in the Android sutff.
From, my point of view, a Android Smartphone is just a little computer like an raspberry pi / pandaboard / beagle board.
So, a mini computer with an Arm processor running a very small and tiny operating system max 8 Gb, when on my gentoo install I had been using about 30-40 Gb. I know, the size can be affected by the compiling flags but anyway. Please corecct me if I am wrong.
Now, on all my system I had, from my experience I did 2 Backups, like this:
My laptop is backed-up on the External Hardisk number 1, and the External Hardisk number 1 is backed-up on the External Hardisk number 2.
So, as it is a good practice to have a backup handy, I keep 2 backups in 2 different location in case of hardware failure / water flood etc. Some of the files I need are backed up in the cloud, on the internet.
I use to make IMAGES of the Operating System partition, and of the mbr , and of the partition table, with software like Acronis True Image, Paragon, DriveImage XML, Norton Ghost, Clone Zilla.
When I had to do data recovery I did an Acronis "sector-by-sector" approach image of the hardisk, and I recovered files from that image.
Can you guys please introduce me please on the android field?
I assume that maybe I will need to get root on one or two phones, and one phone need's to be unlocked from the carrier.
Before doing this I would like to make a full backup of the phones.
1) How can I make a FULL backup of the android phones? In this moment my mother phone is a samsung galaxy mini2 Samsung Galaxy Mini 2 s6500 and mine is Sony Xperia L
2)
a) If I will "unlock" the phone from the carrier (locked on orange, but i wish to use also Vodafone, I tim, I wind, moviestar, o2 etc)
b) If I will "root" the phone to gain administrator acces on it
After step A) and B) if I will restore the original backup, the phone will be "locked" back to Orange, and "un-rooted", or it will be "unlocked" and "un-rooted"?
3) Instead of having an hardisk like computer have, I guess the smartphone is using an "usb-stick/sd-card/ssdhdd"-like memory for storage of the operating system, so how can I see the partition table, the mbr, on the device?
Thank you in advance!​
In my experience the best backup apps available require root. So I would recommend unlocking and rooting the phone first, get all the apps you wish to use installed, then use clockworkmod recovery to make a backup. This backup will include everything including the current unlocked rooted status, and can be restored using the same software. I also reccomend titanium backup for app backups, which includes user defined settings for each app. There are free and paid versions of each and both work equally well. Both apps, Titanium Backup Root, and Clockwork Manager are available for install from the play store.
Thank you for your feedback, but I wish to backup before unlocking, I will root the phone only as a last resort.
It could be possible to need the phone locked up, if there will be warranty problems.
I am currently reading about Odin, next will be CWM and TWRP, as I am not familiar with those "tools" and I don't know for what are they used for.
As I learned by now, with odin I can go back to an old firmware. But first I need to learn how to back it up in this state, locked, and un-rooted.
After I have read, read, read, and read again a lot of posts, blogs, forums, it seems that If I wish to backup the Stock Rom, I need to do root on the device. But if I will "root" the device, make backup, change rom, then recover the stock rom from backup (which is in the rooted stage), can I UN-ROOT it again?
Yes. Most phones have unroot options available. Alternatively, flashing stock rom to a rooted phone using odin etc will be in unrooted state. Stock firmware will also return the bootloader and recovery( which is what cwm and twrp are btw) to stck as well.
Sent from my SM-T210R using xda app-developers app
doctortonic said:
After I have read, read, read, and read again a lot of posts, blogs, forums, it seems that If I wish to backup the Stock Rom, I need to do root on the device. But if I will "root" the device, make backup, change rom, then recover the stock rom from backup (which is in the rooted stage), can I UN-ROOT it again?
Click to expand...
Click to collapse
I don't know which phone(s) you have, but let's say you root your phone. You can then install ClockworkMod Recovery which allows you to flash custom ROMs and make full NAND backups (backups of the entire system partition), i.e you can backup whole ROMs. If you're on a custom ROM and you want to go back to a previous ROM, then just restore your NAND backup from Recovery and voila! Your phone will look and behave exactly like it did before you flashed the other ROM, and all SMS', phone records and apps will be there. Sure, it'll still be rooted, but simply open SuperSU (if that's the root app you'll be using), go to settings and tap "un-root". Done.
So..
- Make a typical backup of stuff, like moving important things to your computer etc. since accidents happen.
- Root and install Recovery
- Make a NAND backup in Recovery
- Flash a custom ROM if you want to
When you want to go back to stock:
- Boot into Recovery
- Restore your NAND backup
- Reboot and you're done
- Un-root if you'd like to
Tip: Store your NAND backup on your SD card and not on the internal storage in case you ever do a complete wipe of the internal storage or something happens to your phone and you lose your backup.
Note: Be sure to quote this post if you want a reply from me. I'm not usually in the Q&A section, and i'll be notified by Tapatalk on my phone when you quote this post. That way i'll see your reply, and i can then reply faster again.
I tried to root the phone with some software found in this forum ( SuperOneClick ) but did not worked.
I tooked the phone to a service and Unlocked the phone from the carrier network.
I asked if the phone will be rooted after the unlock, and they told:
PhoneService: "No, but do you wish to be rooted?"
Me:"How is better and safe, rooted or unrooted?"
PhoneService: "You have the advantage for example that you can move the aplications to card, but is safe to have the phone unrooted"
Me: "If it is possible please root the phone"
PhoneService: "oky, give us 30 minutes"
After 30 minutes (I took a walking), they unlocked the phone but said that rooting the phone will take more time, so I not rooted the phone.
As the phone dosen't need neccesary to be rooted, as I have no aplication in it which require this (there is only 2 apps, Opera browser and Copy To Sim / Import contact to Sim), and I don't desire to install more apps on it as only my mother is using it, I will leave the phone unrooted.
I wished only to have a Backup of the rom, just in case something will go wrong, to restore the phone back to the warrany service if there is this need, but as long the phone can be locked be back again, there is no such need to root it.
Guys, thank you very much for the input, really appreciated!
How about a adb backup? Using adb tools. Try search on Google for it. If I remember correctly, root is not needed.

[Q] Backup firmware?

I have rooted my Tablet Z and unlocked the bootloader.
Before I mess around anymore, I figure it would be a good idea to get a backup of the firmware, to store on the sd-card, in case something goes wrong.
I just can't figure out what to do... The method I found so far, says the bootloader has to be locked, since it requires Sony Update Service.
Another method that I saw mentioned was using Flashtool to create a backup, but I can't seem to find that option. It also mentioned some files that I need to push, before backing up, I don't quite understand which files and what to do.
Can someone help me how to make a complete backup up of the system, that I can restore in case something goes wrong when I start flashing?
If possible I would prefer the system only, not all the apps that I installed, but if that's not possible, it's fine.
Thanks.
Install the Dual Recovery, and use TWRP to backup Cache, System and Boot (kernel) partitions. Choose SD Card as storage, and leave it there. Dont forget to not delete the folder called TWRP
Sent from my LT26i using Tapatalk

How to install an update.zip with not matching device id

Hi. Recently I stuffed my ZTE Blade A452 with MIUI ROM found on here: hxxp://forum.android.com.pl/topic/319435-a452miui-v8-miui-global-8020. I also installed TWRP . I've been using it for a while and unfortunately it didn't meet my expectations. It is barely usable, phone crashes a few times a day, apps aren't kept in background.
I decided to come back to my stock ROM. I don't have, however, any back up of it. There are some sdcard packages on ZTE's support page, however when I tried to install it with TWRP, it displays that packages (all of them) are for device id P635F33, while my device is P635E40. And I found nothing for my dev id.
Is there a way to force installing one of those packages in my phone? Editing version.txt inside update.zip did nothing.
Maybe one of you guys have a matching package?
Also my sister's got the same model, Blade A452, bought at the same service provider. Maybe there is a way to extract a ROM from her phone and put it into mine? (Her device must be left quite untouched).
damiandbcz said:
Hi. Recently I stuffed my ZTE Blade A452 with MIUI ROM found on here: hxxp://forum.android.com.pl/topic/319435-a452miui-v8-miui-global-8020. I also installed TWRP . I've been using it for a while and unfortunately it didn't meet my expectations. It is barely usable, phone crashes a few times a day, apps aren't kept in background.
I decided to come back to my stock ROM. I don't have, however, any back up of it. There are some sdcard packages on ZTE's support page, however when I tried to install it with TWRP, it displays that packages (all of them) are for device id P635F33, while my device is P635E40. And I found nothing for my dev id.
Is there a way to force installing one of those packages in my phone? Editing version.txt inside update.zip did nothing.
Maybe one of you guys have a matching package?
Also my sister's got the same model, Blade A452, bought at the same service provider. Maybe there is a way to extract a ROM from her phone and put it into mine? (Her device must be left quite untouched).
Click to expand...
Click to collapse
You Have a Same Phone Available .That is Great. You can give her Sleep Drug Sneak Into Her Room.Get the Phone From Under The pillow.And Now You can Unlock The bootloader flash TWRP Make a Backup and Then Flash Stock Recovery.Then Put The Phone Back Under The Pillow.The Process Will only Take about 30Mins.
5Min to unlock Bootloader
2.5Min to flash TWRP.
2.5Min to install stock Recovery
And 20 min to move the back Up
Or
You can Slice her Throat and Get the phone.Seriously Save 30Min of time.
Or
You can Backup Using a Desktop Application and Restore on your Phone.
Sent from my Nexus 6P using Tapatalk
Atifbaig786 said:
You can Unlock The bootloader flash TWRP Make a Backup and Then Flash Stock Recovery
Or
You can Backup Using a Desktop Application and Restore on your Phone.
Click to expand...
Click to collapse
Yeah, TWRP on her phone isn't an option, as the whole system is quite buggy and she's gonna probably use the restore option. I'm gonna try with some desktop apps and give an answer in 1-2 hours. Thank you.
Sorry it took so long to answer.
I couldn't make a nandroid backup any desktop app (MTK Droid Tools can't create scatter file, couldn't find any other app).
As I said, TWRP was not an option. But I managed to do the nandroid backup from phone-level anyways.
First I rooted the source device with KingRoot, installed on it BusyBox and made a custom TWRP-style backup on SDcard with Online Nandroid Backup *ROOT. Default settings are fine, even though it couldn't recognize my phone model.
Then I moved SD into target device and performed a backup with TWRP (just to create my device directory). Then I moved the source-phone backup into the new-created directory and performed Restore.
And Voila! On my phone there was a 1:1 copy of the system. It wiped out TWRP so I could perform a system Restore and get a factory-new soft.
Thank You. I didn't even realize it was possible to restore A-Backup on B-Device. Even though my sister's phone was a P635F33 (I didn't know it earlier) and mine was P635E40, it worked well.
damiandbcz said:
Sorry it took so long to answer.
I couldn't make a nandroid backup any desktop app (MTK Droid Tools can't create scatter file, couldn't find any other app).
As I said, TWRP was not an option. But I managed to do the nandroid backup from phone-level anyways.
First I rooted the source device with KingRoot, installed on it BusyBox and made a custom TWRP-style backup on SDcard with Online Nandroid Backup *ROOT. Default settings are fine, even though it couldn't recognize my phone model.
Then I moved SD into target device and performed a backup with TWRP (just to create my device directory). Then I moved the source-phone backup into the new-created directory and performed Restore.
And Voila! On my phone there was a 1:1 copy of the system. It wiped out TWRP so I could perform a system Restore and get a factory-new soft.
Thank You. I didn't even realize it was possible to restore A-Backup on B-Device. Even though my sister's phone was a P635F33 (I didn't know it earlier) and mine was P635E40, it worked well.
Click to expand...
Click to collapse
It Did Work Right.I am Happy To Be of Your Assistance.
Sent from my Nexus 6P using Tapatalk

I have wiped my phone using TWRP, I have lost my efs partition hence I can not make calls, connect to wifi (sometimes) and use bluetooth

The title says it all.
My ROM (H-ROM by Astrako) was a little bit buggy so I decided to uninstall it.
I wiped the whole phone, hence the efs partition is also gone.
When I tried to install the Stock ROM using Odin, it failed because the Stock ROM's version (One UI v2.0) is less than H-ROM's version (One UI v2.1) and it seems that Samsung's bootloader doesn't allow downgrading software components whatsoever.
I then reinstalled Astrako's H-ROM and cannot connectivity features because I believe my efs partition is lost. I can sometimes connect to my home WiFi.
Is there any way to fix the efs data or allow downgrading to the stock ROM?
If i make a backup of my j6 efs partition from twrp so you can flash it
Reply. Also metion model name mine j600g
Yes that would be very helpful indeed.
But care to share with me the app you use to create the backup
vixalien said:
Yes that would be very helpful indeed.
But care to share with me the app you use to create the backup
Click to expand...
Click to collapse
How would i share it

Question Ways to return the device to stock?

I am a bit of a scaredy cat, and I don’t want to pollute the GSI thread with this question.
OnePlus is not offering fast boot flash images for their Nord 2. And the only way to get a custom rom is by flashing a custom vbmeta image and a system image for GSI.
The question now arises, how could one come back from a GSI into stock? I would assume I would need to do ADB push/pull and copy the whole system NAND to a file, then restore that if needed.
Would that be true? Or are there better / faster / safer ways to turn the phone to stock?
I have not yet received my unit, but i want to start tinkering with it as soon as I get my hands on it. So I want to know if there are any ways to undo any and all modifications i would do to the system.
Cheers
Can't twrp backup as system.img
ajaz35 said:
Can't twrp backup as system.img
Click to expand...
Click to collapse
I am unsure if this is being worded as a factual statement, or as a question.
I am telling that TWRP Backs up system as System.img in most Phones.
Same should apply to Nord 2.
ajaz35 said:
I am telling that TWRP Backs up system as System.img in most Phones.
Same should apply to Nord 2.
Click to expand...
Click to collapse
It should apply, but there's the issue of backups needing to be bit-perfect to ensure not to upset dm-verity
I have however found a bunch of commands that i will be testing in about 6 days, once i receive the terminal. I will be placing them for future reference, and for any poor souls who may need this:
Code:
adb backup --twrp -f /directory/to/save/dump.db
Not exactly my cup of tea, but this should combine bit-perfect system and vendor images with space-saving regular file copies of other lesser i mportant partitions, and ignoring the /data/media partition. Should be good enough.
Code:
adb root
adb shell 'dd if=/dev/block/mmcblk0 2>/dev/null' > mmcblk0.img
These two commands should, on an ideal world, with debugging enabled on the target device, and from within TWRP, create a bit-perfect copy of the entire nand and leave them on the CWD. however, the path may differ from what i've found, different chipset and all. However, that's nothing that a good old
Code:
lsblk -l
won't solve. The tricky bit will be actually pulling the file back. Since redirects can seemigly be used to copy the image file to the CWD, redirects may be able to be used to write to disk remotely. This one requires more research.
Alternatively, i will need to buy an OTG cable, get a large enough flash drive, and mount it for the purposes and DD'ing the file out and into the device. If all else fails, with 8GB of RAM it should be able to store 1/16 of the total NAND flash onto ram and slowly stitch the nand in chunks. Not shore how well would that go, too many points of failure. But keeping this for my own musings.
Another possible answer would be to boot into TWRP, running
Code:
lsblk -l
to see all the mount points, and using
Code:
adb push / adb pull
on each of them. Research indicates one can't copy the whole NAND this way, but individual partitions. Should suffice as long as the subsequent coopies are bit-perfect. Assuming one can push the generated image back, this may be the most satisfactory answer.
I will attempt to perform these tasks when i receive the phone and see if it can successfuly restore it's own backup.
ajaz35 said:
I am telling that TWRP Backs up system as System.img in most Phones.
Same should apply to Nord 2.
Click to expand...
Click to collapse
Additionally, one should note that i intend on fully backing up the NAND of the device. Just the system partition is insufficient. as there may be updates on the way that may make restoring the system partition from an OTA image impossible. Therefore, a full NAND copy is needed. altnernatively, if a low-level copy cannot be achieved, individual bit-perfect copies of individual partitions will need to suffice, and hoping no GSI or custom rom maniulates any of the protected partitions.
Do you flash the system.img from my backup?
Oneplus Nord 2 Oxygen 11.3 DN2103 EEA ROM
Flash at your own risk. I am not responsible for any damage or data loss to the device during this process! Downloads: The Fastboot restoration file can be downloaded in here: DN2103_11_A.07 DN2103_11_A.10 *deleted DN2103_11_A.11 *deleted...
forum.xda-developers.com
sakarya1980 said:
Do you flash the system.img from my backup?
Oneplus Nord 2 Oxygen 11.3 DN2103 EEA ROM
Flash at your own risk. I am not responsible for any damage or data loss to the device during this process! Downloads: The Fastboot restoration file can be downloaded in here: DN2103_11_A.07 DN2103_11_A.10 *deleted DN2103_11_A.11 *deleted...
forum.xda-developers.com
Click to expand...
Click to collapse
As I stated previously. I have yet to receive my terminal. So I haven’t flashed anything yet.
however, disabling dm-verity, installing your system image, see it it fails, and if it fails, backing up, will be a great way to test if my backups are effective.
I want to toy around with your image and PHH’s once I get the terminal. So I’m just trying to preemptively have backups in place for when I inevitably flash something without paying attention and bricking the device.
that reminds me, were you the one who needed a full system dump a few weeks ago on another thread? I can upload my image once I get it working
Edit: just checked it was phhusson who needed the dump. Sorry about the mix up
ZanaGB said:
As I stated previously. I have yet to receive my terminal. So I haven’t flashed anything yet.
however, disabling dm-verity, installing your system image, see it it fails, and if it fails, backing up, will be a great way to test if my backups are effective.
I want to toy around with your image and PHH’s once I get the terminal. So I’m just trying to preemptively have backups in place for when I inevitably flash something without paying attention and bricking the device.
that reminds me, were you the one who needed a full system dump a few weeks ago on another thread? I can upload my image once I get it working
Edit: just checked it was phhusson who needed the dump. Sorry about the mix up
Click to expand...
Click to collapse
I tested rhe gsi Versions, but not good i flash my system.img, dtbo, persist and vbmeta and go back to stock
Just got notified that the phone arrived. So this evening i will get it up and running then worry about backing up later.
Hi. How return the device to stock and lock bootloader? Is there manual?​
shnailcheg said:
Hi. How return the device to stock and lock bootloader? Is there manual?​
Click to expand...
Click to collapse
Assuming you didn't install any custom ROM, all you have to do is boot onto fastboot and type fastboot OEM lock or fastboot flashing lock. Forgot which exactly.
I have root installed
shnailcheg said:
I have root installed
Click to expand...
Click to collapse
restore your full NAND backup and godspeed
have you tried this method on nord 2?
shnailcheg said:
have you tried this method on nord 2?
Click to expand...
Click to collapse
I made a nand copy but never backed it up.I ended up not needing root for anything and I won't install any ROMs until there's any good ways to have a failsafe for backups. So to all effects I have a backup I haven't tested. I am not gonna risk losing my IMEI or having a zombified phone due to missing blocks on the backup.
To be specific. I have ways to get data OUT of the phone. But I don't have a reliable way to get the data IN and ensure nothing critical is missing or overwritten in the process. And I am too afraid to lose my phone just testing if backups ACTUALLY work.
K
ZanaGB said:
I am a bit of a scaredy cat, and I don’t want to pollute the GSI thread with this question.
OnePlus is not offering fast boot flash images for their Nord 2. And the only way to get a custom rom is by flashing a custom vbmeta image and a system image for GSI.
The question now arises, how could one come back from a GSI into stock? I would assume I would need to do ADB push/pull and copy the whole system NAND to a file, then restore that if needed.
Would that be true? Or are there better / faster / safer ways to turn the phone to stock?
I have not yet received my unit, but i want to start tinkering with it as soon as I get my hands on it. So I want to know if there are any ways to undo any and all modifications i would do to the system.
Cheers
Click to expand...
Click to collapse
Keep nandroid backup evry time you want to go back just restore that nandroid backup using twrp if you gets data restoration error just deselect data emmc win file in backup and restore.
Remember on android 12 gsi twrp data encryption issue so u can't able to access internal storage to restore the backup so first go back to android 11 gsi, now transfer that backup to twrp folder and then boot back to twrp and restore
I personally done this when I stuck on android 12gsi
pankspoo said:
K
Keep nandroid backup evry time you want to go back just restore that nandroid backup using twrp if you gets data restoration error just deselect data emmc win file in backup and restore.
Remember on android 12 gsi twrp data encryption issue so u can't able to access internal storage to restore the backup so first go back to android 11 gsi, now transfer that backup to twrp folder and then boot back to twrp and restore
I personally done this when I stuck on android 12gsi
Click to expand...
Click to collapse
One thing i have been reading from the TWRP Nandroid backups, is that people who install the GSI and then restore, lose their IMEI data and other baked-in addresses.
Is that the case? I would imagine that since TWRP backups aren't bit-for-bit it could cause problems. Have you tested for that?
EDIT: additionally, i guess i absolutely need an OTG adatper to properly restore the backup, since the mere ac of restoring the backup would destroy the backup in the process, wouldn't it?
ZanaGB said:
One thing i have been reading from the TWRP Nandroid backups, is that people who install the GSI and then restore, lose their IMEI data and other baked-in addresses.
Is that the case? I would imagine that since TWRP backups aren't bit-for-bit it could cause problems. Have you tested for that?
EDIT: additionally, i guess i absolutely need an OTG adatper to properly restore the backup, since the mere ac of restoring the backup would destroy the backup in the process, wouldn't it?
Click to expand...
Click to collapse
No if u r on android 12 gsi u need OTG there twrp will not work.
No issue in Restoration on android 11gsi
pankspoo said:
No if u r on android 12 gsi u need OTG there twrp will not work.
No issue in Restoration on android 11gsi
Click to expand...
Click to collapse
So. The way i understand it.
1: Full backup from the stock ROM ( Android 11 Based ) using TWRP
2: Install a GSI, for example, Android 12 GSI
3: In need of going back, first install the Android 11 GSI
4: Once with the 11 GSI installed, recover the TWRP Backup
Would that be correct?

Categories

Resources