[GUIDE] Making Dump Files Out of Android Device Partitions

Search This thread

droids@m

Senior Member
Dec 16, 2012
585
220
Bangalore
Awesome Guide.....!!!!!!!



Was looking for this all over Finally U Mister had wrote it so well

Kudos to you keep it coming
 

iZLeeP

Senior Member
Jan 23, 2014
528
151
Manila
Great guide dev. Was looking for info on how to dump system, and yours was perfect; very easy to follow!
 

IGGYVIP

Senior Member
Feb 17, 2014
833
309
/
Samsung Galaxy S4
Samsung Galaxy S10
Awesome work mate

When on windows i found it easier to copy contents of platform tools and any file to push to system32 folder

then run cmd and use adb from anywhere ! :D sooo much less typing in general :D

also i had to set permissions to system folders using root browser (including dump target folder) chmod would not do it for me



---------- Post added at 01:33 PM ---------- Previous post was at 01:23 PM ----------

Hey, great guide! I need some help but. I can't retrieve the common names / labels of my devices partitions. It's a GT-i8150 and there is no 'by-name' sub directory. Furthermore, parted does not work on mmcblk0 for some reason (unable to satisfy partition restraints or something). I also have no emmc file in proc.

Does anyone know how some other methods for getting the names of the partitions?

EDIT:

Another question - using ADB shell, is it possible to dump a partition straight from the phone onto the computers hard drive? My little 2GB sd card isn't coping! Thanks

adb shell can see windows folders as read only file system
maybe on linux ? will test and see :)
 
Last edited:
  • Like
Reactions: CVAngelo

xuban

Senior Member
Jun 14, 2011
74
9
Donosti
Hi! Thanks for u post.
I'm doing this, but when i dump param.lsf i get a bad file, i open in hex editor and the hex code is 00 in all file.
Any idea? Thanks!

PD: S7275R (Galaxy Ace 3 LTE version). With stock firmware S7275RXXUAMHH-
 
Last edited:

thekkk

Member
Apr 28, 2012
37
1
I've successfully dumped an image with a size of 1.8GB, but now i want to create the SDCard-image, but thats up to 25GB i guess! How can i dump this rom direct to my PC? Because i can't save this on my phone, have only 32GB HTC One. Or is there an other option to just dump several folders of that sdcard?

Is it maybe possible to directly write over the OTG to the USB-portable-stick (Size about 32GB)?
 
Last edited:

IGGYVIP

Senior Member
Feb 17, 2014
833
309
/
Samsung Galaxy S4
Samsung Galaxy S10
I've successfully dumped an image with a size of 1.8GB, but now i want to create the SDCard-image, but thats up to 25GB i guess! How can i dump this rom direct to my PC? Because i can't save this on my phone, have only 32GB HTC One. Or is there an other option to just dump several folders of that sdcard?

Is it maybe possible to directly write over the OTG to the USB-portable-stick (Size about 32GB)?

I found it impossible to dump to pc windows / ubuntu (but there might be a way i have not heard of)

Anyway SDcard image is pointless because its available when phone plugged in usb

For sd backups i usually (i have set folder options to show hidden/system files <in windows>) open the sd on pc mark all items and zip it to my hdd as ie. sdback-260314.zip and if i ever need i can just unzip direct to sd again :)
 

yahooyahoo

New member
May 9, 2012
4
0
I found it impossible to dump to pc windows / ubuntu (but there might be a way i have not heard of)

Anyway SDcard image is pointless because its available when phone plugged in usb

For sd backups i usually (i have set folder options to show hidden/system files <in windows>) open the sd on pc mark all items and zip it to my hdd as ie. sdback-260314.zip and if i ever need i can just unzip direct to sd again :)

Hi there,

I've got LG G2 (D802) and need to dump userdata partition to recover data from it. The phone doesn't have an SD slot, and I dont want to overwrite the internal memory so i need to dump an img directly to windows. Is it possible? or what else can I do to recover lost data? (i need all of them, not only pics or messages).

