How To Backup Your Android Phone’s Boot, Recovery And System Partition Images

Android BackupOne can’t stress enough on the importance of backups and when it comes to tinkering with your Android phone, a backup of your system, recovery and boot partitions can save you a lot of hassle that you might otherwise have to go through if you mess things up and need those stock images. In this guide, we will tell you how to take these backups using a free tool called RomDump.

Although you can find these backups on the internet, those have been taken by other users and you never know if they have been modified to contain malicious code or not. Secondly, you can’t be too sure if they would work with the exact specifications of your phone or not, as even for the same phone model, there can be differences depending on the phone’s regions, intended carriers and other similar factors, and flashing a wrong boot, system or recovery image to your phone can most likely brick it. Therefore, it is always a great idea to take backup images of these partitions of your device yourself before you attempt to modify them, so that they can be recovered later if anything goes wrong.

RomDump is a free tool that lets you do just that. It is quite easy to use for anyone who is comfortable with typing a few commands, and effectively creates backup images of your Android phone’s boot, recovery and system partitions. It requires your phone to be rooted first and you will either need ADB installed on your computer or a terminal application installed on your Android device.

Now that we have had an overview, let’s proceed to actually getting things done.

Before you proceed:

  • Make sure that your device is rooted. If it isn’t, do a quick search on our site for “root phone_name” without the quotes, replacing ‘phone_name’ with the name of your device. You will find an easy to follow guide on rooting your phone.
  • In case you are using the ADB method, make sure you have ADB installed on your computer. If it isn’t, refer to our guide on what is ADB and how to set it up on your computer.
  • On the other hand, if you are going to use a terminal application, download and install Android Terminal Emulator which is available for free in the Android Market.

Now proceed according to the method that you chose.

ADB Method:

  1. Download RomDump from the link given below, extract the file named ‘install’ from the downloaded zip archive to your computer and copy it to the ‘tools’ folder of your Android SDK installation folder.
  2. Connect your phone to your computer via USB and make sure USB debugging mode is enabled in Settings >> Applications >> Development.
  3. Open a command prompt window and enter the following commands:
    adb push install /data/local/
    adb shell chmod 04755 /data/local/install
    adb shell /data/local/install
  4. You might see some output of the above command. Wait until it finishes.
  5. Enable and then disable Wi-Fi on your Android phone. If it was already enabled, disable, enable and then disable it again.
  6. Type this command in the command prompt window on your computer:
    adb shell romdump
  7. Wait patiently for the process to finish and you’re done. You may now exit the command prompt.

Terminal Method:


  1. Download RomDump from the link given below, extract the file named ‘install’ from the downloaded zip archive to your computer and copy it to the root of your phone’s storage card.
  2. Launch Android Terminal Emulator (or any other terminal app of your choice) on your Android phone and enter these commands:
    su
    
    cat /sdcard/install >/data/local/install
    chmod 04755 /data/local/install
    /data/local/install
  3. You will see some output of the above command. Wait till the output finishes.
  4. After this last line has appeared, enable and then disable Wi-Fi on your phone. If it was already enabled, disable, enable and then disable it again.
  5. Type this command in Terminal Emulator:
    /system/bin/romdump
  6. Wait patiently till the process finishes and you’re done. You may now exit Terminal Emulator.

If you have completed the above steps for any of the two methods successfully, you will find a folder named ‘romdump’ on the root of your SD card that contains a subfolder by the name of your device model. This folder will contain the boot, system and recovery partition images.

Alternative Method If The Above Does Not Work:

If this method does not work for you and all you need to backup is your recovery and boot images, you can simply do so as follows.

