What's new

Tutorial How to extract img via adb (root access required)

Status
Not open for further replies.

conviction

Forum Guru
Joined
Apr 24, 2013
Posts
5,124
Solutions
6
Reaction
7,407
Points
1,982
Padownload nalang mga paps yung adb sa thread https://phcorner.net/threads/624072/ at the same time this tutorial is a supplement prior to flashing TWRP via adb from this https://phcorner.net/threads/624120/

Things needed:
1. Adb tools
2. Rooted android device

Steps:
1. Open command window from your adb folder
2. Install your device drivers then Connect to pc
3. Type from command window:
  • adb devices (hit enter key)
  • adb shell (hit enter key)
  • su (hit enter key)
  • cat /proc/mtd (hit enter key)

Sample results with different mtd as shown:


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"


GETTING YOUR IMG
How to pull needed IMG like recovery

sample LOCATION above of "recovery" which in this sample is in mtd10

now type from command window:
  • cat /dev/mtd/mtd10 > /sdcard/mtd10.img
or
  • cat /dev/mtd/mtd10 > /sdcard/recovery.img

Now check from your sdcard after extracting if you have your recovery.img or mtd10.img file that was saved depending on what name you type from command

***Take note that this is not applicable to all devices***

FOR OTHER DEVICES TRY THIS

This demo I want to locate and extract my recovery.img, boot.img, system.img

1. type from your command window
  • adb shell (hit enter key)
  • cat /proc/partitions (hit enter key)
2. A list of mmcblk numbers but you have no clue which one is your boot, recovery, system etc.
partitions.jpg

3. From your device using a root explorer app navigate to /dev/block/platform/ and navigate to the folder that will contain a folder with "by-name"
partition_2.jpg

4. Once you get the location of "by-name" folder simply follow the sequence of folder location
partition_3.jpg

5. Depending on how many sub folders before you reach the "by-name" folder use this code for your adb command

  • ls -al /dev/block/platform/???/???/by-name

6. From your command window type the following after you already know the location, for this sample "by-name" folder was found under folder 7824900.sdhci and the latter under soc.0 folder

now type the following:
  • adb shell (hit enter key)
  • su (hit enter key)
  • ls -al /dev/block/platform/soc.0/7824900.sdhci/by-name (hit enter key)

7. The following list will show and just search which mmcblock your IMG needed is located

for boot.img located at mmcblk0p37
boot (1).jpg
recovery_system.jpg

8. Your recovery.img and system.img located at mmcblkp38 & mmcblkp45 respectively. You can now extract with this command:

cat /dev/block/mmcblk(#)> /sdcard/(name-of-img).img


sample only:
  • cat /dev/block/mmcblk0p38 > /sdcard/recovery_pull.img
Do the same with other img you need, just indicate whatever name you wish to write for you to easily recognize and for distinction.

9. Navigate to your sdcard and you will see the extracted img that I typed as "recovery_pull.img"

recovery_pull.jpg

10. You may now flash TWRP.img(custom recovery) via adb to your device to make your own backup roms, visit thread (here)

enjoy! :)

if command above does not support your device, ask google
 

Attachments

Status
Not open for further replies.
Back
Top