[Q] how to use dd or nvflash to create backup of recovery? - T-Mobile LG G2x

Recently I got Wind Optimus 2x (p999). Before I change anything, I want to create a full backup in case of warranty. Searching forum and google for couple of days I found several different "stock" recovery images. But all of them have different size/date/etc.. So I want to make my own recovery image.
My idea is make stock recovery image (via dd or nvflash), replace recovery with cwm, make backup, flash custom ROM. If i need to go back - do in reverse order .
1. From what I found, using
dd of=/path_to_store/myimage.img if=/dev/block/mmcblk0p7
should produce required image, but size is about 1.6M, while all other recovery images have size 3-5M
Am I doing something wrong?
2. I cannot find anywhere information about correct use of nvflash utility. Some shell scripts have bunch of parameters to write image into phone, but there is no info about how to read data from phone and create image..
Any help please?

I am sorry if I don't understand your questions but, I will try nonetheless. It seems you do not understand what nv flash or cwm do. Nv flash is how you CORRECTLY install a version of the clockworkmod recovery. Once installed, you choose the back up option to copy your system image. This recovery has the ability to do anything that has to do with rom flashing. Also is does it all simply by choosing what you want to do. There's no ADB or entering commands. Just look for TGA_gunnmans one click nv recovery flasher, this is all the info you will need.
Sent from the fastest g2x in the world

well, not exactly correct. nvflash is "low level" (means it accesses EPROM on hardware level) flash utility. It's designed to write data into EPROM. In most cases such utility can be used to read data as well (for backup purposes). That is why I am trying to find more information about nvflash and how to use it.
dd us *nix utility which works on higher than nvflash level, but lower than cp (copy).
By the time cwr is installed, the phone is different from factory - one of partitions is replaced. I am trying to backup this partition before replacement.

cy_mpak said:
well, not exactly correct. nvflash is "low level" (means it accesses EPROM on hardware level) flash utility. It's designed to write data into EPROM. In most cases such utility can be used to read data as well (for backup purposes). That is why I am trying to find more information about nvflash and how to use it.
dd us *nix utility which works on higher than nvflash level, but lower than cp (copy).
By the time cwr is installed, the phone is different from factory - one of partitions is replaced. I am trying to backup this partition before replacement.
Click to expand...
Click to collapse
There are stock recoveries available! Look in the optional files section.
http://forum.xda-developers.com/showthread.php?t=1054492"

After some more research and experiments I have found that recovery partition on G2x is mmcblk0p5.
Thanks to all who answered my questions directly or indirectly

Related

partitioning of /kernel and /recovery, where is the recovery mode image

Hi,
Backround:
My approach is to fullfil a full memory acquisition of an GSG i9000 (but thats not really relevant). The acquisition should be as forensic as possible by legal term. I approach is to apply as less changes as possible. So there is no option to turn on the device, root it and install ROM Manager or equal...
My Idea was to flash the Recovery Mode with CWM. After that I fullfil the acquisition with dd. (I could place the dd and su binaries to /sdcard/ext_sdcard and mount it with executable rights)
Problem and Approach
The bootloader of the device is not acceable, so I can't use fastboot to flash the recovery mode. Instead I have to use the Heimdall Suite over the download mode.
The Test/CrashDummy Device: is also a SGS-i9000, which had CWM 3.x allready installed. I flashed the recovery partition with an 2.5.x CMW image. However this didn't work out, v3.x was still booting when going to recovery mode. I did it many times, but it didn't help.
Then I read that the recovery mode-kernel is in the original linux/android kernel zImage. So I flashed it the kernel partition with Heimdall, which worked out for the recovery mode, but not for the Android OS itself..., was hanging on boot-bricked.
The second approach, flashing the original kernel, is the thing I would like to avoid generally.
The Question
Many users reported in forums that flashing recovery mode did it, my expirience showed the oposite. I also seed blog posts which told the /recovery is holding only the backup of the kernel partition.
What is or has to be flashed for a custom recovery mode eg CWM?
The Android kernel partition or only the recovery partition? Where is the recovery mode is actually stored?
I am really interested in the technical background, but can't find any documentation either on the official side nor in forums/wikis. Any links would be also helpful!
I looked at the PIT, is there a need to adjust the pit when the size of kernel images changes? Only the start address is relevant?
Also would be interested in the overall situation, am I missing something, logical flaws in the mentioned constelation?
Is there a way to pull the kernel image over the download mode, not only flash it? Maybe even other partitions, e.g. the whole flash?
Did somebody tried to read yourself in into the Odin protocol besides Glass Echidna, I started read the source of Heimdall. It's clean code but without documentation...
thanks in advance
ps: I spared time to search all the links of the flashimages, but I always used the official sources(HPs of the MODs) when it was possible.
EDIT: I found the link where the authors tells recovery is only a backup partition: vincent.bernat.im/en/blog/2011-android-samsung-galaxy-s.html

