[GUIDE] Making Dump Files Out of Android Device Partitions

Search This thread

zameer_yus

Senior Member
Mar 14, 2013
60
4
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 ----------



adb shell can see windows folders as read only file system
maybe on linux ? will test and see :)
i am stuck dumping user data partition in all Samsung phones
for now i want to dump user data partition from i9105p when i m dumping the partition
it dumps a very big amount of file, when i am dumping user data partition from a 32GB phone it create around 32gb userdata.img file
how i can dump only used part of this partition?
 
Last edited:

IGGYVIP

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

Belamigo

Senior Member
Sep 2, 2013
53
7
Funchal
Are the images flashable with fastboot -- asked but not answered?

•...
•Are the images I'm dumping flashable through fastboot?
They should be, but I have not been able to flash anything on the I9505G vi fastboot ...

...
I have some other questions:
  • ...
  • ...
  • ...
  • Are the images I'm dumping flashable through fastboot?
...

... Further, I tried to run "fastboot boot recovery.img" with recovery.img being the image file I dumped. The phone froze and I had to pull the battery... So I assume they're not flashable as well, though I'd like other feedbacks.
...!
This is confusing. Three posts are asking if these recovery images work with fastboot. The question is asked twice, and the third time it's concluded that they are not.

I thought you had to use "fastboot flash recovery recovery.img"?
 

demkantor

Inactive Recognized Contributor
Nov 10, 2011
6,861
3,764
mpls
I can't attest to weather the images will work when flashed through fastboot but I suspect they are as when making a nandroid with an older recovery (one that formats partitions into yaffs2) they are flashable and this should pull a similar image. Yet I never tried these
But for @Belamigo the fastboot boot vs fastboot flash a recovery just boots a recovery image rather than flashes it to phone, this is a non permanent way of testing a recovery or kernel

Sent from my Nexus 4 using XDA Premium 4 mobile app
 

E:V:A

Inactive Recognized Developer
Dec 6, 2011
1,447
2,222
-∇ϕ
@majdinj I have linked to this excellent guide in the OP of my El Grande thread.
@all:
Be careful not to try to cross flash partitions from other devices or firmwares on Samsung phones. The locked boot chains on most new Samsung phones are following the SEAndroid (Android SELinux) boot-chain protection mechanisms.
 

carl1961

Senior Member
Dec 5, 2010
7,521
6,201
Tickfaw
i am stuck dumping user data partition in all Samsung phones
for now i want to dump user data partition from i9105p when i m dumping the partition
it dumps a very big amount of file, when i am dumping user data partition from a 32GB phone it create around 32gb userdata.img file
how i can dump only used part of this partition?

do a CWR (recovery)backup, copy the backup to your computer

then from command prompt combine the data files and then unpack with 7-zip


Code:
Extracting files from CWM backup's carl1961 UrDroid

I made bat files to do the job easier

copy your backup files to your computer
copy these bat files to backup folder
edit the bat file if you have more files to combine
double click the bat file
use 7-zip to unpack the tar file

example:
From windows CMD promt ( typing by hand)

type without "" 

"type system.ext4.tar.a system.ext4.tar.b system.ext4.tar.c >> system.ext4.tar"

type file1 file2 file3 file4 file5 >> your_final_file.tar
*******************************************

Galaxy note 3 clockworkmod recovery files (Urdroid)

type data.ext4.tar.a  >> data.ext4.tar

type cache.ext4.tar.a  >> cache.ext4.tar

type system.ext4.tar.a system.ext4.tar.b  >> system.ext4.tar



Where  I Learn this:

source: XDA @ yasir.97
http://xdaforums.com/showthread.php?t=2194171
 

zameer_yus

Senior Member
Mar 14, 2013
60
4
do a CWR (recovery)backup, copy the backup to your computer

then from command prompt combine the data files and then unpack with 7-zip


Code:
Extracting files from CWM backup's carl1961 UrDroid

I made bat files to do the job easier

copy your backup files to your computer
copy these bat files to backup folder
edit the bat file if you have more files to combine
double click the bat file
use 7-zip to unpack the tar file

example:
From windows CMD promt ( typing by hand)

type without "" 

"type system.ext4.tar.a system.ext4.tar.b system.ext4.tar.c >> system.ext4.tar"

type file1 file2 file3 file4 file5 >> your_final_file.tar
*******************************************

Galaxy note 3 clockworkmod recovery files (Urdroid)

type data.ext4.tar.a  >> data.ext4.tar

type cache.ext4.tar.a  >> cache.ext4.tar

type system.ext4.tar.a system.ext4.tar.b  >> system.ext4.tar



Where  I Learn this:

source: XDA @ yasir.97
http://xdaforums.com/showthread.php?t=2194171

hello thanks for replay ,
can you tell me will these file will work to flash it trough odin?

i m using this command for making odin flash able files

tar -h ustar -c (file names) > filename.tar
md5sum -t filename.tar >> filename.tar


if i m able to flash it back on odin then my problem is solved
 

carl1961

Senior Member
Dec 5, 2010
7,521
6,201
Tickfaw
hello thanks for replay ,
can you tell me will these file will work to flash it trough odin?

i m using this command for making odin flash able files

tar -h ustar -c (file names) > filename.tar
md5sum -t filename.tar >> filename.tar


if i m able to flash it back on odin then my problem is solved

I do not think , they usually have a Samsung signed

Sent from my SAMSUNG-SM-N900A using XDA Premium 4 mobile app
 

Cobaltikus

Senior Member
Can't open disk: Check the disk and try again

How should I read the image files created if Linux reader does not want to work for me?
Or am I doing something wrong?

AT&T Samsung Galaxy Note 3
Android 4.4.2
Dumped all partitions to image files except userdata using the following syntax
Code:
[SIZE="2"]dd if=/dev/block/mmcblk0p6 of=/sdcard/images/aboot-mmcblk0p6[/SIZE]
pulled all image files to windows using adb pull
Installed DiskInternals Linux Reader
Used the linux reader to mount partition image file
New disk shows up with red text
When I try to open it I get an error message

Can't open disk: D:\Apps\Phones\Android\AT&T Samsung Galaxy Note 3\Partition Images\aboot-mmcblk0p6
Check the disk and try again

I haven't tried all 24 files but all the main ones and a few random ones all with the same result.
 

Wuby986

Senior Member
Oct 18, 2013
2,144
2,440
How should I read the image files created if Linux reader does not want to work for me?
Or am I doing something wrong?

AT&T Samsung Galaxy Note 3
Android 4.4.2
Dumped all partitions to image files except userdata using the following syntax
Code:
[SIZE="2"]dd if=/dev/block/mmcblk0p6 of=/sdcard/images/aboot-mmcblk0p6[/SIZE]
pulled all image files to windows using adb pull
Installed DiskInternals Linux Reader
Used the linux reader to mount partition image file
New disk shows up with red text
When I try to open it I get an error message

Can't open disk: D:\Apps\Phones\Android\AT&T Samsung Galaxy Note 3\Partition Images\aboot-mmcblk0p6
Check the disk and try again

I haven't tried all 24 files but all the main ones and a few random ones all with the same result.
Aboot isn' t an .img file , is .mbn and if you tiped exacly the code you posted looks like is not correct as the name of the dumped file has no extension and a wrong name... anyway you cannot mount it and also editing that file is not possible for what i know
 

Cobaltikus

Senior Member
Aboot isn' t an .img file , is .mbn and if you tiped exacly the code you posted looks like is not correct as the name of the dumped file has no extension and a wrong name... anyway you cannot mount it and also editing that file is not possible for what i know

The output filename shouldn't matter. You can name it anything. I knew the different partitions had different extensions so I just left them off for now, planning to add them once I knew for sure. You can give any file any name and extension and it has no effect on the data inside the file. Although editing these files will be a desire, what I need to do first is read them, and if I can't read them, then what's the point of dumping them? Aboot was just an example. I dumped all partions and none worked. I.e recovery and boot which should be img.

Sent from my SAMSUNG-SM-N900A using XDA Free mobile app
 

Wuby986

Senior Member
Oct 18, 2013
2,144
2,440
The output filename shouldn't matter. You can name it anything. I knew the different partitions had different extensions so I just left them off for now, planning to add them once I knew for sure. You can give any file any name and extension and it has no effect on the data inside the file. Although editing these files will be a desire, what I need to do first is read them, and if I can't read them, then what's the point of dumping them? Aboot was just an example. I dumped all partions and none worked. I.e recovery and boot which should be img.

Sent from my SAMSUNG-SM-N900A using XDA Free mobile app
Have you double checked all the steps?

Oh and btw.. extension IS important.. that' s why maybe :)
 
Last edited:

Cobaltikus

Senior Member
Have you double checked all the steps?

Oh and btw.. extension IS important.. that' s why maybe :)

Double checked everything.

I would be extremely surprised if the extension mattered during the dd command.
I could possibly see how the linux reader may not mount it correctly with the wrong extension, so I will try that again when I get home after a file rename. The linux reader could, and I assumed it would, be smart enough to detect the file type based on content as opposed to extension. But that was an assumption on my part. I will now lookup the proper extensions for each partition file...

Sent from my SAMSUNG-SM-N900A using XDA Free mobile app
 

IGGYVIP

Senior Member
Feb 17, 2014
833
309
/
Samsung Galaxy S4
Samsung Galaxy S10
How should I read the image files created if Linux reader does not want to work for me?
Or am I doing something wrong?

AT&T Samsung Galaxy Note 3
Android 4.4.2
Dumped all partitions to image files except userdata using the following syntax
Code:
[SIZE="2"]dd if=/dev/block/mmcblk0p6 of=/sdcard/images/aboot-mmcblk0p6[/SIZE]
pulled all image files to windows using adb pull
Installed DiskInternals Linux Reader
Used the linux reader to mount partition image file
New disk shows up with red text
When I try to open it I get an error message

Can't open disk: D:\Apps\Phones\Android\AT&T Samsung Galaxy Note 3\Partition Images\aboot-mmcblk0p6
Check the disk and try again

I haven't tried all 24 files but all the main ones and a few random ones all with the same result.

dude linux reader is only ext2/3/4 so you cannot read files that are in other formats
only partitions to be in ext 2/3/4 could be /data /system /cache /fota /presist

the images are ok and if you were to flash them back it would be ok
aboot is not an ext4 partition its bootloader and the whole thing is a little "program" not files and normal filesystem

question is what are you trying to achieve ? why you want to read all of them ?
what are you looking for there ?

---------- Post added at 04:55 PM ---------- Previous post was at 04:50 PM ----------

Have you double checked all the steps?

Oh and btw.. extension IS important.. that' s why maybe :)

extension has 0 nil nothing nada to do with the reader program
dd command does not care about extensions either u can have no extension or u can have file-name starting from . (period/full stop) and all will complete successfully

---------- Post added at 04:57 PM ---------- Previous post was at 04:55 PM ----------

Double checked everything.

I would be extremely surprised if the extension mattered during the dd command.
I could possibly see how the linux reader may not mount it correctly with the wrong extension, so I will try that again when I get home after a file rename. The linux reader could, and I assumed it would, be smart enough to detect the file type based on content as opposed to extension. But that was an assumption on my part. I will now lookup the proper extensions for each partition file...

Sent from my SAMSUNG-SM-N900A using XDA Free mobile app

yeah linux reader does not care :)
read my previous posts
 

Cobaltikus

Senior Member
dude linux reader is only ext2/3/4 so you cannot read files that are in other formats
only partitions to be in ext 2/3/4 could be /data /system /cache /fota /presist

the images are ok and if you were to flash them back it would be ok
aboot is not an ext4 partition its bootloader and the whole thing is a little "program" not files and normal filesystem

question is what are you trying to achieve ? why you want to read all of them ?
what are you looking for there ?

---------- Post added at 04:55 PM ---------- Previous post was at 04:50 PM ----------



extension has 0 nil nothing nada to do with the reader program
dd command does not care about extensions either u can have no extension or u can have file-name starting from . (period/full stop) and all will complete successfully

I did confirm my original assumption that the filename and extension are not important. Thank you for the clarification on the partitions. I'm looking for the bootloader so I can try to figure out how to unlock it. I've never done this before and am looking for everything and anything.

Sent from my SAMSUNG-SM-N900A using XDA Free mobile app
 

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..??