Thanks
 
I've successfully dumped an image with a size of 1.8GB, but now i want to create the SDCard-image, but thats up to 25GB i guess! How can i dump this rom direct to my PC? Because i can't save this on my phone, have only 32GB HTC One. Or is there an other option to just dump several folders of that sdcard?

Is it maybe possible to directly write over the OTG to the USB-portable-stick (Size about 32GB)?

Reboot into twrp plug in an external USB stick mount sdcard , mount external USB copy /dev/block/mmcblk1 to you external USB storage. At least that's the file on my phones. I don't own a HTC one but I was able to do this on my DNA

I was able to dump all 34 filesystem partitions by pulling the main header of the block into one massive file. In linux reader it looks cool mount one image and 34 partitions appear. Each partition can be easily exported to their seperate image from there. It took almost 2 hours just to pull the 9gb block. But it was worth it.

So far I've been successful with this method on every rooted device I have. Still have yet to not had any success from a pc. Keeps causing cmd to crash from the huge file transfer. I will have to try from my studio pc. I think 32 gigs of ram will allow cmd to survive the torture.

sent from the moon
 
Last edited:
  • Like
Reactions: CVAngelo
I found it impossible to dump to pc windows / ubuntu (but there might be a way i have not heard of)

Anyway SDcard image is pointless because its available when phone plugged in usb

For sd backups i usually (i have set folder options to show hidden/system files ) open the sd on pc mark all items and zip it to my hdd as ie. sdback-260314.zip and if i ever need i can just unzip direct to sd again :)

Enable USB debugging. Plug your phone into pc. Make sure your phone DOES NOT unmount you card as a disk drive Open cmd in your android-SDK platform-tools.

Type..

adb devices
adb shell
su
I'M NOT SURE IF ROOT IS REQUIRED
cat /dev/block/mmcblk1 mmcblk1.raw




Depending on the device folders and names could be different. Defining you SDK platform tools environment path will help

This works on windows 7
Word on linux reader program is good tool to mount the raw nand dumps in windows pc.


Next step is to see of the nand dump can be restored on a dead boot bricked device. I've been looking into several of the small partitions on HTC devices and I keep seeing references to vol buttons, uart and jtag.


I'm new here. Shoot me a thanks if you liked me contribution.

sent from the moon
 
Last edited:
  • Like
Reactions: IGGYVIP

stream13

Member
Mar 24, 2014
23
0
Can I use the IMG files dumped with this tutorial to make PAC file of ResearchDownload? Or do I need to do something else too??

Thanks ....
 

hackenggr

Senior Member
May 15, 2007
134
8
Wah Cantt
Hey

Great guide thanks.

Have a question if I extract the recovery.img can I flash it back to get the stock recovery back without modifying it further when needed?

and which partitions are required to dump the bootloader that I seen often and bootl.img that replace the bootloader to install the custom recovery I want to go back to stock recovery after flashing a custom rom then removing the cracked bootloader and custom recovery to stock one as it was delivered
 

IGGYVIP

Senior Member
Feb 17, 2014
833
309
/
Samsung Galaxy S4
Samsung Galaxy S10
Detailssssssssss

Hey

Great guide thanks.

Have a question if I extract the recovery.img can I flash it back to get the stock recovery back without modifying it further when needed?
Yes you can flash it back no need for modifications ...

and which partitions are required to dump the bootloader that I seen often and bootl.img that replace the bootloader to install the custom recovery I want to go back to stock recovery after flashing a custom rom then removing the cracked bootloader and custom recovery to stock one as it was delivered


http://xdaforums.com/showthread.php?t=2726292


AND THEN ASK AGAIN !!!!

ARE WE TALKING PHONE FROM 1987 or 2014 ?
android cupcake or kitkat ?
is it nexsus 5 or huawei ?

