Wednesday, May 2, 2012

ClockworkMod (CWM) Recovery Backup and Restore Android Phone Firmware

In my last post, I introduced ClockworkMod (CWM) Recovery to backup your phone firmware. It is a good idea to copy these backup files to your computer for safe keeping.

You will find the ClockworkMod(CWM) Recovery firmware backups in this location on your phones internal memory.


You'll need Dobrica Pavlinušić's shell script to copy the ClockworkMod(CWM) Recovery backups to your computer. For some unknown path related issue the standard Unix 'cp' will not work. You won't be able to copy these backup files to your computer, however you can copy files from computer to phone without any problem.

#!/bin/sh -x


adb shell ls -1 -d $sdcard/backup/* | sed "s!$sdcard/*!!" | tr -d '\r' > /tmp/
ls -1 -d backup/* > /tmp/backup.disk
diff -uw /tmp/ /tmp/backup.disk | grep -- '^-backup' | sed 's/^-//' | \
xargs -i sh -xc "mkdir -p {} && adb pull $sdcard/{} {}"

To restore your phone firmware from your backups. Copy the ClockworkMod(CWM) Recovery files to the backup directory on the phone. Reboot the phone into recovery mode and use the Backup / Restore option to restore the firm.

Lately, I use this technique to deploy Boot2Gecko quickly onto compatible phones when the Boot2Gecko builds breaks. The new project started nightly build of Boot2Gecko, you might want to check it out. Personally I would prefer the project builds Cyanogenmod style otapackages instead. Support for this is coming soon, watch this space.


  1. Requirements
    Among the most important requirements you should consider if you want the whole procedure to go well are the following: download the ClockworkMod Recovery file. And that’s it. Everything from here onward will be very easy to perform. You just need to pay extra attention.
    For more information visit: Android recovery

  2. hi there i used CWM Munjeni v5.5.0.4 i did was Used back up and restore option> in there i used backup option and the backup process begun > after backup in CWM folder i got an folder named backup> in that backup folder there was another folder named ""2014-04-"" i guess its data and time used as name of the folder and in that folder this actual 4 backup files were there which are two rar files named "data.ext4.rar" and "system.ext4.rar" also other two files are ""boot.img" and ""recovery.img" .

    FYI after backup i had fashed and installed CM10 for HTC Desire C .
    But just in case if i want to get back to original stock ROM then how do i get back to it using these backup files i have ? and i what sequence i should use these files?
    can any1 help? has any one experienced this type of backup and restored using these type of files?

    also FYi i have win7 pc so do i need to use this shell script and all?

  3. install android SDK tools, then use adb

    adb pull '/sdcard/clockworkmod/' '/home/YOURUSERNAME/desktop'


You can leave a comment here using your Google account, OpenID or as an anonymous user.

Popular Posts