Note: Do NOT attempt to backup the system partition using this method as the system image it produces this way will NOT be a valid system image to be used later to restore your system partition. Use it only for the recovery and boot partition images.

  1. If you are using ADB, connect your device to your computer via USB, launch a command prompt window on your computer and enter the following command:
    adb shell

    If you are using Terminal Emulator instead, just launch it on your Android phone and enter the following command and agree to grant any permissions you’re prompted for:

    su

    The remaining process will be the same for both ADB and Terminal Emulator.

  2. Enter the following command:
    cat proc/mtd
  3. You will get an output similar to this. Note that your result may differ from this one and you must proceed according to the output that you get, rather than the example that you see here.
    dev:    size   erasesize  name
    mtd0: 000a0000 00020000 "misc"
    mtd1: 00480000 00020000 "recovery"
    mtd2: 00300000 00020000 "boot"
    mtd3: 0fa00000 00020000 "system"
    mtd4: 02800000 00020000 "cache"
    mtd5: 093a0000 00020000 "userdata"
  4. To dump the recovery image to your SD card, make note of the first word of the line which says “recovery” in the end. It is ‘mtd1’ in case of this example but may be another entry for you. Now use this command, replacing ‘mtd1’ with the term that applies in your case, if different:
    dd if=/dev/mtd/mtd1 of=/sdcard/recovery.img bs=4096
  5. Similarly, to dump the boot image to your SD card, make note of the first word of the line which says “boot” in the end, which is ‘mtd2’ in our case but may differ for you. Use this command now, replacing ‘mtd2’ with the term that is applicable in your case, if different:
    dd if=/dev/mtd/mtd2 of=/sdcard/boot.img bs=4096

That’s it – you now have recovery.img and boot.img backed up on the root of your SD card.

Download RomDump v72

Advertisement
  • Pingback: Install Android 2.3 Gingerbread CyanogenMod 7 ROM On HTC Desire

  • Linuzo

    Where is the link to download Rom Dump?? I don’t see it there..

    • http://www.addictivetips.com/ Haroon Q. Raja

      Sorry, I forgot to add the link. Thanks for letting me know, I’ll add it right away.

      • Vishalvishwanath

        hello there, where r the links to romdump? :

  • Dombila

    Is the alternaty method usable to vakcup the misc partition as well? (dd if=/dev/mtd/mtd0 of=/sdcard/misc.img bs=4096)
    It would be useful for resolving an USB brick.
    If not usable, how can I backup the misc partition?

    • http://www.hqraja.com Haroon Q. Raja

      Although theoretically, it should work but to be honest, I am not sure if the backup made that way will work when you restore it. I know for sure that it does not work for the system partition.
      The only way to find out will be to make a backup, and then restore it to see if it works but doing that without having a backup that you can rely on wouldn’t be such a good idea and I won’t recommend it unless you can afford to experiment with that device at your own risk.

  • Jpreciado

    i trie Alternative Method in ADB and system say “/dev/mtd/mtd5: cannot open for read, permission deneided”

  • Vlad

    I tried alternative method in ADB in Terminal Emulator on phone but system “say /dev/mtd/mtd3: read error: Bad address”; the same situation with “/dev/mtd/mtd2″. What is a problem here?

  • Joe

    I Like to know I can reinstall the ROM after a crash?!!!

  • Michael

    Running this on a rooted Eris with 2.3 installed (CyanogenMod) I unfortunately get a segv when trying to execute ‘install’:

    Android ROM dumper v0.72b
    (c)2010 Sebastian404
    romdump installed.
    [1] Segmentation fault /data/local/install

    Since it did indeed appear to have installed (at least, the message was output) I tried running it via adb shell:

    Android ROM dumper v0.72b
    (c)2010 Sebastian404
    Device : GRJ22

    [1] Segmentation fault romdump

    So it seems there’s an issue with the ‘droid version?

  • Mike

    Just wondering, how would one go about restoring from this dump? From the little research that I have done, it seems like you need to pack it into an update.zip file (at least for my phone Motorola Spice/XT300). Is there an easy way to do this, or is there a program that can restore from this dump?

  • Ken

    This parting line from the Readme.txt leaves you hanging: “Take those files and give them to someone who knows how to make a recovery zip.”
    We could use a followup article on how to restore the backups.

  • Perldude69

    How do we restore using the dd method?

  • Faisal

    I get this error
    [1] Segmentation fault (core dumped) romdumphow can I remove RomDump

  • Thomas Kristensen

    I am getting: Illegal instruction /data/local/install :(

    So it wont work for my HTC Sensation :(

  • http://www.subi.in/ Subi Pilot

    Anyhow after struggling from morning i succeeded with “adb shell” ” dd ************** ” command for my Window N10 Tablet, Now going to find some methods for restoring this Backups,,,

  • Niksss

    its comes up with the following output
    [1] + stopped (signal)                  /system/bin/romdump
    #

    and after completing whole process the folder created is empty.please help

  • Lucian Ghita

    Thanks a million! It worked for me after 1 months of research, I found your article which proved to be the lucky winner!

  • Robynasi

    How can i restore system.tar?? Can i convert it to .img?

  • banajit

    I tried to do complete backup of my micromax a80 with ADB method as you discribe
    please note that I used the latest verion of romdump i.e v8.2b and I rename the install/romdump file to myroma80 .
    now I got this in my cmd console
    ————–

    C:Program FilesAndroidandroid-sdktools>adb push myroma80 /data/local
    2738 KB/s (1149900 bytes in 0.410s)

    C:Program FilesAndroidandroid-sdktools>adb shell chmod 04755 /data/local/myr
    oma80

    C:Program FilesAndroidandroid-sdktools>adb shell chmod 04755/data/local/myro
    ma80
    Usage: chmod

    C:Program FilesAndroidandroid-sdktools>adb shell chmod 04755 /data/local/myr
    oma80

    C:Program FilesAndroidandroid-sdktools>adb shell /data/local/myroma80
    Android ROM dumper v0.82b
    (c)2011 Sebastian404
    You need to be rooted to run this aplication

    Device : A80

    Creating required files… find: /system/secro/lost+found: Permission denied
    find: /system/lost+found: Permission denied
    find: /system/secro/lost+found: Permission denied
    find: /system/lost+found: Permission denied
    find: /system/secro/lost+found: Permission denied
    find: /system/lost+found: Permission denied
    done.
    Opening mtd table… done.
    Dumping kernel config… /proc/config.gz: No such file or directory
    done.
    Dumping boot partition… done.
    Dumping recovery partition… done.
    Dumping system partition… done.
    Creating Checksums… done.
    Cleaning up… done.
    All done.

    C:Program FilesAndroidandroid-sdktools>adb shell romdump
    romdump: permission denied

    C:Program FilesAndroidandroid-sdktools>
    ————–

    I got a romdump folder in the sdcard too
    it contain 4 files
    now my question is did I done everything right ?
    how to confirm it ?

  • hlamyo

    my htc sensation xe is boot loop.It is can’nt enter recovery mode.Can’nt factory reset. it is after latest RUU run. so I think my Phone recovery mode is dead how to fix.

  • TheObserver

    Keep getting error message:”failed to copy ‘install’ to ‘/data/local/install’: Permission denied”
    i keep getting “Permission denied” even on Terminal Emulator. Phone is rooted. Help

    • lavie

      adb root

    • budd

      use es explorer, go to /data folder, and you click “select” at bottom-left. After that you choose local folder and click more on bottom-right. In option click properties and you change permission and click all altribute ( read , write , execute )

  • sozaf

    i got an error in terminal mehtod will u plz help me?
    [1] + stopped (signal) /dat/local/install

  • lavie

    can i restore that?

  • eric

    Segmentation Fault was the result

  • MAKAHA

    Beautiful i used

    Alternative Method

  • noname

    If I use Alternative Method, can I use the IMG files to make PAC to use with ResearchDownload?

    Thanks ……