[Q] Recovering Data from HTC One M7 after factory reset - General Questions and Answers

Hello Everyone,
I've been trying for more than a week now to recover data (photos, contacts, messages) from my HTC One M7 after I accidentally hit the factory reset button (was in a hurry to play squash and was fumbling around till the disaster happened!) :crying: Worse of all, I have no backups :crying::crying: My phone has no SD card, only the internal memory. It runs on Android 5.0.2 and has been rooted. I have busybox and TWRP installed on the phone. I have Android SDK and cygwin on my PC.
Initially, I tried to mount the phone's internal memory as a drive on Windows so I can do a scan of it using a data recovery tool. But I wasn't successful as MTP seems like the only option and there's no way to diable it. Even the disable MTP option inside TWRP doesn't make the drive accessible via USB! I have tried various recovery software available online but none of them can see my phone thanks to the stupid MTP!
Finally, I tried the steps on this thread precisely
http://forum.xda-developers.com/gal...de-internal-memory-data-recovery-yes-t1994705
Have managed to copy the whole memory block of the phone using
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
and created a mmcblk0.raw file which I can open using Disk Internals (Linux Reader). I found only the data that currently exists on the drive after the factory reset. Tried to access the image with TestDisk (as shown here - http://www.df.lth.se/~jokke/androidfilerecovery/) and I cannot see any of my old files there too! (I'm trying the Deeper Search Option now)
I'm not sure if 'dd' command copies the disk sector-by-sector. I think any data recovery software can scan the disk image and find the old files as long as I can create a sector-by-sector image of the phone's internal drive. If not, any way to mount the internal drive as a USB drive on Windows could work too! Can anyone please help me with this?
Many thanks in advance!!!!

Related

Can't access SD card, halp!

Hi everyone, looking for a little guidance.
Phone: Android G1 (Rogers Canada Dream) running Cyanogen 4.2.15.1, been running fine since 4.2.6.1
Removed SD card while it was on and it rebooted... when it restarted it showed no applications and said the SD card was inaccessible and required a format. After rebooting a few times with no success I bit the bullet and formatted it... all apps are gone except for the ones that are on that image for Cyanogen. I have no market app to download new apps and when I plug it into my PC and mount it I don't see it show up as a drive like it did so I have no way to get the apps back on.
Has anyone had this happen before? Phone still works but I need to get it back to a state where I can get access to the SD and install the market... Any suggestions appreciated!!
There is a thread on the HERO section of Modaco site called "no adb, no sd". I think the 1st post on the last page MIGHT help. There are adb commands you can run to see if the phone has randomly stopped accessing the SD. Worth a shot.
PM me if you have trouble finding the thread n I'll have a look when I'm at my laptop.
Sent from my HTC Hero using XDA App
I misunderstood I think.
So it is now showing an sd present? Have you tried formatting in a pc?
Tried reboot without the sd in, then insert once fully booted again?
Sent from my HTC Hero using XDA App
I remove the SD Card, formatted it in my PC put it back in the phone and I can store pics and vids on it and access them but cant see or access it from the PC when in the phone. I also have no file browser so I cant install any apps or even access the market icon is gone).
D RoiD said:
Hi there! I had posted on the forum with the G1 issue where my SD card seemed to have died.
http://forum.xda-developers.com/showthread.php?t=738105
I have since removed the SD card and reformatted it, I can store pics and vids and replay them so the card is fine. I tried letting it boot up then adding the SD card when booted, that caused it to reboot, same issue...
Not having access to the card, I cant install any apps or browse the SD to install from there... really sucks
I'd be willing to blow it away and restart too and install CyanogenMod-5.0.8 but I need some guidance.
Click to expand...
Click to collapse
I got your message pal....
Ok,.... So pictures and videos taken with your phone camera DO save to your SD?.... and you CAN access them on your phone OR if you put your SD into your PC/Lappy?... But not when trying to "mount SD"?
Or have I got that completely wrong?.... Did you put pics&vids onto it through your PC, and thats the only access you get to it?
ddotpatel said:
I got your message pal....
Ok,.... So pictures and videos taken with your phone camera DO save to your SD?.... and you CAN access them on your phone OR if you put your SD into your PC/Lappy?... But not when trying to "mount SD"?
Or have I got that completely wrong?.... Did you put pics&vids onto it through your PC, and thats the only access you get to it?
Click to expand...
Click to collapse
Pics taken DO save to me SD. I Can access them from a PC is I remove the SD and put it in the PC. Not when I plug the phone in via USB then tell it to mount.
I just did a low level format, same issue.
UPDATE: Just tried the Android System Recovery and Toggle USB-MS and it shows on my laptop now! Going to try the recovery backup now.
aha,... so its just a mounting issue, not that the hardware has turned itself off.
Once when using an older ROM (maybe Villain 10?) we had this same issue, not able to mount SD,... going into Settings --> Connect to PC --> and turning off Notify/ask me solved the problem.
I just partitionned it using:
parted /dev/block/mmcblk0
print (to verfiy we know what size card we are dealing with, the details should be straight forward)
rm 1
rm 2
mkpartfs primary fat32 0 7500
mkpartfs primary ext2 7500 7948
quit
upgrade_fs
reboot recovery
Then put CyanogenMod-5 For Dream/Magic on the SD and renamed it update.zip
I'm in Android System recovery now and just did a nandroid backup.
I should be able to WIPE then FLASH UPDATE IMAGE right?
D RoiD said:
I just partitionned it using:
parted /dev/block/mmcblk0
print (to verfiy we know what size card we are dealing with, the details should be straight forward)
rm 1
rm 2
mkpartfs primary fat32 0 7500
mkpartfs primary ext2 7500 7948
quit
upgrade_fs
reboot recovery
Then put CyanogenMod-5 For Dream/Magic on the SD and renamed it update.zip
I'm in Android System recovery now and just did a nandroid backup.
I should be able to WIPE then FLASH UPDATE IMAGE right?
Click to expand...
Click to collapse
Yes, if you have the ROM image on the SD Card (FAT32 partition), you can go flash the image.
akapoor said:
Yes, if you have the ROM image on the SD Card (FAT32 partition), you can go flash the image.
Click to expand...
Click to collapse
Stupid question but when I wipe will it delete my contacts as well?
I assume yes but...
D RoiD said:
Stupid question but when I wipe will it delete my contacts as well?
I assume yes but...
Click to expand...
Click to collapse
If your contacts are saved in the phone's memory, then yes. Any settings, apps, configurations that are stored on the phone will all be gone.
A wipe pretty much gives you the factory settings. (As if you just bought the phone) So you'll have to re-signin into your Google Account and let the Contacts Sync, etc..
EDIT: Depending on what you are flashing (flashing and wiping are two different things), you may not even need to wipe.
Hmmm I tried flash update image and got:
E: Cant open /sdcard/update.zip (No such file or directory)
When I mount it in system recovery I see the LOST.DIR and update.zip
D RoiD said:
Hmmm I tried flash update image and got:
E: Cant open /sdcard/update.zip (No such file or directory)
When I mount it in system recovery I see the LOST.DIR and update.zip
Click to expand...
Click to collapse
Try this:
-Confirm the Image-
1) Make sure you have the full image you are going to flash. (Compare MD5 Hashes and/or just redownload the image)
2) Make sure the image you are flashing is the in the ROOT directory of your SDCard. In other words, it shouldn't be in any folder.
-Flash the Image-
1) When in Recovery, choose to flash an image.
2) Depending on what recovery you have, you may have to select/find the Image you want to flash.
3) Flash the image
-Wipe (Depends)-
1) If you are coming from a different ROM base (ie anything -> cyan), you'll want to wipe.
2) After the phone successfully flashes the image, wipe the phone.
Reboot.
Let me know how it goes.
I pulled the new image from: Latest version: 5.0.8-DS - 06/19/2010
Download: http://cyanogen-upda...8-DS-signed.zip
but it says no such file or DIR... weird...
The only partition I can see on my PC to put it on is the main partition...
I just downloaded the file and renamed it update.zip
D RoiD said:
I pulled the new image from: Latest version: 5.0.8-DS - 06/19/2010
Download: http://cyanogen-upda...8-DS-signed.zip
but it says no such file or DIR... weird...
The only partition I can see on my PC to put it on is the main partition...
I just downloaded the file and renamed it update.zip
Click to expand...
Click to collapse
I just realized the main reason that you posted this topic. From what I am assuming, either:
a) Your SD Card reader is dead
b) The software isn't recognizing the SD Card reader.
Best bet at this point is to setup ADB (ADB For Dummies) and flash the image from your computer. It can get a slight bit complicated, but just slowly go through each step for installing ADB.
Once ADB is set up, you can flash the image from the computer.
akapoor said:
I just realized the main reason that you posted this topic. From what I am assuming, either:
a) Your SD Card reader is dead
b) The software isn't recognizing the SD Card reader.
Best bet at this point is to setup ADB (ADB For Dummies) and flash the image from your computer. It can get a slight bit complicated, but just slowly go through each step for installing ADB.
Once ADB is set up, you can flash the image from the computer.
Click to expand...
Click to collapse
The SD card reader in my phone? It has to work if I can read an write to it ( tested photos and videos) and in recovery I was able to make a backup.
If its the software I need to flash it then right? ADB does make me nervous as I only used it once... I just tried using the terminal emulator on the phone to flash a recovery image I had made while back:
cd /sdcard
flash_image recovery /sdcard/recovery-backup.img
and got the message "error writing recovery: Permission denied"
D RoiD said:
If its the software I need to flash it then right? ADB does make me nervous as I only used it once... I just tried using the terminal emulator on the phone to flash a recovery image I had made while back:
cd /sdcard
flash_image recovery /sdcard/recovery-backup.img
and got the message "error writing recovery: Permission denied"
Click to expand...
Click to collapse
If you can view the pictures that you saved on the SD card from the phone, then both the software and hardware are functioning correctly.
Regarding the permission denied:
1) What happens if you "su - " in terminal?
2) First try one(1) ^ and then try to reinstate the permissions. (In recovery, go to console and type : fix_permissions)
Not sure otherwise.
akapoor said:
If you can view the pictures that you saved on the SD card from the phone, then both the software and hardware are functioning correctly.
Regarding the permission denied:
1) What happens if you "su - " in terminal?
2) First try one(1) ^ and then try to reinstate the permissions. (In recovery, go to console and type : fix_permissions)
Not sure otherwise.
Click to expand...
Click to collapse
Ok I did a wipe and now I see the SD when mounted on the PC with the phone on.
I have my market icon back so I can reinstall my crap.
I'll leave it as is for a bit but appreciate everyones input!!!

