Suppose I plan to flash my recovery with TWRP/CWM, but then later suppose I would like to move back to the stock recovery. Is it possible to take a backup of stock recovery just like we can take a backup of our ROM?
EXTRACTING BOOT.IMG FROM STOCK ROM or OTHER IMG LIKE RECOVERY ETC.
1. Download adb required tools.
3. Phone Drivers (for other phones google it out)
for spreadtrum phones: SCI-Usb-Jungo v4 (download here) or SCI-USB2Serial v126.96.36.199 (download here)
4. Android Phone + Usb cables
STEPS: OPEN cmd window in adb folder
type the ff:
adb devices adb shell su cat /proc/mtd
Now from your screen look at your files and you see mtd10 has your recovery.img
dev: size erasesize name mtd0: 00040000 00020000 "misc" mtd10: 00500000 00020000 "recovery" mtd12: 00280000 00020000 "boot" mtd13: 04380000 00020000 "system" mtd14: 04380000 00020000 "cache" mtd15: 04ac0000 00020000 "userdata"
Once u see it's LOCATION in which in this sample is in mtd10 type:
cat /dev/mtd/mtd10 > /sdcard/mtd10.img or
cat /dev/mtd/mtd10 > /sdcard/recovery.img
Generic Backup/ Restore
If you are root you can backup/ restore all partitions (not only recovery) with native tools.
To list all mountable partitions and block devices use
adb shell su find /dev | grep by-name$
On my system I get
/dev/block/platform/soc/1d84000.ufshc/by-name back (this is very device specific and yours may look different).
Now You can list
ls this path to show all mountable partitions.
ls -al --color /dev/block/platform/soc/1d84000.ufshc/by-name/
Or all in one command
ls -al --color $(find /dev|grep by-name$)
Armed with this information you can, as root, backup all partitions. Just use the
dd (part of every android toolboox/ toyboox e.g.:
dd if=/dev/block/platform/soc/1d84000.ufshc/by-name/recovery of=/sdcard/Download/recovery.img.dd
Warning Data lost possible! Don't use until You understand all
In many cases you can also restore with the
dd tool, e.g:
dd if=/sdcard/Download/recovery.img.dd of=/dev/block/platform/soc/1d84000.ufshc/recovery
if proc/mtd not available for your device.
making a backup via cwm can give you recovery.img when you check your clockworkmod folder after backup http://howtorootcherrymobilesnapv2.weebly.com/how-to-make-back-up-via-cwm.html
another option would also be by making a ROM (dump) via adb http://howtorootcherrymobilesnapv2.weebly.com/img-pull-extract-via-adb-rom-dump.html