[Q] Why .img?

So in looking around I have not found any answer to my question. Why is everything to flash on the shield a .img instead of building zip files you can flash directly from recovery? I have been messing with android for quite a long time and know how to flash .img, fastboot, adb, ect. But dl'd and flashing a zip is far easier.
Any answers?
thanks.
*I think* that base factory images (.img files.) are meant to be flashed via fastboot, since they have a direct relationship with device specific partitions. Imagine a bit to bit flash, like a Ghost/Acronis image?!?
As for .zip files, they are installed via recoveries (CWM, TWRP, etc), because you just want to add/replace files in the / partition.
And with our Shield, until now, all OTAs are full system images, not updates.
I hope that I've explained this properly, if not please someone correct me
http://en.wikipedia.org/wiki/Fastboot#Fastboot
anthonws said:
*I think* that base factory images (.img files.) are meant to be flashed via fastboot, since they have a direct relationship with device specific partitions. Imagine a bit to bit flash, like a Ghost/Acronis image?!?
As for .zip files, they are installed via recoveries (CWM, TWRP, etc), because you just want to add/replace files in the / partition.
And with our Shield, until now, all OTAs are full system images, not updates.
I hope that I've explained this properly, if not please someone correct me
http://en.wikipedia.org/wiki/Fastboot#Fastboot
Click to expand...
Click to collapse
Not all ota are full system images, ota 65 and 67 are simple delta updates.
BTW, the main reason of .img files for images is because this can't depend on the recovery. How do you flash a recovery .zip file without a recovery?
You need to have a .img file that can be flashed via fastboot, it is VERY much "bricked" proff that a flashable zip
Thanks for the explanations. I realize some things need to be done via fastboot like unlocking or flashing a recovery for the first time.
I guess I have become spoiled by xda and the simplicity of modification that is available today. Far cry from hacking htcs back in the day.
thx -jason
Both answers are correct - it all depends on which software (on the device) is used to flash, and what format it accepts.
With Tegra devices you have at least 3 ways to flash stuff, from lowest to highest level:
- nvflash/tegrarcm mode. This is a very small firmware that is burnt in ROM and is thus always available no matter how hard you screw your device. It can run small programs (typically, a flasher) that are sent through USB. Problem is, for Tegra4 it will only accept signed binaries, which makes it useless for modders.
- bootloader/fastboot. The bootloader supports the fastboot protocol, which can flash .img files. The bootloader is written in flash memory so your bootloader partition must be in good shape.
- recovery/zip files. The recovery is a Linux image, so this means it is a full-blown system of its own right. Because of this it can support more format, including .zip archives with a script to describe how the archive should be installed.
So in the boot chain, you have 3 anchors from which you can flash images: boot rom (always available but unusable to us) -> bootloader -> recovery. The fact the boot rom cannot be used without a signed image (which is not available publicly) means that screwing your bootloader is sufficient to permanently brick your device.
Recovery images are more convenient since they are in .zip format and can for some be device-independent (e.g. superSU recovery images are flashed the same on every single device out there), contrary to the bootloader which can be different for every device. But they require a working recovery, which is not always granted - so for actual recovery, fastboot images are also useful.
That's why I love XDA
You're never alone!
Thanks for the additional info to all
Anthonws

[Q] Is there a way to install temporary recovery on SGR

Hi I am a new member on this forum, though I had been browsing this forum for long long time, I had not registered. Recently I had the courage to root and install omnirom on my phone (as my phone is getting old, i was ready to take the chances of bricking my device. I verified my device with eMMC brick bug tester and my device is frees from that bug, probably as my motherboard was changed under warranty). After toying with omnirom, I am back on stock rom. I went to Samsung Service Center and got my factory firmware installed for Rs 225/- (I had taken nandroid backup with epsilon 6.0... version of CWM, but it missed preload partition and restored the backup with philz recovery and my preload partition was erasaed and have to go for SSC).
I have few queries regarding the SGR, please help me with them:
1. Is there a temporary recovery for SGR (ie, can be flashed with stock recovery and returns back to stock on reboot. The zip file has to be maintained on SD card)
For SGS2: http://forum.xda-developers.com/galaxy-s2/general/guide-root-unroot-stock-ics-firmware-t1501719
2. In order to restore the partition on my own, I tried and searched net for recovery using testdisk and had taken a file image of the SGR internal flash disk. I opened it with testdisk, but testdisk was not able recognise the partitions I tried EFI GPT as suggested and Intel partiton table type and both did not work. Do you know the partition table type for this?
recovery link: http://www.df.lth.se/~jokke/androidfilerecovery/
3. I was just curious if becoming root (on adb shell) is just running su, thought I would copy su binary from superuser zip ro sdcard and run it with the path, but it just runs and nothing happens (I need this to remove few samsung apps esp, vlingo. I plan to do it from recovery -> adb shell -> su and delete apk & odex files).
This has been a great forum and helped me a lot. Thank you guys for all your effort.

Can I flash twrp from goomanager?

I have a 8013. I need to put in a different recovery and I like twrp. has anyone flashed it from goomanager? I see that there is one on there I just dont want to mess something up.
Already rooted.
I would search for this but I cant find a search button. Really not in the app or on the website.
Sent from my GT-N8013 using xda app-developers app
Let me see...
eggwardo said:
I have a 8013. I need to put in a different recovery and I like twrp. has anyone flashed it from goomanager? I see that there is one on there I just dont want to mess something up.
Already rooted.
I would search for this but I cant find a search button. Really not in the app or on the website.
Sent from my GT-N8013 using xda app-developers app
Click to expand...
Click to collapse
Hmm... When I read here: Goomanager so there is function for flash recovery. But if I don't get wrong, so this recovery files must be on www.goo.im server. Theoretically all ROMs, MODs and RECOVERY files lying on goo.im server
you can download to your device and flash it!
But for me and if I want to flash something, the best way is: Flashify
Here is it TOP 11:
1 - Flash boot and recovery .img without even needing to go to recovery.
2 - Flash zip files. Option to wipe cache, dalvik and data when using TWRP or Philz recovery.
3 - Download and flash CWM, Philz, TWRP, Gapps, Franco Kernel, Stock Nexus Kernel (premium), and Stock Nexus Recovery (premium).
4 - Automatic Loki Patch when needed.
5 - Full nandroid backups/restores when using TWRP or Philz recovery.
6 - Backup/Restore kernel and recovery using Sdcard or cloud (Dropbox, Box (premium) or Google Drive (premium)).
7 - Automatic cloud synchronisation of backups between devices and desktops.
8 - Keep track of recently flashed items.
9 - Flash multiple files and build your flash queue.
11 - Flash from anywhere! Do you want to flash from your favorite File Explorer or Email app? No biggie, that also works together with Flashify.
More at links above!
Have great Flashing :victory: Peter
I have an 8013 as well that I acquired used. it was pre-rooted, but the custom recovery on it didn't work for newer roms. I looked into installing TWRP and found that although the official TWRP instructions said you could install it from GooManager, when I tried to, it didn't find a recovery for the device.
I did successfully get TWRP installed quite easily using their alternate instructions, though. here's a quick breakdown, especially since their instructions are a bit vague.
1. download the .img file for the recovery from here: http ://teamw.in /project/ twrp2/110 (remove the spaces; I can't post outside links yet.)
2. in either terminal emultor or through adb shell, run the command shown below, replacing the bracketed sections with the path and filename of the .img file:
dd if=/<File path>/<filename>.img of=/dev/block/mmcblk0p6
For example, say you save it in your downloads folder on the internal sd card. The path is probably something along the lines of /storage/sdcard0/Download/openrecovery-twrp-2.7.0.0-gt-n8013.img
If you get the path or filename wrong when you runthis command, it will just tell you that it could not find the file you told it to write. if you get the second part wrong, however, you could brick your device, so make sure you double and triple check that part.
Another good check to do before running the command is to ensure that your download is not corrupt by checking the md5 checksum. To do this, make sure you copy that when you download the file and then check using a file browser that supports it. I use Explorer (by Speed Software) to check the md5. To see it, long press the file and click properties. If the one given when you downloaded it and and the one you get from the file do not match, your download likely got corrupted and you should try again until they do match. It's rare, but you don't want to flash a corrupted recovery, so do check it.
The command itself can either be run from an app like terminal emulator or over adb (android debug bridge) from your computer using the command:
adb shell <command>
I followed this basic procedure and now have a fully functioning TWRP recovery on my 8013. Best of luck to you in getting yours working. :good:

TWRP back to fastboot-flashable sparesechunk img files possible?

in a guide now removed, whose instructions i will not repeat here, it was documented that a Kiev could be reverted to its stock OS by obtaining img files of recovery, boot, etc. and sparsechunks of the super partition, and then flashing them with fastboot. i really like this approach to wipe and restore the phone to an imaged state.
my question is: would it be possible to convert a TWRP backup of the phone in a custom state to the format used for this? how could i start with this? success here would be for me to create a bash script that converts a TWRP backup folder into a series of fastboot-flashable img files. if i succeed, i wwould be happy to share the results. i just need advice on what would need done to TWRP backups to make them workable with fastboot.
i am about to begin a project involving Kiev, and it would be very useful if i could simply use fastboot to restore my phone to any arbitrary state, as opposed to relying on TWRP.
I guess it'd be possible to create images, format, and extract the backup into them. Save a lot of effort by just dumping the partitions with dd imo.

Categories

Resources