[Q] How to dump stock recovery - Nexus S Q&A, Help & Troubleshooting

I'm getting ready to flash CM7 onto my NS4G, but I want to backup the stock recovery before I start in case I want to revert back to pure stock. I know that there are placed where I can download other people's recovery dumps, but I'd really like to create my own.
Does anyone know how to get a recovery dump of the stock recovery. My issue comes in the fact that dumping recovery seems to require root, but rooting the NS is done by unlocking the bootloader and flashing the recovery. It's a catch 22, I can't backup the recovery without rooting but I can't root without flashing the recovery.
Any tips?

In a terminal:
dd if=/dev/mtd/mtd3 of=/sdcard/recovery.img

If you cat /proc/mtd it will output the value (partition) of all your mtd's. It will tell you what each is. Very handy i think.

snandlal said:
In a terminal:
dd if=/dev/mtd/mtd3 of=/sdcard/recovery.img
Click to expand...
Click to collapse
The trouble is that running dd requires root. I'm not aware of a root exploit for the Nexus S 4G 2.3.5. The current method to root the phone is to unlock it, flash ClockworkMod recovery, and flash superuser.

I accidentally solved my own problem. I gave up on trying to find a way to backup the stock recovery and I just moved forward with loading CM7. However, in the process I discovered a way to backup the full un-rooted stock system, including the stock recovery.
Here are the steps I took (more detailed steps on CyanogenMod wiki):
1. Unlock the phone using "fastboot oem unlock" (this did a factory reset, including the SD/USB memory)
2. Rebooted into the bootloader
3. Installed ClockworkMod Recovery using "fastboot flash recovery recovery-clockwork-3.1.0.1-crespo4g.img" while in the bootloader
4. Without leaving the bootloader I selected Recovery. This launched ClockworkMod Recovery.
5. Used ClockworkMod Recovery to run a NAND backup.
I can't fully explain this, but the backup included the stock recovery. When I restarted the phone and launched recovery again it still had my stock recovery image installed. The only way I can explain this is that "fastboot flash recovery" only flashed ClockworkMod temporarily while I was in the bootloader, I'm not sure how that works.
After flashing CM7 I used ROM Manager to install ClockworkMod Recovery again, and using that method caused it to stick. However, restoring my stock backup does in fact flash me back to stock recovery.
Long story short, I was able to get a clean backup of non-rooted stock. If I want to go back to pure stock for warranty or other reasons I only have two steps to take:
1. Restore my stock backup
2. Lock the bootloader

Check for /system/etc/install-recovery.sh delete or change permissions to 000. When booted to OS,it will rewrite over custom recovery

agasser said:
Long story short, I was able to get a clean backup of non-rooted stock. If I want to go back to pure stock for warranty or other reasons I only have two steps to take:
1. Restore my stock backup
2. Lock the bootloader
Click to expand...
Click to collapse
And Samsung can still read out the phone's files to see the bootloader was unlocked IF they wish to

agasser said:
I can't fully explain this, but the backup included the stock recovery. When I restarted the phone and launched recovery again it still had my stock recovery image installed. The only way I can explain this is that "fastboot flash recovery" only flashed ClockworkMod temporarily while I was in the bootloader, I'm not sure how that works.
Click to expand...
Click to collapse
Your NANDroid backup does contains CWM recovery. The reason you get the stock recovery after reboot is because of the /system/etc/install-recovery.sh script. (see what snandlal said above)
I think CM7 does not include that script in their ROM.

Related

[Q] would this rooting method work?

