Skip to main content

Guide on Data Recovery from Internal Storage of Android Phone

Submitted on 03/02/2018

Photos and videos are lost from internal memory of a phone more often than from SD Card. By far not every program can find a way around such an issue.

This, however, is not a merely a question of lost data. Android users have a limited set of tools they can use to recover data from internal storage of a phone.

Recovery method we are describing here can’t be called a simple one but it works. 

Is it hard to recover data from Android phone internal memory?

It’s not an easy thing to access internal memory of an Android device. When you connect your phone to the computer, it is opened via Media Transfer Protocol. The content of the phone storage is connected as a separate disk and is not recognized by data recovery software.

(Whilst external SD Card can be easily accessed and scanned for deleted data).

That is the main difficulty one faces when restoring files from the internal memory. Further down the text you’ll find out how to go round this obstacle.

Steps you take to recover deleted files from phone memory

These instructions are applicable to any Android phone since you can get access to the internal memory on absolutely any of them. Another component that you need is Windows 7 or 10 (or, in principle, any OS).

Here’s the algorithm for Android internal storage recovery:

  1. Make a copy of the internal memory partition (as a RAW file),
  2. Convert RAW to VHD format,
  3. Connect the virtual Hard Drive to the filesystem via Disk Management,
  4. Scan virtual hard drive using recovery soft,
  5. Restore files from the copy of internal storage.

Setting up FileZilla Server

FileZilla Server is a program for creation and management of an FTP server. Without setting up the server you are unlikely to get an image of the internal storage of Android.

1. Install FileZilla Server, leave default settings as they are.

2. Run the app as Administrator.

3. Leave the name of the server unchanged.

4. Alter FileZilla General Settings:

  • listen on those ports - 40
  • timeout settings – specify value "0" in each case

settings 01

5. In the Users section (edit – users) add a new user: click Add and type in qwer for name and pass for password.

6. In the same Users menu on the left find the tab 'Shared folders'. In it add a folder where you are going to copy the image of internal storage. Click Add and specify the address C:\cygwin64\000.

7. Choose the line C:\cygwin64\000, click Set as home dir (to get letter H on the left). Enable Read and Write options.

settings 02

Setting up ADB

To set up ADB connection between your phone and PC you need the following files:

  • adb.exe
  • AdbWinApi.dll
  • adb-windows.exe
  • AdbWinUsbApi.dll
  • fastboot.exe

They can be copied from the distribution kit Android SDK (size about 700MB) or downloaded in a portable format from our page:

Download ADB

Copy these files to the folder C:\cygwin64\bin.

Connecting your phone to your PC using ADB protocol

  1. Install USB drivers for your device (if you haven’t got them yet).
  2. Restart your PC.
  3. Enable USB debugging on your phone (for correct work of ADB).
  4. Now check if ADB works. The easiest way is via Windows (cmd). In the console type in:
adb devices

On the list of devices you should see the code and name of your tablet or phone.

Enable USB tethering

Your mobile device needs to be connected to the computer via USB protocol using tethering. For this:

  1. Go to Settings & Internet, and then Hotspot & tethering (or Settings > Mobile hotspot and Tethering - USB Tethering on Samsung Galaxy).
  2. Enable USB tethering option.
  3. On computer open the command line (cmd) and type in ipconfig. Address will appear in IPv4 line.
  4. Remember the figure: it is going to change every time you connect your phone.

how to enable USB Tethering

Looking for the partition with lost data 

Why copying the whole internal memory to the computer (its size can reach dozens of gigabytes). Copying the partition from which files were deleted is enough.

1. To get the list of partitions in the text form, perform the following sequence of commands:

adb shell

su

find /dev/block/platform/ -name 'mmc*' -exec fdisk -l {} \; > /sdcard/list_of_partitions.txt

2. Next, copy the text file list_of_partitions.txt to your computer. To do this in the new console window type in:

adb pull /sdcard/list_of_partitions.txt C:/cygwin64/000

For the moment your file with the partition list is in folder 000.

3. Figuring out the exact location of the photos, videos and other files before their deletion is not an easy task. Consider the largest partition, it is likely to be the one you’re looking for. If there is no sign of deleted files on it, examine the other internal storage partitions one by one.

Making an image of Android internal storage

1. Open a new window of the console, type in (replace this with your own data):

adb shell

su

mkfifo /cache/myfifo

ftpput -v -u qwer -p pass -P 40 192.168.42.79 mmcblk0p27.raw /cache/myfifo

Keys:

  • qwer – user name
  • pass – password
  • 40 – port number
  • 192.168.42.79 – server address
  • mmcblk0p27.raw – area of the internal storage where the files were located

2. Open another window in the console and type in:

adb shell

su

dd if=/dev/block/mmcblk0p27 of=/cache/myfifo

where mmcblk0p27 is the name of Android internal storage partition.

3. FileZilla will start copying Android internal storage to folder 000, it’s rather time-consuming (from ten minutes up to an hour).

Converting image of the memory to VHD format

VHDTool is a program that creates VHD and VHDX virtual hard drives. You need your VHD file for mounting it into the system. It enables data recovery software to see the memory image as a separate disk, which can’t be achieved by connecting your phone using basic method.

  1. Download VHDTool.
  2. Copy VHDTool.exe file to folder 000.
  3. Open console utility Cygwin.bat and type in:
cd C:/cygwin64/000/ VhdTool.exe /convert mmcblk0p27.raw

Here mmcblk0p27.raw is the name of your partition (rename it!).

In the end you get a VHD file, despite it having .raw extension.

Mounting the image of internal memory

For futher internal storage recovery you need to mount VHD as a virtual disk in Windows. How to do it:

  1. Start – Run – perform the command diskmgmt.msc. Next go to Disk Management.
  2. Menu Action > Attach VHD.
  3. As a location define [c:\cygwin\nexus\mmcblk0p12.raw] .
  4. Right-click on the name to the left from the blank space and select Initialize Disk and further – GPT.
  5. Right-click on the blank file space – New Simple Volume. 
  6. In the wizard click Next and leave default settings for size unchanged. Next, assign a letter to the drive (say, K). Next. Double-check that you didn’t activate the ‘Partition not allowed to be formatted’ option.

Critical! There will pop up a disk format window. DO NOT FORMAT disk at this stage. It is impossible to restore files after internal memory gets formatted!

1. Right-click on RAW space and select Format…

  • File system type - FAT32
  • Cluster size – by default

2. Check if the option ‘Quick format’ is enabled and click OK.

You’ll get a notification warning you that formatting this partition will remove all the data from it. Just a reminder: you selected the quick format option (double-check if so), so everything is going alright.

How to recover data from phone memory image using Recuva

  1. Open Piriform Recuva (you can download it here). In recovery Wizard click Next. Select All files and click Next. In the text box ‘In a specific location’ give the letter assigned to the mounted drive. Click Next.
  2. Tick the option 'Enable Deep Scan' – it will increase your chances to find and recover deleted data from phone memory.
  3. Press on 'Start' to scan the disk. Recuva works slowly in Deep Scan mode, and the whole thing can take about an hour.
  4. After Recuva displays scan results, select files to recover. Press on 'Recover' and specify the location you want to save selected data from the internal storage of your phone.

Didn’t manage to restore files? Send us a question

Describe your issue using our feedback form. Give us details on where the files were deleted from, when and how, and we will try to give you an answer. Besides, your question will clarify and make more complete questions by other users, which is of great help for us in making our recovery guides more helpful.

Ask the question