Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Possible Duplicate:
How to backup an Android device?

I am thinking of installing a custom ROM such as CM7 on my AT&T Galaxy S2 (SGH-i777). I have already rooted it.

What is the best practice for backing-up (and potentially restoring) my phone?

Notes for answerers:

  1. I'm interested in step-by-step instructions to obtain a canonical answer rather than links into forum threads.
  2. Will the method described be able to recover the phone if the ROM install process fails and "bricks" the phone?
  3. Can the backup be moved to external storage (such as a computer) or is it only resident on the phone's internal memory. If it can be preserved off-device please describe this process as well.
share|improve this question

marked as duplicate by Matthew Read Mar 5 '12 at 23:33

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 5 down vote accepted

This is going to vary a bit by device and recovery system, but in general if you want to perform a full, 1-to-1 backup of your phone's internal memory you would need to:

  • Root your device and install a custom recovery. The most popular recovery is probably ClockworkMod. How you install it will vary widely by device, but ROM Manager can do it for you on most popular devices. You simply launch ROM Manager and select "Flash ClockworkMod Recovery" from the main menu.

  • If using ClockworkMod, open ROM Manager and select "Backup current ROM". This should do all of the work for you.

  • If not using ROM Manager or if you use a recovery other than ClockworkMod:

    • Reboot your device into recovery mode. This again varies by device, but ROM Manager has a "Reboot into recovery" option that works regardless of what recovery you have installed. Another option is to issue adb reboot recovery from a connected PC with ADB configured and set up. There may be other requirements for getting into recovery depending on your device (e.g. the Kindle Fire is very different from others).
    • Navigate to the "Backup/Restore" or "Nandroid" menu (or similar).
    • Select "Backup" and (if needed) select which partitions you would like to back up. Some recoveries will also give you the option to compress the backup.
    • Select "Perform backup" (or similar) and wait for the process to finish.

Once the backup has been performed you should be able to use it to recover from many "soft" bricks. However, the two situations you would not be able to recover from with a backup alone would be:

  • Your bootloader is invalid/corrupted/etc
  • Your recovery partition is invalid/corrupted/etc

In both of thse scenarios, you would first need to fix the offending partition (bootloader or recovery) before being able to restore the backup. Basically, anything that prevents you from accessing your recovery partition will also prevent you from using your recovery to restore your backup. Such situations are, I would say, fairly rare. You can use a backup to recover a bad /boot or /system partition, so flashing a kernel or ROM should have an extremely small likelyhood of permanently bricking your device (unless it modifies your recovery or bootloader, as noted above).

You may be able to flash an uncompressed backup from fastboot but this would depend on what recovery you are using and how it performs its backups. As I recall, ClockworkMod simply uses dd to create the image and they actually will flash correctly on some devices. However, I would strongly advise researching this before trying as a bad fastboot write could soft brick you as well. Of course, as long as you don't try to overwite your bootloader you won't lose access to fastboot, so in some ways this could be a "nothing ventured, nothing gained" situation.

To actually restore a backup you can:

  • In ROM Manager select "Manage and Restore Backups", then select the backup you wish to restore from.
  • If not using ROM Manager or not using ClockworkMod:

    • Reboot into recovery
    • Select "Backup/Restore" or "Nandroid" (or similar)
    • Select "Restore"
    • Pick the backup you would like to restore from (if more than one)
    • Select the partitions you would like to restore (if givent the option)
    • Select "Restore" and wait for the process to finish

Nandroid backups are, by default, stored on your external storage device in pretty much every situation. Some exceptions may be devices with no separate external storage (e.g. devices like the Galaxy Nexus) where the /sdcard directory is actually on the physical internal storage. In any case, though, it will save to your /sdcard directory, which is readable from a PC as USB mass storage or adb. You can copy a nandroid backup off of your phone and onto a computer for safe-keeping, then copy it back over later if you need to restore.

To do this you can simply plug in your device and look for a path like /sdcard/nandroid (or /sdcard/TWRP for TeamWin recovery, possibly elsewhere for others). Then you can copy the contents of the folder over to your computer. Alternatively, you can pull it with adb by plugging in the device and issuing something akin to:

adb pull /path/to/backups

...from a PC shell.

share|improve this answer
    
Clockwork Mod Recovery will work on the AT&T Samsung Galaxy S II. –  Broam Mar 5 '12 at 21:56
    
@Broam: I never said it wouldn't, I was simply trying to phrase this as generally as possible since there are other recovery options out there (f.e. I don't use ClockworkMod myself). –  eldarerathis Mar 5 '12 at 22:03
    
I know - but I figured the OP would want a specific response to your very detailed & general answer. –  Broam Mar 5 '12 at 22:17
    
The dupe I added doesn't have a good description of Nandroid (specifically CWM), you may want to consider adding this answer there. –  Matthew Read Mar 5 '12 at 23:35
1  
@MatthewRead: Hm, so it does not. Delicious copypasta has been served. –  eldarerathis Mar 6 '12 at 0:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.