0

So here is what i want to pull : mmcblk0 whith it's size 15.7 GB.

C:\adb>adb shell
shell@android:/ $ su
su
shell@android:/ # fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0

Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes
1 heads, 16 sectors/track, 1923584 cylinders
Units = cylinders of 16 * 512 = 8192 bytes

This is what I tried:

C:\adb>adb shell su busybox cat /dev/block/mmcblk0 > C:\1.bin

I only have 1KB output with content inside said "unknown id". Also tried with pull but seems also doesn't work.

What should I do to get this 15.7 GB mmcblk0 ?

2

Try: dd if=/dev/block/mmcblk0 of=/sdcard/something.bin

You can do that in a Terminal Emulator or ADB shell.
It requires only root access.

You can then pull this file to your desktop. I don't know of a way to do it simultaneously.

0
  1. Show Developer Options (Settings > Developer> tap build 7 times)
  2. Enable USB Debugging (Settings > Developer > USB Debugging)
  3. use TWRP recovery to avoid OS root limitations

    adb reboot recovery

  4. check your mount points

    adb shell mount | FINDSTR /R /C:"^/dev"

  5. do the pull

    adb pull /dev/block/mmcblk0 mmcblk0.img

For those using a unix like system use grep instead of FINDSTR;

./adb shell mount | grep -P "^/dev" | perl -pe 's/ .*//g' | sort -u
/dev/block/platform/msm_sdcc.1/by-name/cache
/dev/block/platform/msm_sdcc.1/by-name/modem
/dev/block/platform/msm_sdcc.1/by-name/persist
/dev/block/platform/msm_sdcc.1/by-name/system
/dev/block/platform/msm_sdcc.1/by-name/userdata
/dev/fuse
  • 1
    You cannot adb pull a device, sorry – so that won't work. Not even in recovery. – Izzy May 2 '16 at 5:18
  • Strange. If you check ADB pull error: remote object '/dev/block/mmcblk0p24' not a file or directory, it just gave remote object '/dev/block/mmcblk0' not a file or directory – which is what I had expected here. – Izzy May 2 '16 at 16:10
  • @user1133275 you might have a point there – but then dd if=/dev/block/mmcblk0 of=/sdcard/something.bin shouldn't have worked either. If you checked that yourself and it worked for you, guess we've simply got to believe you and add "this might not always work. If it doesn't, use the other approach" :) – Izzy May 2 '16 at 19:35
0

if you're in shell, you could use sh instead of su

from windows, using ADB, set the device in a custom recovery then from a cmd window:

adb remount
adb root
adb shell

if done while the device is in recovery mode (and not bootloader or sideload) you would drop into a terminal/command line with "~:" instead of "shell@android:" then proceed with:

cat /dev/block/mmcblk0 > /sdcard/mmcblk0.img

[then there's no need to use sh since you're already in as shell] and then open another separate cmd window from your pc to pull the file you made (20-30 mins ago****) and use:

adb pull /sdcard/mmcblk0.img

you can name "mmcblk0.img" to whatever you want it just needs an output file name and extension

****HOWEVER, please be aware and be patient when you run cat, because the cmd window in windows wont show anything while it's "creating" the 15gb .img file, it will just show a line break in the cmd window and seem to provide no response as it processes your command. And you'll know it's finished when you get a fresh line to enter a new command. since its over 15gb, if your device doesnt have that much storage space to create the file on, you can change the output path after ">" to /storage/sdcard1/mmcblk0.img or what have you, but be sure to have a fast (class 10 or better) microsd because 15gb will take a while to write. Id estimate around half an hour on an external micro sd.

aside from that, why would you want to extract that? it would make more sense if you asked about mmcblk0p05 or mmcblk0p03 but ehh, if you're not planning to read through the binaries by hex then i guess to every man (or woman) his (her) own...

0

If I am right, you've done nothing wrong but the way you run su.
From su --help (SuperSU Version 2.79):

Usage#2: su LOGIN COMMAND...

Thus, you should run

C:\adb>adb shell su root busybox cat /dev/block/mmcblk0 > C:\1.bin

and everything's fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.