[Q] i9000 - internal sdcard gone - problems with boot / external sdcard mounting

Hi,
I have an i9000 and unfortunately, the internal sdcard is not recognised at all.
I can only boot using voodoo 500hz kernel, to bypass this problem.
All other kernels will fail at boot screen (reboot loop).
After booting with voodoo kernel, I've rooted the phone and connected through ssh to it (adb shell)
Listing devices in /dev/block showing nothing like mmcblk (/dev/block/mmcblk0)
I thought it must be the card itself or the controller so I went and bought an external sd card (8gb).
After I insert it, the phone shows it has 0 (zero) capacity , tried to format it to fat32, ext2, etc, both on device (parted) and computer (windows, linux). Not a chance. Tested it using a i9100 I also own and the card was recognised correctly.
Next step was to check if the controller still works so again adb shell and checked for a mmcblk device in /dev/block.
This time, a /dev/block/mmcblk0 and /dev/block/mmcblk0p1 / /dev/block/mmcblk0p2 were listed.
Removed the external card, no device at all so the internal sd card is gone for good.
Next step was to use a hack to swap the internal/external sd cards in (/etc/vold.fstab), but even it is recognized in recovery mode (I can factory format/ wipe data), still 0 size in android interface and I can't use Camera and other apps.
I tried to mount it manually, directly on phone (adb shell), with mount comand and it works! I can create files on it, which are persistent.
So the controller actually works and the card is recognised low level.
BUT, why Android interface (java layer) won't recognize it? It says it's there but size is 0.
Please help, I can't use a lot of features on the phone, I don't know what to do.
Tried to mount it manually (to /mnt/sdcard), and even it get mounted and everything works on shell (creating files, etc), still 0 size in Android.
Running df in shell shows the correct size.
Checked the fstab / vold.fstab / vold.conf , everything seems to be ok.
Can anyone help me to fix this issue? Or at least, to give me some clues / ideas? I've lost several nights and I can't find a fix.
I'm good at linux but don't know very much about Android and it's java layer over linux.
It happenned to me too... not sure it can help you, but this is how i fixed my problem:
1. connect i9000 to the pc thru usb.
2. found a filename "no media" in the root directory.
3. erase the "no media' filename and everything is back to normal.
Did you fix it? I have the same problem and can't find a solution yet

