Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,266 Members 40,261 Now Online
XDA Developers Android and Mobile Development Forum

[Q] How to restore wiped files?

Tip us?
 
thekkk
Old
#1  
Junior Member - OP
Thanks Meter 1
Posts: 25
Join Date: Apr 2012
Unhappy [Q] How to restore wiped files?

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?
 
mb_guy
Old
#2  
Senior Member
Thanks Meter 59
Posts: 334
Join Date: Sep 2008
Quote:
Originally Posted by thekkk View Post
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.
Phone: HTC One- Rogers unlocked
Rom: 4.4.2 Stock Sense 6
Stock Kernel

Old Phone: HTC Sensation, HD2, Tilt
Rom: ARHD
kernel: stock
 
thekkk
Old
#3  
Junior Member - OP
Thanks Meter 1
Posts: 25
Join Date: Apr 2012
Quote:
Originally Posted by mb_guy View Post
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
 
bbinder
Old
#4  
Member
Thanks Meter 22
Posts: 94
Join Date: 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
 
alray
Old
(Last edited by alray; 25th March 2014 at 10:41 PM.)
#5  
alray's Avatar
Senior Member
Thanks Meter 920
Posts: 2,383
Join Date: May 2012
Location: Montreal

 
DONATE TO ME
Quote:
Originally Posted by thekkk View Post
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
If I've helped you, please hit the ''tanks'' button
If you want a reply, quote or mention me using @alray

Useful links for the HTC One:
nkk71's SuperGUIDE to returning 100% back to stock
Flashing requirements chart by nkk71
HTC1Guru.com by crushalot
 
thekkk
Old
#6  
Junior Member - OP
Thanks Meter 1
Posts: 25
Join Date: Apr 2012
Quote:
Originally Posted by bbinder View Post
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
 
bbinder
Old
#7  
Member
Thanks Meter 22
Posts: 94
Join Date: Nov 2008
Quote:
Originally Posted by thekkk View Post
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
 
fenstre
Old
#8  
Senior Member
Thanks Meter 469
Posts: 1,039
Join Date: Jan 2012
Quote:
Originally Posted by thekkk View Post
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 View Post
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.
If I helped, click Thanks!
The Following User Says Thank You to fenstre For This Useful Post: [ Click to Expand ]
 
thekkk
Old
(Last edited by thekkk; 26th March 2014 at 05:12 PM.)
#9  
Junior Member - OP
Thanks Meter 1
Posts: 25
Join Date: Apr 2012
Quote:
Originally Posted by fenstre View Post
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?
 
NxNW
Old
#10  
NxNW's Avatar
Senior Member
Thanks Meter 517
Posts: 1,427
Join Date: 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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes