Home Forum Blog Private Support Courses
Our courses are now on YouTube! Start Watching
Hovatek Forum OPERATING SYSTEMS Android [Tutorial] How to use ADB + root to backup Android device partitions

[Tutorial] How to use ADB + root to backup Android device partitions

[Tutorial] How to use ADB + root to backup Android device partitions

Pages (3): 1 2 3 Next
hovatek
hovatek
hovatek
Administrator
50,905
13-02-2015, 08:52 PM
#1



This is a step by step guide on how to backup an Android phone's firmware / partitions using adb. This covers partitions like boot, recovery, system etc.

Method 1: ADB Method I


  1. Install a root browser (e.g ROM Toolbox lite) and navigate to dev/block/platform . Open each folder in the platform folder till you find a folder named "by-name". Replace "your_folder" in the code below with the name of the folder which contains the by-name folder
  2. Launch ADB and type the code below. Press Enter after each line
    Code:

    adb shell ls -al /dev/block/platform/your_folder/by-name
  3. You should get an output of the phone's mount points
  4. Type the code below to dump the partition of your choice

    Code:

    adb shell su dd if=/yourMountingPoint of=/yourDestination/partitionType

  5. For example

    Code:

    adb shell su dd if=/dev/block/mmcblk0p9 of=/sdcard/system.img

Method 2: ADB dd 2


  1. Launch ADB and run the command below

    Code:

    adb shell cat /proc/dumchar_info

  2. You should have an output like

    Code:

    Part_Name Size StartAddr Type MapTo Region preloader 0x0000000000040000 0x0000000000000000 2 /dev/misc-sd BOOT_1 mbr 0x0000000000080000 0x0000000000000000 2 /dev/block/mmcblk0 USER ebr1 0x0000000000080000 0x0000000000080000 2 /dev/block/mmcblk0p1 USER pro_info 0x0000000000300000 0x0000000000100000 2 /dev/block/mmcblk0 USER nvram 0x0000000000500000 0x0000000000400000 2 /dev/block/mmcblk0 USER protect_f 0x0000000000a00000 0x0000000000900000 2 /dev/block/mmcblk0p2 USER protect_s 0x0000000000a00000 0x0000000001300000 2 /dev/block/mmcblk0p3 USER seccfg 0x0000000000020000 0x0000000001d00000 2 /dev/block/mmcblk0 USER uboot 0x0000000000060000 0x0000000001d20000 2 /dev/block/mmcblk0 USER bootimg 0x0000000001000000 0x0000000001d80000 2 /dev/block/mmcblk0 USER recovery 0x0000000001000000 0x0000000002d80000 2 /dev/block/mmcblk0 USER sec_ro 0x0000000000600000 0x0000000003d80000 2 /dev/block/mmcblk0p4 USER misc 0x0000000000080000 0x0000000004380000 2 /dev/block/mmcblk0 USER logo 0x0000000000300000 0x0000000004400000 2 /dev/block/mmcblk0 USER expdb 0x0000000000a00000 0x0000000004700000 2 /dev/block/mmcblk0 USER tee1 0x0000000000500000 0x0000000005100000 2 /dev/block/mmcblk0 USER tee2 0x0000000000500000 0x0000000005600000 2 /dev/block/mmcblk0 USER kb 0x0000000000100000 0x0000000005b00000 2 /dev/block/mmcblk0 USER dkb 0x0000000000100000 0x0000000005c00000 2 /dev/block/mmcblk0 USER android 0x0000000080000000 0x0000000005d00000 2 /dev/block/mmcblk0p5 USER cache 0x0000000010000000 0x0000000085d00000 2 /dev/block/mmcblk0p6 USER usrdata 0x000000030ce00000 0x0000000095d00000 2 /dev/block/mmcblk0p7 USER bmtpool 0x0000000001500000 0x0000000001500000 2 /dev/block/mmcblk0 USER

  3. If you wish to dump recovery.img for example, take note of the recovery line

    Code:

    recovery 0x0000000001000000 0x0000000002d80000 2 /dev/block/mmcblk0 USER

  4. Convert the Size and StartAddr values from Hexadecimal to Decimal then divide by 4096 (which is the Block Size)
    Run the command below

    Code:

    #mount -o ro,remount /emmc@android /system dd if=/dev/block/mmcblk0 bs=4096 skip=StartAddr count=Size | gzip > /data/local/tmp/recovery.img.gz

  5. For Recovery in this example, it'll be

    Code:

    #mount -o ro,remount /emmc@android /system dd if=/dev/block/mmcblk0 bs=4096 skip=11648 count=4096 | gzip > /data/local/tmp/recovery.img.gz

  6. Check your device for the dumped image

Method 3: ADB + ROMdump.zip method


  1. Setup ADB
  2. Download ROMdump
  3. Extract the file named "Install" from the ROMdump zip file and copy it to the same location as adb.exe
  4. Enable USB debugging on the phone (Settings > Developer > Tick USB Debugging) and connect the phone to PC
  5. Launch adb.exe (Open the adb folder > Hold Shift button > Right-click on any empty space > Select Open Command Window here)
  6. In the command window, type the following commands and press Enter after each:
    Code:

    adb devices adb push install /data/local/ adb shell chmod 04755 /data/local/install adb shell /data/local/install
  7. Wait till pushing is complete
  8. Toggle Wi-Fi On then Off or Off then On then Off (depending on its current state)
  9. Type the command below in the command window then press Eenter
    Code:

    adb shell romdump
  10. Wait for the process to be complete and you'll have your ROMdump
  11. You'll find your files in a folder named romdump in the root of the SD card

Method 4: Terminal + ROMdump.zip method


  1. Ensure the phone is rooted (see https://www.hovatek.com/blog/how-to-root...ithout-pc/ )
  2. Install Android Terminal Emulator
  3. Download ROMdump
  4. Extract the file named "Install" from the ROMdump zip file and copy it to the root of the SD card (as in copy directly and not into any folder)
  5. Launch Terminal Emulator and type the following commands then press Enter after each
    Code:

    su cat /sdcard/install >/data/local/install chmod 04755 /data/local/install /data/local/install
  6. Wait for the process to complete
  7. Toggle Wi-Fi On then Off or Off then On then Off (depending on its current state)
  8. Type the command below in Terminal Emulator then press Enter
    Code:

    /system/bin/romdump
  9. Wait for the process to complete and you're done
  10. You'll find your files in a folder named romdump in the root of the SD card

Method 5:  ADB Method II


  1. Note: Only use this method for Boot and Recovery images, not for System image
    Also, you can use Terminal Emulator for this method instead of ADB

  2. Setup ADB
  3. Launch adb.exe (Open the adb folder > Hold Shift button > Right-click on any empty space > Select Open Command Window here)
  4. In the command window, type the following command then press Enter
    Code:

    adb shell
  5. If you're using Terminal emulator instead of ADB then type
    Code:

    su
    and Select Grant when prompted

  6. Type
    Code:

    cat proc/mtd
    or
    Code:

    cat proc/emmc
    depending on your phone type then press Enter

  7. You'll get an output similar to this:
    Code:

    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"
  8. To dump the recovery image to your SD card, take note of the first word of the line which says “recovery” in the end. It is ‘mtd1’ in this example. Now use the command below, replacing ‘mtd1’ with the term that applies in your case, if different then press Enter:
    Code:

    dd if=/dev/mtd/mtd1 of=/sdcard/recovery.img bs=4096
  9. For boot image in this example, type the command below then press Enter
    Code:

    dd if=/dev/mtd/mtd2 of=/sdcard/boot.img bs=4096
  10. You should have your partition images dumped to the root of your SD card

Method 6: AIO Flasher Method


  1. Download AIO Flasher
  2. Launch it
  3. Enable USB debugging on the phone (Settings > Developer > Tick USB Debugging) and connect to PC via USB cord
  4. Go to The Backup / Restore tab
  5. Click on Install RomDump and ait till the log by the right shows
    Code:

    Pushing Romdump... Installed.

  6. Click Dump!
  7. Once complete, You'll find your files in a folder named romdump in the root of the SD card

How to flash a file to a partition using ADB shell



A demo command is

Code:

dd if=/data/system.img of=/dev/block/platform/soc/11230000.mmc/by-name/ANDROID

In the above command, system.img was pushed to /data and the mount point of the system partition is ANDROID (see Method 1: ADB Method I above for how to get this)

Important Notice
A box / dongle can enable you easily achieve this without root
This post was last modified: 29-12-2023, 03:04 PM by hovatek.
Attached Files
.zip
romdump_v82b.zip
Size: 642.2 KB / Downloads: 2,100

Learn MediaTek, Unisoc / Spreadtrum (SPD) and Qualcomm Software Repairs @ https://www.hovatek.com/training
Note!
We have a reply schedule for Forum Support. Please try Private Support if you can't wait.
Drockstar
Drockstar
Drockstar
Senior Member
506
29-10-2015, 03:35 AM
#2
Boss after making this romdup or boot or recovery to the root directory of our sd card what should we Used the dump we have in the sd for?
This post was last modified: 29-10-2015, 03:37 AM by Drockstar.
hovatek
hovatek
hovatek
Administrator
50,905
29-10-2015, 10:59 AM
#3
(29-10-2015, 03:35 AM)Drockstar Boss after making this romdup or boot or recovery to the root directory of our sd card what should we Used the dump we have in the sd for?

To recover when bricked

Learn MediaTek, Unisoc / Spreadtrum (SPD) and Qualcomm Software Repairs @ https://www.hovatek.com/training
Note!
We have a reply schedule for Forum Support. Please try Private Support if you can't wait.
Drockstar
Drockstar
Drockstar
Senior Member
506
29-10-2015, 11:13 AM
#4
Boss what is the dump of the boot, recovery used for specifically?

Sent from my Z3 using Hovatek mobile
This post was last modified: 29-10-2015, 12:28 PM by Drockstar.
Drockstar
Drockstar
Drockstar
Senior Member
506
29-10-2015, 11:32 AM
#5

Mediatek Course Mediatek Course


Understand sp flash tool contents

Sent from my Z3 using Hovatek mobile
hovatek
hovatek
hovatek
Administrator
50,905
29-10-2015, 03:14 PM
#6
(29-10-2015, 11:13 AM)Drockstar Boss what is the dump of the boot, recovery used for specifically?

Sent from my Z3 using Hovatek mobile

They're backups of parts of your ROM incase the phone gets bricked

Learn MediaTek, Unisoc / Spreadtrum (SPD) and Qualcomm Software Repairs @ https://www.hovatek.com/training
Note!
We have a reply schedule for Forum Support. Please try Private Support if you can't wait.
Drockstar
Drockstar
Drockstar
Senior Member
506
29-10-2015, 07:32 PM
#7
So making a backup of the boot or recovery unbrick phone?

Sent from my Z3 using Hovatek mobile
Drockstar
Drockstar
Drockstar
Senior Member
506
30-10-2015, 12:55 AM
#8
Attachments
Attached Files
.jpg
Mtk droid tools errors .jpg
Size: 448.53 KB / Downloads: 428
.jpg
CDC SHA not found (1)_edit1.jpg
Size: 432.61 KB / Downloads: 84
.jpg
CDC SHA not found _edit1_edit.jpg
Size: 385.88 KB / Downloads: 89
hovatek
hovatek
hovatek
Administrator
50,905
30-10-2015, 12:20 PM
#9
(29-10-2015, 07:32 PM)Drockstar So making a backup of the boot or recovery unbrick phone?

Sent from my Z3 using Hovatek mobile

Only when they're the cause

Learn MediaTek, Unisoc / Spreadtrum (SPD) and Qualcomm Software Repairs @ https://www.hovatek.com/training
Note!
We have a reply schedule for Forum Support. Please try Private Support if you can't wait.
Drockstar
Drockstar
Drockstar
Senior Member
506
30-10-2015, 01:36 PM
#10
What is the work of the boot? And recovery?

Sent from my Z3 using Hovatek mobile
Pages (3): 1 2 3 Next
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
WhTlYt