[Q] Backup phone without screen. adb backup?

Hi,
My friend has a Sensation with a broken LCD. His contacts are stored on the internal memory and not synced to google. While they are his main concern, I'd also like to get a backup of other data if possible.
The phone is not rooted, S-ON etc. and USB debugging is not on. It's pretty much stock.
I am able to get into fastboot, but that is about it.
Running through a few options, I managed to adb into my (rooted, with USB debugging) DHD and pull the contacts2.db file. I'm thinking backup over adb is going to be my best bet, but I'm not sure how to connect to the Sensation.
Is it possible to turn USB debugging on without access to the screen? Is there another way I can adb into the phone? Or perhaps another way I could access the internal memory?
Cheers
If I can get an adb connection, can I temproot, tar the app data and then transfer it to the SD/pull it over adb?
I've read that adb can be accessed through recovery, does this apply to the stock recovery? I've tried accessing it, but I'm still unable to make a connection.
I think I could flash another recovery without use of the screen, but getting S-OFF first could be a whole other issue.
Can anyone offer some advice?
It's unfortunate that this went unanswered, because now I have the exact same problem on my wife's phone. All stock - just want to be able to grab contacts and sms/mms data if possible. Other backups would be great.
if usb debugging is enabled and adb is working then backing up some data is possible
you need to have a sdcard in phone too...with atleast 1.5 GB of space
adb devices (check whether devices got connected or not)
adb shell
mkdir /sdcard/tmp_data
cp -rf /data/* /sdcard/tmp_data/
the above commands might probably copy the stuff from /data partition to /sdcard/tmp_data
the data partition has all data ..contacts ,call logs, sms logs, even user apps and its data

[Q] Data recovery from internal memory of atrix 2

Hi, I accidently master reset my atrix 2 and want to recover SMS from my device memory
I have done the following
- rooted my phone and activated CWM recovery but I am not able to access the internal memory as USB device so I can run any recovery program
- I tried to access the mmssms.db file in /data/data/com.android.providers.telephony/databases/mmssms.db through command prompt but the file is only 42KB, which means a blank file is created.
Is there a way I can access the internal memory as USB device?
or
are there any SU or ADB commands by which I can restore mmssms.db to an older date?
or
Any linux commands i can run to read the data on physical blocks (assuming some blocks of memory will still have some data even if the file is overwritten or the new .db file is not necessarily at the same physical location)
Any Linux developers out there who can help me with any commands to try?
As flash memory is actually erased, not just marked as no longer in use (like magnetic media) there may be no way to get you data back. However this is not ALWAYS the case, but I think it would be pretty difficult.
You may be able to dd the partition where your data was to a file on the sd card and then try to recover data from that once you transfer it to your pc.

Mount or access empty space in phone storage?

Hello,
A few nights ago I wiped and rooted my HTC One and didn't realise that some photos and videos were saved onto my internal storage. What I need is raw disk access to be able to scan the unused / empty space on the internal phone storage. Is there any way to do this?
So far I have tried or thought sshfs, ftp, and dd. Apparently sshfs doesn't access the unused space so this wouldn't work. Even if it did, it fails to mount. FTP is file transfer and so is similar. dd would use SSH:
Code:
ssh [email protected] "dd if=/storage/emulated/0 -1 -" | dd of=~/android.img
and wouldn't work for the same reasons as above.
The recovery software I plan to use is PhotoRec. And since the phone uses MTP to connect to the computer, it is not listed as a device that PhotoRec can access, see attached photo.
Thanks again for all your time, if possible, I am open to new suggestions to how I could recover my data. The photos are of sentimental value to me, so all help is hugely appreciated.
Many thanks.
Bump. Still have not found a resolution to this. Thanks.

Categories

Resources