Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Q] How to restore wiped files?

OP thekkk

25th March 2014, 09:37 PM   |  #1  
OP Junior Member
Thanks Meter: 1
 
26 posts
Join Date:Joined: Apr 2012
I unlocked my HTC One Bootloader, but all my files got wiped

How can i restore files? I lost all my photos and whatsapp chat history. There must be a possibility?! But how?
25th March 2014, 10:15 PM   |  #2  
Senior Member
Thanks Meter: 59
 
339 posts
Join Date:Joined: Sep 2008
Quote:
Originally Posted by thekkk

I unlocked my HTC One Bootloader, but all my files got wiped

How can i restore files? I lost all my photos and whatsapp chat history. There must be a possibility?! But how?

I don't think you can recover. It told you this when unlocking.
25th March 2014, 10:18 PM   |  #3  
OP Junior Member
Thanks Meter: 1
 
26 posts
Join Date:Joined: Apr 2012
Quote:
Originally Posted by mb_guy

I don't think you can recover. It told you this when unlocking.

It told me that personal settings will be deleted, and i thought that only would be settings, etc...

and in the tutorial i've read there was no warning for this
25th March 2014, 11:32 PM   |  #4  
Senior Member
Thanks Meter: 26
 
111 posts
Join Date:Joined: Nov 2008
Yeah I don't think you'll get anything back easily at all. Keep that phone backed up in the future!

Sent from my HTC One using Tapatalk
25th March 2014, 11:39 PM   |  #5  
alray's Avatar
Senior Member
Flag Montreal, Quebec
Thanks Meter: 1,295
 
3,347 posts
Join Date:Joined: May 2012
Donate to Me
More
Quote:
Originally Posted by thekkk

It told me that personal settings will be deleted, and i thought that only would be settings, etc...

and in the tutorial i've read there was no warning for this

No the bootloader unlock screen says personal data (not settings) will be wiped which include the virtual sdcard (/data/media/0)



btw this also deleted stock apps like flashlight, calculator, sound trimmer, tuneIn, SoundHound etc.... which are stored in /data/preload
Last edited by alray; 25th March 2014 at 11:41 PM.
25th March 2014, 11:40 PM   |  #6  
OP Junior Member
Thanks Meter: 1
 
26 posts
Join Date:Joined: Apr 2012
Quote:
Originally Posted by bbinder

Yeah I don't think you'll get anything back easily at all. Keep that phone backed up in the future!

Sent from my HTC One using Tapatalk

It doesnt matter how difficult it is, but somehow i'm sure there must be a way, the question is how. Because every recovery software cant be used because of de MTP-mode
26th March 2014, 01:59 AM   |  #7  
Senior Member
Thanks Meter: 26
 
111 posts
Join Date:Joined: Nov 2008
Quote:
Originally Posted by thekkk

It doesnt matter how difficult it is, but somehow i'm sure there must be a way, the question is how. Because every recovery software cant be used because of de MTP-mode

Sure. I just personally think that you'll give up, given those circumstances Just being realistic...

Sent from my HTC One using Tapatalk
26th March 2014, 09:38 AM   |  #8  
Senior Member
Thanks Meter: 472
 
1,046 posts
Join Date:Joined: Jan 2012
Quote:
Originally Posted by thekkk

the question is how. Because every recovery software cant be used because of de MTP-mode

The first step is to not boot the phone until you get a dump of your data partition. Booting to a custom recovery is okay--a full Android boot is not.
In recovery (using the ADB shell), umount data and get a dump of the data partition (/dev/block/mmcblk0p37) using "dd". Since you can't write to the data partition while making its dump, you'll need to write to /system. Since /system isn't very big, you'll need to do the dump in pieces of about 350 MB each (depends on how much free space you have in /system).

The "dd" parameters you'll need are "bs" to speed things up, "skip" to tell it where to start the chunk, and "count" to determine how big the chunk is. Since /data is 25.6 GB, you'll need to do this 60-70 times, and after each chunk, use "adb pull" to copy the chunk to your computer. When you have all the chucks, reassemble them and make sure it's the same size as /dev/block/mmcblk0p37. Make sure it's a valid ext4 filesystem. Then you can start using data recovery tools.

Quote:
Originally Posted by thekkk

It doesnt matter how difficult it is, but somehow i'm sure there must be a way,

So put your money where your mouth is and do it.
The Following User Says Thank You to fenstre For This Useful Post: [ View ]
26th March 2014, 05:46 PM   |  #9  
OP Junior Member
Thanks Meter: 1
 
26 posts
Join Date:Joined: Apr 2012
Quote:
Originally Posted by fenstre

The first step is to not boot the phone until you get a dump of your data partition. Booting to a custom recovery is okay--a full Android boot is not.
In recovery (using the ADB shell), umount data and get a dump of the data partition (/dev/block/mmcblk0p37) using "dd". Since you can't write to the data partition while making its dump, you'll need to write to /system. Since /system isn't very big, you'll need to do the dump in pieces of about 350 MB each (depends on how much free space you have in /system).

The "dd" parameters you'll need are "bs" to speed things up, "skip" to tell it where to start the chunk, and "count" to determine how big the chunk is. Since /data is 25.6 GB, you'll need to do this 60-70 times, and after each chunk, use "adb pull" to copy the chunk to your computer. When you have all the chucks, reassemble them and make sure it's the same size as /dev/block/mmcblk0p37. Make sure it's a valid ext4 filesystem. Then you can start using data recovery tools.


So put your money where your mouth is and do it.

That sounds like something, first of all thanks for your input!

But how should i run this command without booting into android (I'm in clockwork-touch recovery, but doesnt seem to work)? This command works (when booted into android), i've tried it with 'dd', so i guess thats the correct way!

=> If i have to boot into android anyway to do this, i would also have an OTG plus USB-Stick (32GB), then i could do it in about 2 parts to save it directly to the usb-stick. Would that be the better aproach instead of writing it to the /system? because i don't know what action writes to the /sdcard

Just to clarify, i have to execute the following command one after the other(?) :

$ dd if=/dev/block/mmcblk0p37 bs=367001600 count=1 skip=0 of=/system/chunk1.img
adb pull /system/chunk1.img .
$ dd if=/dev/block/mmcblk0p37 bs=367001600 count=1 skip=1 of=/system/chunk2.img
adb pull /system/chunk2.img .
$ dd if=/dev/block/mmcblk0p37 bs=367001600 count=1 skip=2 of=/system/chunk3.img
adb pull /system/chunk3.img .


Do i have to make something special that i can reassemble them later or are there programms out there for that problem?
Last edited by thekkk; 26th March 2014 at 06:12 PM.
26th March 2014, 08:07 PM   |  #10  
NxNW's Avatar
Senior Member
Thanks Meter: 517
 
1,427 posts
Join Date:Joined: Apr 2011
Um, every time you boot to android you are rewriting the very flash memory you are trying to recover.

The ratio of the amount of work required vs the chances of success is not a favorable one. Unless you are trying to recover video of 'baby's first steps' or a bitcoin private key, I would let this go..

Sent from my HTC One using xda app-developers app

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes