TeamWin / android_bootable_recovery

1.33k stars 415 forks source link

[question] Is it possible to backup ALL data partition in raw? (using dd instead of copy files) #221

Open jcbastosportela opened 2 years ago

jcbastosportela commented 2 years ago

Device codename: sagit TWRP version: 3.6.0_9-0

The question:

can I backup the whole data partition (/dev/block/sda17) from xiaomi mi6 (sagit) as if I have made a dd, but get the data unencrypted?

Background story:

. I screwed up big time. I have accidentally factory reset my phone and lost all my pictures so I am trying to find ways to recover something. . I am avoiding installing new applications as much as possible, trying to minimize overwriting the memory that is now freed, but that might contain my photos. . My phone was running stock rom from Xiaomi in its most up to date version. . I don't know if it is relevant, but the pattern for blocking the device is the same that I set currently after the accident

What have I tried:

  1. my first attempt was very similar to what is described here: https://forum.xda-developers.com/t/guide-internal-memory-data-recovery-yes-we-can.1994705/ I did succeed getting the full image of /dev/block/sda17 into my machine, however running photorec on it yields nothing. So I cam to the realization that the information there can only be encrypted.
  2. I then thought that running photorec from within the device itself would be able to access the decrypted memory; so I installed tmux and on tmux I have installed tsu and testdisk (with photorec); after running photorec on the partition I get exactly the same result as running it on the image I dumped to my laptop: NOTHING
  3. When I was quitting on recovering the data and going ahead with formatting the phone I noticed that TWRP could access the data partition decrypting, so I tried to investigate if I could make use of it, but I couldn't go far, so here I am asking for help.

I would really appreciate some tips, or the honesty of telling me that it is really impossible. But until I recover some of my photos OR I become certain that it is impossible to recover a thing I won't be able to let go.

Regards

Beanow commented 2 years ago

Short answer: Those files won't be recoverable.

The problem isn't that you can't access the encrypted data. It's that you can't access the encryption key that was used for it. As those will be wiped when you "factory reset".

It wouldn't be encrypted very well, if you can recover unencrypted data without the key :shrug:

Sorry for your DCIM