[Q] Backup Original Rom - Galaxy S II Q&A, Help & Troubleshooting

Hi all,
I'm looking to make a full backup of my phone, including rom kernel radio etc. I want to install new roms on it, mainly Cyanogenmod, but I want to be able to revert back to the way it is right now. I'm aware that there are stock rom available for download but I'd rather backup mine so I know it's exactly the correct one (maybe different branding, version, etc).
I found a post by HellcatAndroid stating that this would backup everything:
Code:
dd if=/dev/block/mmcblk0p1 of=/sdcard/p1-EFS.img bs=4096
dd if=/dev/block/mmcblk0p4 of=/sdcard/p4-PARAM.img bs=4096
dd if=/dev/block/mmcblk0p5 of=/sdcard/p5-KERNEL bs=4096
dd if=/dev/block/mmcblk0p8 of=/sdcard/p8-MODEM.bin bs=4096
dd if=/dev/block/mmcblk0p9 of=/sdcard/p9-FACTORYFS.rfs bs=4096
dd if=/dev/block/mmcblk0p12 of=/sdcard/p12-HIDDEN.img bs=4096
I'm curious about a few things... given that these partitions are already mounted, some as read-write, it seems dangerous to obtain a corrupted image. Obviously, I've already manually rooted my phone. That part I can easily undo manually later on too.
Also, once you have this, is odin the only solution to flash back the image?
Is there a decent guide on how to backup your entire phone before flashing anything on it?
By the way, CWM isn't an option given that flashing it would overwrite something I'd like to backup.

install cwm ...
boot into cwm recovery
Backup/restore
full Nandroid backup....
U can later restore from cwm.
Everything is backed up. ( kernel .. radio.. settings .. )
As if nothing happened.

But if I understand correctly, installing CWM overwrites something. I won't be able to recover that part...

Which on is the recovery partition?

u can flash an official based rooted kernel with cwm...its the same as official just with cwm cf-root.
this one is based on LPQ latest kernel.... http://downloadandroidrom.com/file/GalaxyS2/kernels/ICS/CFRoot/CF-Root-SGS2_XX_XEO_LPQ-v5.3-CWM5.zip
if u have 4.0+
what u are asking cannot be done without root.

Like I said in the original post, I have manually rooted my phone. I have full root access from adb shell and I've compiled the SU binary by chainsdd. If I flash the cf-root kernel, I overwrite the original kernel which I don't want to do.
I can install CWM by itself, I just want to backup my recovery partition first. Unless the recovery partition is rebuilt automatically when flashing the stock kernel back?

after restore using CWM.....
Flash official firmware ( LPQ 4.0.3 ) .....
Everything will stay the same. except ull have a fresh official kernel. and keep ur data, setting etc.....
im not sure u can get into cwm without an unsecure kernel flashed via odin....

Related

[Q] Noob question: backup before custom recovery

Ok, first of all: I used the search button and Google a lot before coming here to post this.
My question is totally noob: can I make a NAND backup of my mobile, *before* rooting it, *before* installing custom recovery?
I'd like to do it because I'd really like to install a custom firmware (I'm oriented towards Prime or Megatron) on my O1, but I really want to have an opportunity to come back to the original firmware in case I need to repair my phone.
I've seen a large number of ways for doing backup of a phone *after* the custom recovery, but no one before.
Another question is: is it necessary to install the Android SDK for installing custom recovery, or can I run the adb commands from my mobile?
Thanks everyone in advance for the help!
The answer to your question "can I make a NAND backup of my mobile, *before* rooting it, *before* installing custom recovery?" is no. The custom recovery is the software that provides the nandroid backup facility. Without that custom recovery, you can't make a NAND backup (yet another good reason to do it).
What you can do is to backup the existing recovery image. From http://forum.xda-developers.com/showpost.php?p=9377725&postcount=9, you can do
Code:
dd if=/dev/mtd/mtd2 of=/sdcard/recovery-dump-T.img bs=4096
which will save off the stock recovery image to your sdcard. If you want to restore to the stock recovery, you can do
Code:
flash_image recovery /sdcard/recovery-dump-T.img
after you have installed the flash_image program. (Installing the flash_image program is a completely reversible step that needs root permissions, but can be completely undone.)
For your second question, all of the commands can be run from the Terminal on your phone. Note that your phone will need to be rooted and you will have to do "su" before you start typing commands. Having done "su", your prompt should turn to # instead of $.
Thank you very much for your detailed answer.
Now the question is: do I really need to do all of this stuff, or there's a way to bring back to the phone to original recovery/original OS without doing a backup myself, i.e. there is some image available from LG that restores the phone as out-of-the box?
There is only one tool from LG - LG update which updates whole your phone. It rewrite everything, also custom recovery.
Same "work" can be done with tool called KDZ_FW_UPD but, I didn't recommend it if it is not necessary.
For more information about KDZ_FW_UP take look on http://forum.xda-developers.com/showthread.php?t=875881

[Q] some noob's questions

Hi all,
I'm trying to understand how a mobile rom is partitioned and using adb and fastboot i have understood this:
There are 3 partition
-recovery (where work CWM or other recovery software)
I can flash a recovery software via fastboot, righ?
-boot :
I"m not sure of this, but should be the partition of the kenerl? Pls correct me if i am wrong
-other partition:
For system apk ?
This is what i think, pls help me to understand better my rom partitions
After this:
- if i flash i kenerl i modify boot partition (i'm pretty sure of this)
- if i flash a recovery , modify recovery obviously
- if i flash a rom what really modify? Q.Q
Ok last noon question..
How to do a nandroid backup?
it's enough the CWM backup
Or is a backup from adb?
And from adb how to backup ?
It'd enough
"./adb shell backup " ?
How someone have a bit of time to answer to me
Thank u all
Yes, boot is the kernel... When you install a ROM, you modify your /system partition. To make a nandroid backup just use cwm.
Sent from my HTC branded muffin...

Please check-in here if your wifi is not working after flashing/bootloops

Hoping to use this thread to help members who are having bootloops/wifi/etc. issues after flashing different kernels/system images.
If wi-fi is not working (A2017U B20):
bkores said:
Boot into TWRP, then connect your phone to your computer making sure adb is working then execute:
adb shell dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1 bs=16384
adb shell dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2 bs=16384
This should be your output:
/dev/block/platform/soc/624000.ufshc/by-name # dd if=/dev/zero of=/dev/block/boo
tdevice/by-name/modemst1 bs=16384
dd: writing '/dev/block/bootdevice/by-name/modemst1': No space left on device
129+0 records in
128+0 records out
2097152 bytes (2.0MB) copied, 0.001917 seconds, 1.0GB/s
/dev/block/platform/soc/624000.ufshc/by-name # dd if=/dev/zero of=/dev/block/boo
tdevice/by-name/modemst2 bs=16384
dd: writing '/dev/block/bootdevice/by-name/modemst2': No space left on device
129+0 records in
128+0 records out
2097152 bytes (2.0MB) copied, 0.001829 seconds, 1.1GB/s
/dev/block/platform/soc/624000.ufshc/by-name #
Click to expand...
Click to collapse
You also need the crossed out boot.img from Here
If you're using an SD card, reboot your phone to TWRP. Make sure external SD is mounted in TWRP. On your PC, in the folder where your downloaded and extracted the boot.img, type:
Code:
adb push boot.img /external_sd/b20b_boot.img
adb shell if=/dev/block/sde12 of=/external_sd/boot_backup.img
adb shell if=/external_sd/b20b_boot.img of=/dev/block/sde12
adb reboot
Please post the steps you took to end up with bootloops/wifi issues, what exact issues you are having (wifi/bluetooth/cell/boot logo) as well as which recovery (stock/twrp) you currently have installed.
You and me both my friend, I created a thread like a week ago to gather info about what you are saying here, but seems like they don't want to participate for a fix.
http://forum.xda-developers.com/axon-7/help/post-current-boot-issues-read-posting-t3447987
DrakenFX said:
You and me both my friend, I created a thread like a week ago to gather info about what you are saying here, but seems like they don't want to participate for a fix.
http://forum.xda-developers.com/axon-7/help/post-current-boot-issues-read-posting-t3447987
Click to expand...
Click to collapse
Well, we got two sub-forums covered now. Let's see if anyone bites.
Well I did Draken's B20_Boot TWRP Backup Xposed+Root Edition Provided by DrakenFX , which cause a no boot situation, with no access to recovery. used tenfar's root without bootloader unlock to flash boot and recovery, then Draken's software image booted but no wifi. Still haven't fixed that one yet.
@thjoca3 do you know what system.img file you used? Is it a b20_boot system.img?
jkuczera said:
@thjoca3 do you know what system.img file you used? Is it a b20_boot system.img?
Click to expand...
Click to collapse
That I'm not sure, it's whatever system is packaged with Draken's backup
@thjoca3 here are my current boot and system files. They are both b20_boot.
https://drive.google.com/folderview?id=0Bx04wovXfQGeYlpqSHhvS3Noc28
Exactly what this thread says to do...http://forum.xda-developers.com/axon-7/how-to/how-to-restore-a2017u-to-functional-t3445895
I downloaded the TWRP backup from that thread, and then downloaded Tenfar's tool from his own thread. I used his thread(Tenfar's) for the acquiring of the tool, as well as downloading a2017U B20 (since B20_boot unlocked is crossed out?). I then flashed the boot and recovery .img(using Tenfar's tool), then restored to the TWRP backup in TWRP provided by rcriderz. Afterwords, my phone booted up, but did not have Wifi access. That seems to bethe only feature missing... At this point I think I'd just rather wait for the first cyanogenmod release, but this is how I got to this point. I did this in the first place because I bricked my device by using GravityBox and rebooting so the settings would kick in. Device info: US Variant, unlocked bootloader via ZTE request form, TWRP installed
jkuczera said:
@thjoca3 here are my current boot and system files. They are both b20_boot.
https://drive.google.com/folderview?id=0Bx04wovXfQGeYlpqSHhvS3Noc28
Click to expand...
Click to collapse
maybe not totally sure how to use this, but I can't seem to get anything bigger than 5gb or so to load on to my sd card, or extract anything that size onto the sd card.
jkuczera said:
@thjoca3 here are my current boot and system files. They are both b20_boot.
https://drive.google.com/folderview?id=0Bx04wovXfQGeYlpqSHhvS3Noc28
Click to expand...
Click to collapse
I know this is not my thread but having it little more info in the following form will help a lot lIssue
- Model :
- Previuos Version :
- Current Version :
- Issue / Problem :
- How happen :
That will help a lot figure things out.
DrakenFX said:
I know this is not my thread but having it little more info in the following form will help a lot lssue
- Model : A2017u
- Previous Version : locked bootloader, twrp, stock rom, was never able to get full root, and always had password needed in twrp, b20_boot
- Current Version : same other than using your system, from the B20_Boot TWRP Backup Xposed+Root Edition (still no root) had to flash boot and recovery from tenfar to get it to boot.
- Issue / Problem : no wifi, cannot copy anything over 5gb to sdcards... cant get back to stock
- How happen : flashed B20_Boot TWRP Backup Xposed+Root Edition via twrp, never lost wifi, till I flashed this.
That will help a lot figure things out.
Click to expand...
Click to collapse
zz
thjoca3 said:
maybe not totally sure how to use this, but I can't seem to get anything bigger than 5gb or so to load on to my sd card, or extract anything that size onto the sd card.
Click to expand...
Click to collapse
The problem is likely the format of your SD card. It needs to be in a format that accepts files > 4GB. I believe exFAT or ext4 should work.
http://kb.sandisk.com/app/answers/d...rger-file-to-a-usb-flash-drive-or-memory-card
Well found an sdcard reader and was able to get files to the sdcard. Restored with warofhero's system image, and my stock boot and recovery, no change with wifi. Also loaded the b20_boot with stock recovery and no wifi.
thjoca3 said:
Well found an sdcard reader and was able to get files to the sdcard. Restored with warofhero's system image, and my stock boot and recovery, no change with wifi. Also loaded the b20_boot with stock recovery and no wifi.
Click to expand...
Click to collapse
Recovery should have zero effect on the outcome of Wi-Fi functioning during normal boot. I believe the issue with wi-fi is a mismatch of boot.img and system.img.
Do you know if warofhero's system image a b20 or a b20_boot?
jkuczera said:
Recovery should have zero effect on the outcome of Wi-Fi functioning during normal boot. I believe the issue with wi-fi is a mismatch of boot.img and system.img.
Do you know if warofhero's system image a b20 or a b20_boot?
Click to expand...
Click to collapse
I tried both on his, neither worked for me. Then I did this
Download rczrider's TWRP System backup, restored in twrp with the boot from tenfar's post - a2017u B20 http://d-h.st/LqR5 (modified from @rczrider‘s backup real stock b20 boot.img) and my wifi is back.
thjoca3 said:
I tried both on his, neither worked for me. Then I did this
Download rczrider's TWRP System backup, restored in twrp with the boot from tenfar's post - a2017u B20 http://d-h.st/LqR5 (modified from @rczrider‘s backup real stock b20 boot.img) and my wifi is back.
Click to expand...
Click to collapse
That's awesome, glad you got it fix.
So you have a full operational device now? Hope this solution help others.
DrakenFX said:
That's awesome, glad you got it fix.
So you have a full operational device now? Hope this solution help others.
Click to expand...
Click to collapse
Yes, appears everything is working now, with the modified boot.
I posted this somewhere else as well but here it goes again.
The booti.img and system have to match and be from the same set. So if you use stock B20 (not _Boot) boot.img then you have to use the same /system. In this case this would be
For locked bootloader use rcrider's boot(no root) + system or tenfar's boot(root) + rcrider's /system
For unlocked bootloader you would use B20_Boot boot+system like one jkuczera posted upthread
Do not mix and match files form different region's either, these are both from US A2017U model.
When bootlooping, there are multiple reasons why this could be:
- wrong modle boot.img
- unrotted boot.img and modded recovery or system while BL is locked
- /system flashed with unsuported SU or Xposed
- boot.img flashed with unsupported kernel/ramdisk patch
- junk in cache/dalvik
- junk in /data
- /data encrypted with key which cannot be decrypted due to altered cryptochain
The way to fix it most of the time is to flash proper boot and system and wipe all user partitions. tenfar's tools can restore boot and recoveries very painlessly. TWRP can take care of the /system and wipes. The only unknown at this point is if the system image can be flashed in TWRP in a OTA consistent state on the B20 version. This should be doable by running TWRP in read only mode but i do not know if that will still let you restore system. It also has to be "System Image" backup (6GB one) from TWRP and not just the /system partition for block consistency. Hope this helps sort out the problems. I might try all this out once i am certain I'll keep the phone, it is currently in trial mode for few more weeks. The full "System Image" for B20_boot was posted here http://forum.xda-developers.com/showpost.php?p=68248798&postcount=53 , (edit: jkuczera's is also System Image and same size). maybe rcrider can put up one for B20 Stock on his MEGA
peramikic said:
The only unknown at this point is if the system image can be flashed in TWRP in a OTA consistent state on the B20 version. This should be doable by running TWRP in read only mode but i do not know if that will still let you restore system. It also has to be "System Image" backup (6GB one) from TWRP and not just the /system partition for block consistency.
Click to expand...
Click to collapse
Thanks for clarifying @peramikic.
For the quote above, I don't understand what you mean by OTA consistent state. Do you mean a state in which OTA would still occur even after bootloader unlock?
jkuczera said:
Thanks for clarifying @peramikic.
For the quote above, I don't understand what you mean by OTA consistent state. Do you mean a state in which OTA would still occur even after bootloader unlock?
Click to expand...
Click to collapse
This probably goes more for the B20 folks, since i doubt we will see an OTA from ZTE that will work on B2-_Boot. But in essence the System Image backups are supposed to produce bit level mirror image of the /system partition so that OTA update will properly hash it. Chances are very high that when you restore regular ext4 backups, while the files are the same they will not be laid out on the partition the same way. That's why /system is strictly read-only now. Even just enabling that RW access in TWRP can alter it. For instance the image you and swehes have posted differs slightly in first 4MB of the files (his has some stuff while your is all 0s) and then again in offset 69bd000 or so where one file is missing from your's i think it's the recovery-from-boot file. It is likely TWRP removed it so it would not get flashed over after reboot with stock recovery, if you allowed RW access to system.

Phone reboot loop (RS988 Unlocked 21D Stock)

The issue started with a couple of mistakes on my part from not reading the forums throughly before attempting something new.
Had installed a custom ROM (AOSPA) using TWRP 3.2.1 (v3) available here on xda. Tried to carry out a factory reset on the unit from inside the OS. Apparently this can cause recovery bootloops. I tried wiping all the partitions and flashing a stock (21D) full zip file from recovery. This had no effect. I then read that I could try to enter the commands
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/misc
dd if=/dev/zero of=/dev/block/platform/soc/624000.ufshc/by-name/fota
I would not suggest anyone does this. It, however this resulted in the message that the devices was too corrupt to boot (not just the warning of corruption after bootloader unlocking). So I used LGUP and autoprimes (thanks to that well informed gent by the way) Uppercut to be able to flash a KDZ file of stock from download mode. Only that the kdz available for the US unlocked version would not flash (21C) and I had to flash the (21H) of the Brightpoint version. I reasoned that after I installed it I would be able to install TWRP and install the stock ROM (21D) back in recovery. It installed "successfully" but after booting into the OS it now restarts every 30 seconds or so. Not making it terribly functional as you can imagine. I have tried using both full 21D stock zip versions available in this forum by the way. So if anyone has experienced something similar I'd be glad for advice, if not, then thanks for reading my long story.

How to use magisk to twrp from 2.3.5 gingerbread without a computer?

How to use magisk to twrp from 2.3.5 gingerbread without a computer?
@Didgeridoohan
Do you think its possible to flash twrp from a terminal emulator? Or what are my options?
If you really can't get a hold of a computer you might be lucky with an app like Franco Kernel Manager, Flashify, etc. Problem is that most apps likely won't support or be compatible with that ancient version of Android or whatever root you currently have installed. And, you're also risking bricking your device if you don't have access to a computer...
I really think your best bet is to somehow get access to a computer. Friend/school/work/something...
If you can't install stuff on that borrowed computer you could create a bootable USB with a Linux distro and run everything from there. Linux Mint is quite user friendly, they've got good documentation on how to get things running with a Live Boot USB, and it's not too hard to get adb & fastboot up and running.
Ill try and get a hold of a computer because nothing seems to work on 2.3.5
@Didgeridoohan
I had rooted using framaroot but after a factory reset it wont install supersu or superuser to my app drawer, can you give me a suggestion? Btw im using my xbox one to type this.
@chris1892006
don't waste your time with this: Magisk works only on Android 5.0 and above.
jwoegerbauer said:
@chris1892006
don't waste your time with this: Magisk works only on Android 5.0 and above.
Click to expand...
Click to collapse
thanks so do u know if its possiblle to flash a twrp.zip using terminal on 2.3.5?
chris1892006 said:
thanks so do u know if its possiblle to flash a twrp.zip using terminal on 2.3.5?
Click to expand...
Click to collapse
Is it so hard to read posts carefully?
I found this https://www.youtube.com/watch?v=-YAKGRblIuw
dd Install Method (Requires Root):
Download the latest image file (.img) from the download link above. Place it in the root of your /sdcard folder and rename it to twrp.img. Run the following commands via adb shell or a terminal emulator app:
su
dd if=/sdcard/twrp.img of=/dev/block/mmcblk0p9
What part of the command do i change for a yp-g70 venturi? Also can i extract my twrp 2.8.0.0.zip and get the .img out of it or can i flash the .zip?
This what i used to flash cwm/ entropys daily driver kernel
https://forum.xda-developers.com/showthread.php?t=1445840
su
dd if=/sdcard/zImage of=/dev/block/mmcblk0p11
Well i got cwm installed! Now i just need to flash twrp and then a rom
chris1892006 said:
... Now i just need to flash twrp and then a rom
Click to expand...
Click to collapse
Notice, that for Lollipop and up to get it running smoothly, you need a device with minimum 2GB RAM and at least 2GHz dual core processor - what since Android 4.4+ must be a ARMv7 one.
jwoegerbauer said:
Notice, that for Lollipop and up to get it running smoothly, you need a device with minimum 2GB RAM and at least 2GHz dual core processor - what since Android 4.4+ must be a ARMv7 one.
Click to expand...
Click to collapse
Thanks i had 4.4.4 up and running but tried flashing 5.1.1 lollipop on cwm and it corrupted the bootloader. Now i cant get into recovery because twrp wouldnt flash over cwm, i tried to flash twrp 2.8.0.0 & it succeeded yet didnt work after a reboot, why? I read the op but i still cant figure out why it didnt work after a reboot? Still remained cwm.
https://forum.xda-developers.com/galaxy-player/development/recovery-twrp-v2-8-0-0-t2867742
http://www.meticulus.co.vu/p/yp-g70.html
@Didgeridoohan
How do i flash twrp over cwm?
Hey... Look at that, you had some progress. Nice.
I've never used CWM, so I wouldn't know.... Sorry.
@chris1892006
Have you backed up stock recovery IMG through e.g. Flashify app before installing a custom recovery by means of CWM ? Do remember that restoring a backup will essentially wipe any changes made after that backup.
If so then
1. you can restore or flash stock recovery IMG through Fastboot to get CWM out of your system.
2. you can install through TWRP any custom recovery IMG of your choice.
jwoegerbauer said:
@chris1892006
Have you backed up stock recovery IMG through e.g. Flashify app before installing a custom recovery by means of CWM ? Do remember that restoring a backup will essentially wipe any changes made after that backup.
If so then
1. you can restore or flash stock recovery IMG through Fastboot to get CWM out of your system.
2. you can install through TWRP any custom recovery IMG of your choice.
Click to expand...
Click to collapse
thanks only problem is they only make a .zip for twrp for my device... I don't know how to flash it.
That's a really old android version, I'm not sure if it's possible. If you don't have access to a PC, try to ask a friend if they could do it for you, just to be safe. Trying to modify stuff within android, especially on such an old version, with probably unsupported software could result in a bricked device.
Thanks but I finally got TWRP and Lollipop 5.1.1 installed it took an ADB Sideload from a PC to sideload the twrp.zip file for my device and now I'm up and running and very happy to say the very least. Sure I bricked it 3 times in the process but was always able to recover using ODIN and having the proper files on hand.
Now im having an issue with xda on the device where the xda app wont let me sign in and the browser will sign me in but go right back to the sign in page again, idk how to fix it?
I install a dalvik cache wiper with root required and it corrupted the recovery again. So I figured out the exact steps to get this device working perfectly again. Firstly the twrp folder on the external sd card has to be renamed TWRP because it has extra strange characters after the TWRP. Now we know how to restore our backup, we can start by ODIN back to stock, then Framaroot v1.4.1 root the device then download entropys daily driver kernel cwm, the flash it via terminal emulator, reboot, then you have to install meticulous carbon 4.4.4 to fix the partitions and update the cwm to adb sideload the twrp. So you can then flash Meticulus Carbon 5.1.1 and both updates and 5.1.1 pico gapps. Good to go. Meticulus made the kernel overclock to 1.7ghz and it runs pretty darn good honestly. I modded the build.prop vm dalvik heap limit to 384m from 128m to get some extra performance out of it.

Categories

Resources