Backing up your Android Phone's Stock Rom and Recovery
Have you ever wanted to mod your new android phone but wanted a way to get back to the factory settings without having to mod the phone first? It is possible to do but you need a few things, the Android Dev tools, fast boot, and some command line know how. For this example I will be using a HTC One X on the Telus Network.
With HTC you have to get a developer token which can be obtained from
http://www.htcdev.com. You will have to sign up as a dev to get your developer token. HTC has a
great tutorial on how to unlock your bootloader on the htcdev site.
Once your bootloader is unlocked you can now download a 3rd party rom manager (don't worry we are just going to boot off it; were not installing it yet - also make sure you have enabled USB Debugging in the developer tools). I used
TWRP, it is more compatible with my device then
clockworkmod is. Once downloaded (I renamed the downloaded rom manager to recovery.img) and moved it into my fastboot directory on my computer.
Here is a look at the fastboot directory on my computer
Now the fun can begin; make sure you have all the files you need in the directory your working out of, in my case the fastboot directory. Your phone should be plugged in via usb to your computer then I used adb to reboot my phone into the bootloader
C:\fastboot>adb reboot bootloader
Then I booted off the recovery.img file in my fastboot directory.
C:\fastboot>fastboot boot recovery.img
Then your phone should boot off the custom recovery rom without installing it. Then you can make a backup using the recovery rom. Once done reboot into the phone's system and load a file manager like
ES File Explorer to get the files off using dropbox or some other means.
Now you have a backup of your stock phone and you can now mod your phone to your heart's content.
Update: I forgot to mention that with HTC you also have to update your boot.img file using the commandline interface. To get the boot.img file you can get it by extracting it from your backup or the zip file from your thrid party rom like cyanogenmod.
C:\fastboot>fastboot flash boot boot.img