you make me ask you more questions than you are asking ...
 
Last edited:
  • Like
Reactions: hackenggr

hackenggr

Senior Member
May 15, 2007
134
8
Wah Cantt
Yes you can flash it back no need for modifications ...

Thanks

http://xdaforums.com/showthread.php?t=2714343


AND THEN ASK AGAIN !!!!

ARE WE TALKING PHONE FROM 1987 or 2014 ?
android cupcake or kitkat ?
is it nexsus 5 or huawei ?

you make me ask you more questions than you are asking ...

link of the thread you mentioned lead me to empty page showing message

Invalid thread specified. This can happen for a variety of reasons-- most likely because the thread or post you are trying to view has been moved or deleted. Please return to the forum home and browse for another similiar post.

Phone Details are:
LG-LU6200 aka LG Optimus LTE (Korean variant of LG Nitro HD) it is more likely from around 2012 lol
Android Jelly Beans OTA updated in mid 2013

when it was on ICS to root it was needed to downgrade to ICS Engineer version then can root and install the custom recovery now on JB it get root by script just but to install the custom recovery it flashed two files recovery.img and bootl.img but after that even the set is JB but the first screen after turning on with LG logo shows the ICS Engineer Version on the corner that I guessed the bootloader is replace with the one that is not locked I not know I am right or not though assuming this. However here is the code that flashes the custom recovery

echo off
cls
echo.
adb.exe wait-for-device
echo.
pause
echo Flashing Recovery now...
adb.exe push recovery.img /sdcard/recovery.img
adb.exe push bootl.img /sdcard/bootl.img
adb.exe shell su -c "cat /sdcard/recovery.img > /dev/block/mmcblk0p13
adb.exe shell su -c "cat /sdcard/bootl.img > /dev/block/mmcblk0p7
adb.exe shell su -c "reboot recovery"

echo.
pause
I think the mmcblk0p7 is bootloader because but I am not know it is full loader or a portion etc because searching around with example on other phone I see more than one blocks called as bootloader. My curiosity is that if I dump the mmcblk0p13 for recovery.img and mmcblk0p7 for bootl.img while on complete stock rom then install the custom rom and restore the recovery.img and bootl.img that I dumped from stock phone will be get back to stock state with custom rom i.e ICS Engineer mode in the start will disappear or not and I will get the simple stock recovery provided by LG.
 

IGGYVIP

Senior Member
Feb 17, 2014
833
309
/
Samsung Galaxy S4
Samsung Galaxy S10
sorry link updated now :)

Thanks



link of the thread you mentioned lead me to empty page showing message

Invalid thread specified. This can happen for a variety of reasons-- most likely because the thread or post you are trying to view has been moved or deleted. Please return to the forum home and browse for another similiar post.

Phone Details are:
LG-LU6200 aka LG Optimus LTE (Korean variant of LG Nitro HD) it is more likely from around 2012 lol
Android Jelly Beans OTA updated in mid 2013

when it was on ICS to root it was needed to downgrade to ICS Engineer version then can root and install the custom recovery now on JB it get root by script just but to install the custom recovery it flashed two files recovery.img and bootl.img but after that even the set is JB but the first screen after turning on with LG logo shows the ICS Engineer Version on the corner that I guessed the bootloader is replace with the one that is not locked I not know I am right or not though assuming this. However here is the code that flashes the custom recovery


I think the mmcblk0p7 is bootloader because but I am not know it is full loader or a portion etc because searching around with example on other phone I see more than one blocks called as bootloader. My curiosity is that if I dump the mmcblk0p13 for recovery.img and mmcblk0p7 for bootl.img while on complete stock rom then install the custom rom and restore the recovery.img and bootl.img that I dumped from stock phone will be get back to stock state with custom rom i.e ICS Engineer mode in the start will disappear or not and I will get the simple stock recovery provided by LG.

If you were to do it it will say "secure boot error"

In your case only unlocked bootloader allows you to have custom recovery and ROM.

why is it a trouble ?
do you just need to get rid of this engineer mode notification ?
 
  • Like
Reactions: hackenggr

hackenggr

Senior Member
May 15, 2007
134
8
Wah Cantt
Thanks for the above link fix I will check it out soon

If you were to do it it will say "secure boot error"

In your case only unlocked bootloader allows you to have custom recovery and ROM.

I intend to get the stock recovery back after flashing custom rom (it is stable for me until KitKat comes and I have to try the different roms again) so the recovery is not a problem in replacing the latest bootloader back even if it is lock until it not give the "secure boot error"

why is it a trouble ?
do you just need to get rid of this engineer mode notification ?

In fact yeah I just not like it phone running JB showing the ICS in the start. Secondly it is something to learn no matter how small it is :)


btw I am unable to use the parted program mentioned in the guide because it not print the partition was saying something qualification not met. I can post the screen later. Also unable to get the named partitions as mention in second way because it is set by-num and on ls command just show the numbers along the partitions not any other detail like the type and name etc
 

nasr18

Member
Dec 3, 2013
28
2
Tirunelveli
parted

bro in my case, the command ls -al /dev/block/platform having different name like "/dev/block/platform/mtk.msdc.0/by-num" what shall i do??? :confused:
 

Top Liked Posts

  • There are no posts matching your filters.
  • 353
    Use:
    The main purpose is to make a file that contains all data in android specific partition. This is really handy in case of dumping leak firmwares.


    Pr-requirement:
    - Rooted device.
    - Knowledge of how to use adb or Terminal Emulator.

    The first step of making dump files out of device partitions is to locate its mounting points..!!
    So in our tutorial, we will make it in 2 sections. Section 1 for how to get mounting points, and section 2 for how to get partition dumped..
    Keep in mind that this is xda-university; so my target is to show beginners how to do that manually, without the aid of any tool, so they can get the concept behind it.. OK let's begin..!!

    Section 1:
    Getting mounting points
    There are several methods to achieve this, but we will discuss the easiest methods that give efficient information about the partition that you want to know its mounting point.
    All these methods will be described using adb shell.

    Way #1
    Code:
    adb shell
    cat /proc/partitions
    This one needs from you to figure out which block belong to which partition name.!!

    2ds4ujd.png


    Way #2
    Code:
    adb shell
    ls -al /dev/block/platform/[B][COLOR="Blue"]dw_mmc[/COLOR][/B]/by-name
    This one will give you info about the dev block names WITH their familiar names (i.e, boot, recovery, system... etc)

    rsg20h.png

    This command is not universal between devices, and you will need to gather its pieces (/dev/block/platform/dw_mmc/by-name).
    How?
    - In your device, use any explorer that can get you to the device root (personally I use ES Explorer, by pressing on "/" on navigation bar).
    - Go to "/dev/block/platform/" folder
    - Here you will see some files and folders, we need to open folders and search for the folder called "by-name" inside one of them; in my situation it was "dw_mmc" folder which has the folder "by-name" inside it.
    - At the end, my targeted piece info will be (/dev/block/platform/dw_mmc/by-name)
    - Now open adb shell and put that command..


    Way #3
    By pushing parted binary to /system/bin folder and run it (you can find it in attachment).
    Code:
    adb remount
    adb shell "su" "" "mount -o remount,rw /system"
    adb push parted /system/bin/parted
    adb shell
    chmod 0755 /system/bin/parted
    parted /dev/block/[B][COLOR="Blue"]mmcblk0[/COLOR][/B]
    print

    11t5x7c.png

    Here, your mounting points will start with /dev/block/mmcblk0p* where (*) is the number shown in the table above for each partition.
    example:
    The hidden partition mounting point will be mmcblk0p10
    The radio partition mounting point will be mmcblk0p7
    The system partition mounting point will be mmcblk0p9
    The recovery partition mounting point will be mmcblk0p6

    and so on

    Don't forget to "quit" the parted action after grasping your device mounting points.

    N.B:
    - You may need to run first:
    Code:
    adb shell
    cat /proc/partitions
    to know what is the initial name for your device partition.. In the example above, it was mmcblk0.

    wbaufd.png

    - Also to be able to do adb push to /system partition for parted binary, you will need insecure boot.img used in your ROM or adbd insecure installed in your device (Check this thread for that app), or just push parted binary manually by any root explorer and then fix permissions to rwxr-xr-x (755).

    ***​

    Section 2:
    Dumping ROM partition
    After locating the mounting point of the partition you want to dump, open adb shell command prompt and type:
    Code:
    adb shell
    su
    dd if=[B][COLOR="Blue"]/yourMountingPoint[/COLOR][/B] of=[B][COLOR="Green"]/yourDestination[/COLOR][COLOR="Red"]/partitionType[/COLOR][/B]
    Let's say I want to take a dump out of system partition from above example. So the adb commands will be:
    Code:
    adb shell
    su
    dd if=[B][COLOR="Blue"]/dev/block/mmcblk0p9[/COLOR][/B] of=[B][COLOR="Green"]/sdcard[/COLOR][COLOR="Red"]/system.img[/COLOR][/B]
    This may take a while to complete the dumping process, depending on the size of your dumped partition; so be patient..

    Note:
    If the partition is formatted as ext3/4 then the dumped partition will have .img as an extension.
    Other partition dumps have different extensions; examples:
    • radio.bin
    • param.lfs
    • Sbl.bin
    • zImage (without extension)

    ***​

    Optional:
    Read Partition Image
    After dumping an image from android partition, you can mount it to extract a particular file for sharing, or the whole dump content in case the ROM chief wants to make a ROM out of dump files..
    For Linux Users:
    - Open terminal and type:
    Code:
    su -
    mkdir -p /mnt/disk
    mount -o loop [B][COLOR="Red"]yourImage.img[/COLOR][/B] /mnt/disk
    cd /mnt/disk
    ls -l

    For Windows Users:
    - Download LinuxReader from this site here.
    - Open it -> Drives -> Mount Image -> Then choose your dumped image and hit Mount. A new driver will appear that contains all files inside the dumped image called "Linux native Volume 1". Just double click it to get inside the dumped image.

    2roj2f4.png


    2dhbhxd.png


    I hope you will find this tutorial beneficial,,,
    Yours;

    115
    Actions Explanation

    ★ Tutorial Legends ★

    In this post, I will try to explain the use of each binary used in the tutorial, so you can make sense of each action taken.

    #1
    Code:
    adb shell
    Run remote shell interactively, as if you are in linux terminal.

    #2
    Code:
    cat /proc/partitions
    cat binary is used to concatenate file(s) and print them to standard output display. In our example, it prints the content of partitions file which is found in proc folder to screen display.

    #3
    Code:
    ls -al /dev/block/platform/dw_mmc/by-name
    ls binary is used to list directory contents.
    -al is the used option for ls which means to include entries that started with "." in long listing format. There are a lot of options for ls binary. You can always print ls --h to display help menu for other options available.

    #4
    Code:
    adb remount
    Remounts the /system partition on the device read / write. This has been disabled in some devices (those with secure boot image); so you need to make sure that you have patched adbd that can run this command effectively.

    #5
    Code:
    su
    Used to get super-user privilege.


    #6
    Code:
    mount -o remount,[B][COLOR="Red"]rw[/COLOR][/B] /system
    Specific command to mount the /system partition on the device read / write (rw).
    If you change rw to ro, you will get /system partition mounted as read only.

    #7
    Code:
    adb push parted /system/bin/parted
    adb push is used to copy file/dir from your local computer to android device. The usual format is adb push <local> <remote>

    #8
    Code:
    chmod 0755 /system/bin/parted
    chmod binary is used to set permissions for the specified file/dir.
    The number after chmod is the permission used. See the next box for better understanding of chmod formatting:
    Code:
    [CENTER][B][COLOR="Red"]----------------
    | CHMOD SCHEME |
    ----------------[/COLOR][/B][/CENTER]
              [B] r     w     x[/B]
               [B]4     2     1    [COLOR="Green"]= 7 (Full Permissions)[/COLOR][/B]
    
      User    ( )   ( )   ( )   [B][COLOR="Green"]--> 2nd digit[/COLOR][/B]
      Group   ( )   ( )   ( )   [B][COLOR="Green"]--> 3rd digit[/COLOR][/B]
      Other   ( )   ( )   ( )   [B][COLOR="Green"]--> 4th digit[/COLOR][/B]
    
      Special UID   GID   STK
              ( )   ( )   ( )   [B][COLOR="Green"]--> 1st digit, ignored on most cases or put 0[/COLOR][/B]
    In the above example, it is set to 0755 which means the following scheme:
    Code:
              [B] r     w     x[/B]
               [B]4     2     1[/B]
    
      User    ([B][COLOR="Red"]*[/COLOR][/B])   ([B][COLOR="Red"]*[/COLOR][/B])   ([B][COLOR="Red"]*[/COLOR][/B])   [B][COLOR="Green"]--> This equals to 7 (rwx)[/COLOR][/B]
      Group   ([B][COLOR="Red"]*[/COLOR][/B])   ( )   ([B][COLOR="Red"]*[/COLOR][/B])   [B][COLOR="Green"]--> This equals to 5 (r-x)[/COLOR][/B]
      Other   ([B][COLOR="Red"]*[/COLOR][/B])   ( )   ([B][COLOR="Red"]*[/COLOR][/B])   [B][COLOR="Green"]--> This equals to 5 (r-x)[/COLOR][/B]
    
      Special UID   GID   STK
              ( )   ( )   ( )   [B][COLOR="Green"]--> This equals to 0 (---)[/COLOR][/B]
    As you can see, if you said 0755, it will be as same as saying ---rwxr-xr-x

    #9
    Code:
    dd if=/dev/block/mmcblk0p9 of=/sdcard/system.img
    dd binary is used to copy a file with converting and formatting.
    if means input file; here we pointed to the whole partition, not specific file.
    of means outputting file to specific destination path; here it is to sdcard with system.img name.

    #10
    Code:
    mkdir -p /mnt/disk
    mkdir binary is used to make folder dir.
    -p is mkdir option which means to create folder with sub-folder at the same time. Here we want to create mnt folder that contains disk sub-folder in it. If the folder and or sub-folder(s) are already exists, it will not give error but nothing will be created.

    #11
    Code:
    mount -o loop yourImage.img /mnt/disk
    This is linux way to mount images into specific directory (/mnt/disk in this example).

    #12
    Code:
    cd /mnt/disk
    cd used to get inside specific dir path.

    #13
    Code:
    ls -l
    ls binary is used to list directory contents as described above.
    -l is the used option for ls which means to list contents in long listing format.


    Cheers
    11
    another way to get common names

    on way #2, I've often used:
    Code:
    cat /proc/emmc
    on a few devices to reveal similar info.

    Rob
    5
    can i able to mount boot.img in android itself...actually i wanted to extract boot.img frm mobile without any tools or without the help of PC...if there be any possibilities..??

    if you mean extract to modify boot.img, then I don't think there is away to do that from device itself in the moment..
    if you mean dumping boot.img then yes you can, just install terminal emulator from Google play and you can run adb shell commands directly from the device
    4
    can i able to mount boot.img in android itself...actually i wanted to extract boot.img frm mobile without any tools or without the help of PC...if there be any possibilities..??