not sure if this is what everyone is already doing, but I was trying to figure out how it might work
stock ota 2.3.1 os
fastboot oem unlock
flashed clockworkmod recovery
boot into recovery nandroid backup stock non-rooted os (just in case )
flash su-2.3.6.1....zip
nandroid backup again
take the boot.img from this nandroid backup and fastboot flash boot
onicrom said:
not sure if this is what everyone is already doing, but I was trying to figure out how it might work
stock ota 2.3.1 os
fastboot oem unlock
flashed clockworkmod recovery
boot into recovery nandroid backup stock non-rooted os (just in case )
flash su-2.3.6.1....zip
nandroid backup again
take the boot.img from this nandroid backup and fastboot flash boot
Click to expand...
Click to collapse
No.
10chars
fastboot oem unlock
flash cwm recovery
nandroid backup
mount /system
flash the su-2361 zip
boot up
rename/delete /etc/recovery.sh (or whatever the exact file is)
download rom manager, flash latest cwm (as of right now it's 3.0.0.5)
reboot to recovery to make sure cwm loads properly and updated.
done.
nxt said:
download rom manager, flash latest cwm (as of right now it's 3.0.0.5)
Click to expand...
Click to collapse
Caution with the 3.0.0.5 latest CWM. I can't get into CWM recovery with that one; I had to downgrade back to 3.0.0.0. The phone just stalls at the Google screen on boot up with it.
Another person's reported the issue in another thread here. I emailed koush, but no response yet.
@nxt, you've tested 3.0.0.5 and it works as expected?
distortedloop said:
Caution with the 3.0.0.5 latest CWM. I can't get into CWM recovery with that one; I had to downgrade back to 3.0.0.0. The phone just stalls at the Google screen on boot up with it.
Another person's reported the issue in another thread here. I emailed koush, but no response yet.
@nxt, you've tested 3.0.0.5 and it works as expected?
Click to expand...
Click to collapse
Not nxt, but I haven't had any issues with 3.0.0.5. Flashing, restoring, or anything at all.
unremarked said:
Not nxt, but I haven't had any issues with 3.0.0.5. Flashing, restoring, or anything at all.
Click to expand...
Click to collapse
Interesting. I wonder what the quirk is on mine and the other guy's. I haven't tried flashing it from fastboot, but selecting reboot to recovery from within ROM Mgr will not load recovery, it just hangs. No issues with 3.0.0.0.
distortedloop said:
Interesting. I wonder what the quirk is on mine and the other guy's. I haven't tried flashing it from fastboot, but selecting reboot to recovery from within ROM Mgr will not load recovery, it just hangs. No issues with 3.0.0.0.
Click to expand...
Click to collapse
Works fine for me normally. I personally don't use rom Manager to do anything though. I manually reboot into recovery and do recovery stuff. I have not tried selecting reboot to recovery via ROM Manager. That might be the issue.

[Q] Backing up front to allow restoring to factory?

I got my Motorola DEFY recently, and I'm new to Android, but I want to install stuff that needs root. However, I want to be able to restore everything to how the phone was when I got it, should the need arise.
I successfully rooted using z4root and installed ROM manager, at which point I did some googling and discovered that if I install ClockworkMod Recovery it's not easy to revert back to the normal recovery console. It's not that hard, but I understand it requires an image of the original recovery console. I thought that the backup option on ROM Manager would help, but it requires ClockworkMod Recovery to be installed.
So the question is, can the recovery console be backed up prior to installing ClockworkMod Recovery, or alternately can the entire phone state be backed up, including the recovery console and the rest of the ROM.
Help would be appreciated. Thanks!
If you install CWM Recovery you can do a nandroid backup of your stock ROM so that you can revert later. You don't need to worry about a stock recovery image because once you restore the backup you made, the custom recovery will be overwritten with the stock one with every reboot.

[Q] CWM backup without root. possible?

I unlocked the bootloader when I got my Xoom but I never bothered to root it.
I am thinking about rooting it now but would like to make a CWM backup before rooting it incase I mess something up.
So my question is....
Can I use ADB to push CWM to the recovery partition to make a backup before rooting?
If I just want to make a backup and not root, can I push CWM via ADB then push the stock recovery back to the xoom?
I am pretty knowledgeable with rooting and roming Android devices.
Thanks
Bill
pickle3782 said:
If I just want to make a backup and not root, can I push CWM via ADB then push the stock recovery back to the xoom?
Click to expand...
Click to collapse
yes, you can...
I'd push the recovery using fastboot, though. Just boot into that recovery and run the backup. If you reboot without rooting, the stock recovey will be restored automatically
llama-power said:
yes, you can...
I'd push the recovery using fastboot, though. Just boot into that recovery and run the backup. If you reboot without rooting, the stock recovey will be restored automatically
Click to expand...
Click to collapse
Awesome. Thats kind of what I gathered from reading these forums but just wanted to make sure.
1. Push CWM in fastboot
2. Make backup
3. Reboot and stock recovery will be restored
That sounds simple enough.
Thanks for the response.

[S3]please help me unbrick my one s ville c2

i tried to install trickdroid, which went wrong. being the idiot that i am, i erased everything, system, cache, all i could find. now i tried this:
1) Use the All-in-One-Kit and flash your recovery back to stock
2) Boot into the bootloader and choose to "clear storage" and afterwards to reset to factory defaults.
3) Go back to the all-in-one-kit and flash a CWM recovery version again.
4) Reboot into recovery (CWM). Your /sdcard should now be mounted and visible.
5) Now, try the UTB rom (it worked for me), rename the zip file to something short (i.e. utb.zip), and push it to the sdcard using adb as follows:
Code:
adb push utb.zip /sdcard
6) While still in CWM, flash the zip.
i relocked my phone, but i dont know how to flash stock recovery. i have the stock_recovery.img and i installed all in one kit, but i am not sure what to do now. i tried FLASH RECOVERY/ your own recovery and then flash cwm, but i dont get that option to clear storage, which makes me think i did something wrong. can someone please explain step by step what i need to do? now i am very very angry and i dont think i can think straight at the moment and cant really focus.
thanks a lot
EDIT: now i am downloading the RUU file for one s s3 europe....
saculetz said:
i tried to install trickdroid, which went wrong. being the idiot that i am, i erased everything, system, cache, all i could find. now i tried this:
1) Use the All-in-One-Kit and flash your recovery back to stock
2) Boot into the bootloader and choose to "clear storage" and afterwards to reset to factory defaults.
3) Go back to the all-in-one-kit and flash a CWM recovery version again.
4) Reboot into recovery (CWM). Your /sdcard should now be mounted and visible.
5) Now, try the UTB rom (it worked for me), rename the zip file to something short (i.e. utb.zip), and push it to the sdcard using adb as follows:
Code:
adb push utb.zip /sdcard
6) While still in CWM, flash the zip.
i relocked my phone, but i dont know how to flash stock recovery. i have the stock_recovery.img and i installed all in one kit, but i am not sure what to do now. i tried FLASH RECOVERY/ your own recovery and then flash cwm, but i dont get that option to clear storage, which makes me think i did something wrong. can someone please explain step by step what i need to do? now i am very very angry and i dont think i can think straight at the moment and cant really focus.
thanks a lot
EDIT: now i am downloading the RUU file for one s s3 europe....
Click to expand...
Click to collapse
To go back to STOCK [S3 - VilleC2] recovery, you must RELOCK bootloader, and than flash THE RUU for your device: (RUU_VILLEC2_U_ICS_40_HTC_Europe_1.11.401.110_Radi o_16.12.20.02U_16.05.20.16_M2_release_263510_signe d.exe - google it!) - in my case this version worked fine (after RELOCK bootloader) - (ATTENTION! it will erase everything as well as UNLOCK process even after RELOCK) - you'll be back to STOCK ROM with STOCK recovery.
All_in_One_Kit is not proven to work on S3
luxandroid said:
To go back to STOCK [S3 - VilleC2] recovery, you must RELOCK bootloader, and than flash THE RUU for your device: (RUU_VILLEC2_U_ICS_40_HTC_Europe_1.11.401.110_Radi o_16.12.20.02U_16.05.20.16_M2_release_263510_signe d.exe - google it!) - in my case this version worked fine (after RELOCK bootloader) - (ATTENTION! it will erase everything as well as UNLOCK process even after RELOCK) - you'll be back to STOCK ROM with STOCK recovery.
All_in_One_Kit is not proven to work on S3
Click to expand...
Click to collapse
thanks for the reply
thing is i erased everything, and the only thing i get now is fastboot/hboot. i relocked the phone via hasoon all in one kit, but i dont know how to flash recovery. i tried to but i dont know how to check if the process succeeded. what i need is someone to tell me the steps i have to follow to flash stock recovery and then that RUU file which i am downloading now.
EDIT: i finished downloadin the stock RUU. how can i flash it? i only have fastboot on my phone, i erased everything else

