How can I dumb a full internal storage image to windows PC?


3Ab3Azim

Members
Nov 20, 2020
15
15
So I've accidently deleted a very important folder from my Xiaomi Redmi note 9s internal storage. I figured out there's no way to recover it, unless I dumb the whole internal storage to PC, mount it as a disk, then perform recovery

I followed the steps mentioned in this article
Quote

"
Windows:

  1. install cygwin. During install, add netcat (under Net) and pv (under util-linux) packages; the standard install is located in C:\ so make sure you have enough disk space beforehand;
  2. install adb e.g. through Android Studio. Make sure to add adb.exe executable file to the path variable to access it properly (guide).
  3. Open two cygwin consoles/terminals (one sending data, one receiving data) and enter in one of the terminals to enter the device:
# terminal 1
adb forward tcp:5555 tcp:5555 # forward data over tcp connection
adb shell # open a connection
su # gain root access
BUSYBOX=/system/xbin/busybox # default location for most bb installers

# note: adapt the variable `BUSYBOX` to point to your install directory
# the TWRP default is `BUSYBOX=/sbin/busybox` (in case of bricked device)

  1. Decide what partition to copy, the /dev/block/mmcblk0 partition is usually the one containing the data you typically would want.
  2. In the following code, adapt the partition name according to 4. and quickly one after another type in terminal 1 and terminal 2:
# terminal 1
$BUSYBOX nc -l -p 5555 -e $BUSYBOX dd if=/dev/block/mmcblk0

# terminal 2
nc 127.0.0.1 5555 | pv -i 0.5 > $HOME/mmcblk0.raw

This saves the partition in the cygwin home directory (in a nutshell: it sends/receives output of dd over a tcp connection)

Look at the files / analysis

  • To mount the partition in Windows you can use (OSFmount).
  • To analyze the files I recommend Active@ Undelete but there are tons of alternatives. With that program you can also directly load all partitions from the file (without mounting it, so step 5 is redundant in this case)."



I rooted the phone installed busybox under bin not xbin due to error
Then
130|curtana:/ # $BUSYBOX nc -l -p 5555 -e $BUSYBOX dd if=/dev/block/mmcblk0

I got

dd: error writing 'standard output': Connection reset by peer
24+0 records in
23+0 records out
11776 bytes (11.5KB) copied, 0.093130 seconds, 123.5KB/s

And the command on the second terminal was

$ nc 127.0.0.1 5555 | pv -i 0.5 > $HOME/mmcblk0.raw
-bash: nc: command not found
-bash: pv: command not found

So I was stuck and don't know what to do


If anyone can help me backup the image it will be very appreciated!

Sorry I'm a newbie and I'm just trying to work things out