If you accidentally formatted the internal memory of the smartphone, then you should not be upset, and most importantly,
in no case do not need to write anything in the memory device so you can recover more data.
The MTP protocol does not allow the computer to recognize the connected device as a USB drive and recovery software cannot scan it and save data, so we need to copy the entire internal memory section in the form of a system image. Helping performance was carried out on Windows 10 x64 version 1607 (assembly OS 14393.187). Before you start looking at the free space on hard drives, since when copying a section, you may need a lot of space depending on the size of the drive. Since I have a disc with only under Windows and programs, then all actions will be described on the disk on which it is abused, namely on the disk E. In your case, it can remain with if there is enough space.
Preparing Android device: You will need root and USB debugging enabled.
PC Preparation: In order to copy the system section, we need:
- VHDTool
- Download and install the program on your computerCygwin(allows you to use UNIX commands in a WINDOWS environment). Go to the site and click on the linkInstall Cygwin. Depending on the bitness of the OS, select the appropriate file. After that, the download will start. Run the installation, selectinstall from internet . Select the installation folder C: \ cygwin64. Next, select the folder (you can any), in which during the installation component cygwin packages will be downloaded. Next, click Direct connection . Next, select the site from which the packages will swing. Then the list of packages itself appears, in which it is necessary to select the following items:
- in the Debug clause pv-debugininfo
- in the Devel clause all sub-clauses whose name begins with the letters gcc (they are consecutive)
- in paragraph Utils sub pv
- Device driver
- ADB driver
- ProgramFileZilla serveror who can not downloadmirroron version 0.9.60
First install the USB drivers for the device and ADB (if not already installed). After that, I advise you to restart the PC.
VHDtool Create a folder E: \ cygwin64 \ 000 (the name does not matter, do not just use letters other than Latin), here will be our image. Copy to this folder
Vhdtool.exefrom the archive.
Filezilla During the installation, we agree to all standard installations.
After installation, FileZilla will start automatically, but you must exit the program and run it on behalf of
Admin .
When you start FileZilla will ask the name of the server, leave everything as it is or click on the cross in the corner
Next we go
Edit - Settings and make the following settings:
listen on those ports 40
timeout settings - the default is 120, 60, 60, and we put 0 everywhere and click OK.
Go in
edit - users .
In the users window create a new user.
In my case, this is User.
qwer .
Push
Add- write the name.
Putting a tick near the Password and enter your password (especially it is better not to be driven, since this is just a formality). I entered 0000. Next, click on the Shared folders
Add a folder 000 in which our image will be later copied, for which we click on ADD and specify the path to the folder and put ticks for reading and writing
Click OK. This completes server preparation. We roll it up (hide in the tray for about hours) and continue.
AdbSwinging
archive with ADB. Unzip all the files in the folder E: \ cygwin64 \ bin and check the performance. Run the console from the folder E: \ cygwin64 \ bin, to do this, click on File ->Open command prompt ->Open command prompt as administrator.
On windows 7, just enter
cmdin the address bar explorer
Enter the command:
The list of connected devices should not be empty, if after the line
List of devices attachedis empty, then you did not install USB drivers or did not enable USB debugging. When done correctly, the console looks like this:
where digital letters is your unique number. Who made backups through TWRP saw them more than once.
USB modem modeAll further actions occur when the phone is in modem mode. disable it is not necessary until a certain point, as will be written.We will need to connect the device via USB to your PC and turn on the modem mode via USB. I use the firmware ResurrectionRemix-M-UNOFFICIAL-ROMILPARH-v5.7.4-20161005-bacon and I have this mode along the way:
Settings>Wireless network>Still…>Modem mode>USB modemOn the PC go to
Network and Sharing Center(pressing the RMB on the connection icon at the clock and selecting there, or following the path
Start->Options->Network and Internetand look, or on the button
Startpush
PKM->Control Panel->Network and Sharing Center). Click on
Change adapter settingsand on the phone turn on the USB-modem. On the appeared connection
right-click and select Status
. In the opened window, we look at our IPv4 address and remember (write) it. In my case it is: 192.168.42.178
Important!Each time the USB cable is reconnected and the mode of the IPv4 modem is turned on / off(I did not see this on win10, but it is possible on win7).
Now we determine which memory block we need.All memory in your device is divided into logical blocks, we do not need to download everything, it is enough to understand which section contains erased information. Now we need to look at the list of memory blocks, for this we enter the following commands line by line:
adb shell
su
find / dev / block / platform / -name 'mmc *' -exec fdisk -l {} \;>/sdcard/list_of_partitions.txt
p.s .: If you are too lazy to rewrite the commands manually or you are afraid to make a mistake, you can use copy / Just press RMB in the console. I wrote everything manually, as the console is buggy when inserted.
After entering the latter, the list_of_partitions.txt file will appear in the internal memory of the device, which we need to copy to the PC and study. You can copy it into our 000 folder using a simple command (it should be executed in a separate command window):
adb pull /sdcard/list_of_partitions.txt E: / cygwin64 / 000
Do not forget to write your way to the folders. My file looks something like this:
Disk /dev/block/platform/msm_sdcc.1/mmcblk0p29: 301 MB, 301972992 bytes
4 heads, 16 sectors / track, 9215 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device /dev/block/platform/msm_sdcc.1/mmcblk0p29: it does not contain a valid partition table
Disk /dev/block/platform/msm_sdcc.1/mmcblk0p28: 59.9 GB, 59914792960 bytes
4 heads, 16 sectors / track, 1828454 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device /dev/block/platform/msm_sdcc.1/mmcblk0p28: it does not contain a valid partition table
Disk /dev/block/platform/msm_sdcc.1/mmcblk0p27: 67 MB, 67108864 bytes
4 heads, 16 sectors / track, 2048 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device /dev/block/platform/msm_sdcc.1/mmcblk0p27: it does not contain a valid partition table
Disk /dev/block/platform/msm_sdcc.1/mmcblk0p26: 8 MB, 8388608 bytes
4 heads, 16 sectors / track, 256 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device /dev/block/platform/msm_sdcc.1/mmcblk0p26: it doesn’t contain a valid partition table
Disk /dev/block/platform/msm_sdcc.1/mmcblk0p25: 16 MB, 16777216 bytes
4 heads, 16 sectors / track, 512 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
etc.
In principle, the device has the same paths, but it is still worth risening. Internal memory in my 64 GB apparatus. Therefore, I'm looking for the biggest partition, in my case it is an MMCBLK0P28 size of 59.8 GB, you will most likely have the same name. Of course, no one guarantees what exactly the largest section will turn out to be in which even recently lay your photos, videos, documents, etc., but in 90% of cases it turns out exactly the memory that we need. Otherwise, you will have to copy all images in order and check each of them.
Copy the memory section on the PC.If you have already closed the cmd window, then start it again from E: / cygwin64 / bin and enter the following commands:
adb shell
su
mkfifo / cache / myfifo
ftpput -v -u qwer -p 0000 -P 40 192.168.42.178 mmcblk0p28.raw / cache / myfifo
Do not forget to make the appropriate adjustments to the code! We decipher what is written:
qwer - account name in FileZilla (you have your own if they changed it)
0000 - password from your FileZilla account (if you have changed yours)
40 - FileZilla server port
192.168.42.178 - FileZilla server address (you have your own)
mmcblk0p28.raw - copy memory block
Open the second command window and enter the commands:
adb shell
su
dd if = / dev / block / mmcblk0p28 of = / cache / myfifo
We look into the FileZilla window and see that the download of mmcblk0p28.raw to the E: \ cygwin64 \ 000 folder has begun, now you can close the cygwin windows and take a tea break (in my case, a bucket of tea).
Convert and restore Are you back? File downloaded?
Check sizes just in case
Fine! Disable modem mode.
Turn off the phone . Go to the folder E: / cygwin64 / 000 /, run the command line and enter the following command:
VhdTool.exe / convert mmcblk0p28.raw
My conversion took a couple of seconds.
At the output, we get all the same mmcblk0p28.raw file in the E: \ cygwin64 \ 000 folder, but a bit different. This converted file can be mounted as a virtual disk, or, for example, through R-studio, you can restore data directly from our image. I did that. To do this, open the program, click Open Image [1]. Choose a file type
Everything [2] and point to our file. Then everything is like when working with a regular disk.
The full version of the article can be found.
HERE