Multiple recoveries installed

I'm screwed. I attempted to install an updated TWRP, so i selected that option in ROM Toolbox Pro. Everything installed correctly (TWRP 2.7??). I decide let me see if TWRP installer will replace that with the updated 2.8.5. I run TWRP installer and it installs correctly. My assumption was that the TWRP installer would overwrite the ROM Toolbox version. Well, i reboot into the 2.8.5 recover (like it suggested) and i hit Reboot and then it reboots into 2.7. From there it thinks there is no OS installed. Rebooting from there just reboots me back in 2.7 recovery. I can get into Fastboot, and then back in 2.8.5 recovery. I flashed a new ROM, but that didn't fix it. I attempted to flash an RUU but i can't seem to get that working either. Am I completely screwed and should i call insurance on it?
Help me XDA, you're my only hope.
theoden144 said:
I'm screwed. I attempted to install an updated TWRP, so i selected that option in ROM Toolbox Pro. Everything installed correctly (TWRP 2.7??). I decide let me see if TWRP installer will replace that with the updated 2.8.5. I run TWRP installer and it installs correctly. My assumption was that the TWRP installer would overwrite the ROM Toolbox version. Well, i reboot into the 2.8.5 recover (like it suggested) and i hit Reboot and then it reboots into 2.7. From there it thinks there is no OS installed. Rebooting from there just reboots me back in 2.7 recovery. I can get into Fastboot, and then back in 2.8.5 recovery. I flashed a new ROM, but that didn't fix it. I attempted to flash an RUU but i can't seem to get that working either. Am I completely screwed and should i call insurance on it?
Help me XDA, you're my only hope.
Click to expand...
Click to collapse
To solve this, you could get phone into Fastboot and flash Dottat's RUU for the M8 - he made several versions.
For sure, add HTC_Fastboot.exe to your ADB folder and use it, NOT regular fastboot.
It will overwrite your previous recovery with stock and fix your phone. Then later, you could flash TWRP 2.8.7 thru Fastboot.
I put Dottat's RUU on my external SD card and it loaded, however, whenever it goes to reboot, it still goes back into the wrong recovery.
It's probably not necessary to run an RUU. You incorrectly flashed the new recovery to the wrong partition. Flash the new recovery VIA FASTBOOT, boot into it through the bootloader screen, and either flash a rom or restore a backup and you should be good to go. You definitely don't need to be worrying about an insurance claim for now.
Edit: by VIA FASTBOOT I mean with the command fastboot flash recovery <nameofrecoveryfile>.img
cntryby429 said:
It's probably not necessary to run an RUU. You incorrectly flashed the new recovery to the wrong partition. Flash the new recovery VIA FASTBOOT, boot into it through the bootloader screen, and either flash a rom or restore a backup and you should be good to go. You definitely don't need to be worrying about an insurance claim for now.
Edit: by VIA FASTBOOT I mean with the command fastboot flash recovery <nameofrecoveryfile>.img
Click to expand...
Click to collapse
I would flash firmware or ruu, if indeed he flashed recovery to wrong partition, that partition needs the correct one which firmware wlil do, and ruu will 100% do.
Personally I'd run ruu, go to stock recovery and run a factory reset.
theoden144 said:
I put Dottat's RUU on my external SD card and it loaded, however, whenever it goes to reboot, it still goes back into the wrong recovery.
Click to expand...
Click to collapse
Gotta use ADB and HTC_Fastboot.exe
Thanks for all the tips. I tried re-installing the old ROM after I ran the RUU and it worked. Hopefully it cleared out the incorrect recovery. Lesson learned: don't use apps to update the recovery!
Again thanks for all the help!
theoden144 said:
Thanks for all the tips. I tried re-installing the old ROM after I ran the RUU and it worked. Hopefully it cleared out the incorrect recovery. Lesson learned: don't use apps to update the recovery!
Again thanks for all the help!
Click to expand...
Click to collapse
Twrp manager is not a safe way to flash recovery because they aren't flashing by block name yet. They are still hard-coded to block number. The partitions have changed during ota already...so the app does hose things up a bit.
Sent from my Nexus 6 using Tapatalk

Categories

Resources