36

I just deleted a file on my Nexus S that I really need back. (It was actually part of an app using a sqlite database that did a drop table when upgrading to a new version.)

Presumably I need to root the phone first (which I hear is easy on Nexus phones) but am I in a catch-22 here? Namely, does rooting the phone mean wiping/overwriting the partition where the data lives?

If not, what do you recommend for data recovery tools? Presumably the file was just unlinked and not actively overwritten (per usual when "deleting" a file) so technically the data must be there...

Flow
  • 18,464
  • 16
  • 79
  • 138
dreeves
  • 469
  • 1
  • 4
  • 7
  • I cannot post an answer, the system goes against me. Worse for them... The most easy way when you have Linux system and your device with TWRP recovery is. 0. First of all! Stop creating new files, close all apps. If you will need to run something, better DELETE first some needless files as much as possible to free more space and get more chances to keep your deleted files intact. Of course you will have to know what partition you need to free. High chances its the one that is mounted as /data (your local and deleted files are in /data/media or something like that). – midenok May 14 '19 at 14:37
  • In TWRP recovery copy your partition with dd to micro SD card by 4Gb pieces:
  • dd if=/dev/dm-0 of=/sdcard/x1...n bs=1048576 count=4095 skip=...
    

    Well, you have an option to mount external OTG drive (find some external power source though). But mine didn't work, so I had to put pieces to micro-SD. In skip parameter you will put: 0, 4095, 8190, 16380, etc.

    – midenok May 14 '19 at 14:39
  • Move all pieces to linux system, concatenate with cat.
  • – midenok May 14 '19 at 14:40
  • Use testdisk to recover. This is most versatile tool for extfs undelete. It allows to undel from specific directory and undeletes even broken files and works really fast (apart from heuristic scanners). So you will be sure that everything that is possible is undeleted or overwritten.
  • – midenok May 14 '19 at 14:41