Mount or access empty space in phone storage? - HTC One Mini

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.

Related

[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.

[GUIDE] Photo Recovery from Internal Memory

Hey guys, I've found a way to recover files from the INTERNAL Memory of the Samsung Galaxy S4.
A lot of people have said that it's not possible, but I'm here to prove them wrong.
You have to have rooted your phone before carrying out these steps. Don't post here asking for help rooting, there's plenty of other threads that can help you with that.
I hold zero liability in the event that you make a nice brick out of your phone. If you do not feel comfortable working with these commands, then please don't follow them.
You're going to need an SD Card that's at least the size of the internal memory on the phone. A smaller one would work, but keep in mind not all the files are going to be recovered.
If the SD Card is brand spanking new, you can skip step number 1.
Format the SDCard with a layer of 0's. This is done so that none of the old data will interfere with your recovery. This step is optional.
Root the Device
Install Terminal Emulator
Insert the SDCard
In Terminal Emulator run the command to gain super user privileges
Code:
su
Grant Terminal Emulator super user privileges
Run this command,
Code:
dd if=/dev/block/mmcblk0p29 of=/storage/extSdCard/raw.dd
Wait. Leave your phone plugged into an AC Adapter, and go grab a can of pop. This command will take a looong time. Couple hours to a day.
Once the command is finished running, shutdown your phone.
Remove the SDCard, and connect it to a computer
Download TestDisk
Open PhotoRec
Select the SDCard and press enter
Use the first option of "Unknown"
Then press "Other"
Select the Directory to backup the files to
Profit
'
How it works:
By dd'ing the internal memory to a file on the SDCard, you're doing a raw copy of the data.
Once the data is copied onto the SDCard, PhotoRec will scan the SDCard for deleted data, doing so will scan the raw file for photos. Not just photos, all files can be recovered using this method.
This method works on all rootable phones, provided you can figure out where the dev block for the internal memory is.
Hope you guys get your files recovered. I know I did
Or just install a file recovery app from play store on a rooted phone and follow app instructions...
Worked a charm for me. lol
jamieridler said:
Or just install a file recovery app from play store on a rooted phone and follow app instructions...
Worked a charm for me. lol
Click to expand...
Click to collapse
Any app you recommend in particular?
Bingley said:
Any app you recommend in particular?
Click to expand...
Click to collapse
Tbh I just downloaded the first app I came across that was free and had half decent reviews, can't remember what one, it was a little while ago, but there are loads of them in the store.
jamieridler said:
Or just install a file recovery app from play store on a rooted phone and follow app instructions...
Worked a charm for me. lol
Click to expand...
Click to collapse
A lot of those apps are for the external SD Card, only support the FAT filesystem, and not as robust as PhotoRec from TestDisk.
Newer devices(Such as the S4) have an ext3 filesystem I believe, and a few paid apps claim to offer support for it.
... Not to mention TestDisk is Open Source :angel:
zzarzzur said:
A lot of those apps are for the external SD Card, only support the FAT filesystem, and not as robust as PhotoRec from TestDisk.
Newer devices(Such as the S4) have an ext3 filesystem I believe, and a few paid apps claim to offer support for it.
... Not to mention TestDisk is Open Source :angel:
Click to expand...
Click to collapse
Although some might well be limited to FAT filesystem, some are not, its up to the user to check before downloading and installing. After that rather simple search and install, I managed to recover every img file on my phone, current and deleted, and back it all up to external memory, all with a free app, which offers img file recovery for free and any other file type of your choice for a small, one off, cost, if you needed it. I recovered almost 1gb of img files in under 10 minutes.
Am I correct in assuming your method copies the entire contents of the internal memory, or a portion of it, to an SD card before starting the search for deleted files? I'm just an amateur with little knowledge trying to figure out how your method works. Sorry don't mean to bash your method of doing it either, just commenting on this as your post suggest no one has ever been able to do this before and your method is the one and only way it can be done.
But if the device is factory reset, will you be able to get files? If i sell my device i don't want anyone sneaking on my photos.
problems
zzarzzur said:
Hey guys, I've found a way to recover files from the INTERNAL Memory of the Samsung Galaxy S4.
A lot of people have said that it's not possible, but I'm here to prove them wrong.
You have to have rooted your phone before carrying out these steps. Don't post here asking for help rooting, there's plenty of other threads that can help you with that.
I hold zero liability in the event that you make a nice brick out of your phone. If you do not feel comfortable working with these commands, then please don't follow them.
You're going to need an SD Card that's at least the size of the internal memory on the phone. A smaller one would work, but keep in mind not all the files are going to be recovered.
If the SD Card is brand spanking new, you can skip step number 1.
Format the SDCard with a layer of 0's. This is done so that none of the old data will interfere with your recovery. This step is optional.
Root the Device
Install Terminal Emulator
Insert the SDCard
In Terminal Emulator run the command to gain super user privileges
Code:
su
Grant Terminal Emulator super user privileges
Run this command,
Code:
dd if=/dev/block/mmcblk0p29 of=/storage/extSdCard/raw.dd
Wait. Leave your phone plugged into an AC Adapter, and go grab a can of pop. This command will take a looong time. Couple hours to a day.
Once the command is finished running, shutdown your phone.
Remove the SDCard, and connect it to a computer
Download TestDisk
Open PhotoRec
Select the SDCard and press enter
Use the first option of "Unknown"
Then press "Other"
Select the Directory to backup the files to
Profit
'
How it works:
By dd'ing the internal memory to a file on the SDCard, you're doing a raw copy of the data.
Once the data is copied onto the SDCard, PhotoRec will scan the SDCard for deleted data, doing so will scan the raw file for photos. Not just photos, all files can be recovered using this method.
This method works on all rootable phones, provided you can figure out where the dev block for the internal memory is.
Hope you guys get your files recovered. I know I did
Click to expand...
Click to collapse
So i've followed your guidelines to a 'T' with a brand new 64g (huge, i know) Sd card, but the command line responds with, "writer error: file to large". Any advice as to how to proceed?
Really appreciate your efforts on this issue, btw!

[Q] Internal Storage called by multiple names

Here's the problem. I see Internal Storage as 64Gig called "Internal storage" in Windows 7 of course after the system uses some I have lass but it's the naming I have trouble with. Maybe you Unix guys can help me out here. On Windows 7 64 I see A001/Internal storage/ then all the useable directories. Now what happened was I was trying to take a screen shot to send to a guy and I checked my GalleryKK to look for the pictures. While plugged in to the USB port no pictures showed up in the directory allocated for ScreenshotER. ScreenshotER was set to write the pictures in Sdcard/ScreenshotER directory. Well there is no directory called Sdcard in the Internal storage on windows or the phone or in Root Explorer. So where did it write the pictures? Then I go into Root Explorer to look for the pictures and I see another name being used for Sdcard called "/storage/emulated/0/ScreenshotER" there are my pictures I just took. In Windows 7 Internal storage/ScreenshotER shows no pictures??????? So, I unplug the USB and reboot the phone and go to GalleryKK and there are my pictures. So then I go back to Windows 7 and plug in the USB and Internal storage shows the pictures. Then I go to Outlook 2010 and try to do an insert from Internal storage/ScreenshotER and no pictures. Huhhhh! So then I go back to Windows explorer and copy the pictures from Internal storage/ScreenshotER/wdfffrr.jpg to my hard drive, then back to outlook and insert file and they insert fine so I can send the email. That is just too hard for handling pictures. Can't the names in the different APPs call it the same name so this is not so confusing and what is ADB doing to not update the pictures right away? Is there a ADB just for the One? I used the AndroidSDKSlim to root and load TWRP. I also installed the Microsoft MTP drivers.
Thanks in advance.
bmaz121 said:
Here's the problem. I see Internal Storage as 64Gig called "Internal storage" in Windows 7 of course after the system uses some I have lass but it's the naming I have trouble with. Maybe you Unix guys can help me out here. On Windows 7 64 I see A001/Internal storage/ then all the useable directories. Now what happened was I was trying to take a screen shot to send to a guy and I checked my GalleryKK to look for the pictures. While plugged in to the USB port no pictures showed up in the directory allocated for ScreenshotER. ScreenshotER was set to write the pictures in Sdcard/ScreenshotER directory. Well there is no directory called Sdcard in the Internal storage on windows or the phone or in Root Explorer. So where did it write the pictures? Then I go into Root Explorer to look for the pictures and I see another name being used for Sdcard called "/storage/emulated/0/ScreenshotER" there are my pictures I just took. In Windows 7 Internal storage/ScreenshotER shows no pictures??????? So, I unplug the USB and reboot the phone and go to GalleryKK and there are my pictures. So then I go back to Windows 7 and plug in the USB and Internal storage shows the pictures. Then I go to Outlook 2010 and try to do an insert from Internal storage/ScreenshotER and no pictures. Huhhhh! So then I go back to Windows explorer and copy the pictures from Internal storage/ScreenshotER/wdfffrr.jpg to my hard drive, then back to outlook and insert file and they insert fine so I can send the email. That is just too hard for handling pictures. Can't the names in the different APPs call it the same name so this is not so confusing and what is ADB doing to not update the pictures right away? Is there a ADB just for the One? I used the AndroidSDKSlim to root and load TWRP. I also installed the Microsoft MTP drivers.
Thanks in advance.
Click to expand...
Click to collapse
"Is there a ADB just for the One?" I don't understand this question. Also, /sdcard is a shortcut for /storage/emulated/0/. Try going into adb shell and doing a manual search with cd and ls commands. Then exit the shell and do an adb pull to retrive your pictures.
skyguy126 said:
"Is there a ADB just for the One?" I don't understand this question. Also, /sdcard is a shortcut for /storage/emulated/0/. Try going into adb shell and doing a manual search with cd and ls commands. Then exit the shell and do an adb pull to retrive your pictures.
Click to expand...
Click to collapse
He's asking if there's a version of adb/fastboot that is built specifically for this phone, and the answer to that is no.
Transmitted via Bacon

[Q] Recovering Data from HTC One M7 after factory reset

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!!!!

Mounting a supposedly corrupted adopted-SD with TWRP?

Hi all. Apologies for the wall of text, I have a few questions following all of the background below.
Device info: Samsung Galaxy S7 32GB running LineageOS 16.0, NOT rooted; SD Card in question is a 128GB Sandisk MicroSD. All commands being run on computer running Ubuntu 19.10.
Yesterday, my phone gave me the "SD Card Missing" notification suddenly, and in the settings it said it was corrupted. I had had it set up as adopted storage, so it isn't a matter of just losing photos and such unfortunately - it seems as though there's important app and system data on it.
After trying several recovery programs to no avail, I came across this thread:
https://forum.xda-developers.com/general/help/corrupted-sd-card-adoptable-storage-t3801250
Which is very similar to my situation. Unfortunately I didn't find a fix here, but I did manage to make a full .img copy of the card itself, and find the encryption key at "/data/misc/vold/expand_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.key" as per https://nelenkov.blogspot.com/2015/06/decrypting-android-m-adopted-storage.html . The problem I ran into with this guide was that I couldn't get the dmsetup command to work. However, when reading the comments of the post to see if anyone else had the problem, I saw someone mention retrieving the files through TWRP. So, I put the card back in the phone, and booted into TWRP.
In TWRP, I was able to browse through the SD Card perfectly normally with the file manager, despite the fact that it still read as corrupted when booting back into the system. So, I used adb pull (side question on this later) to retrieve the folders I was most worried about - largely what I could find of app data, my photos and videos, etc. I did not just pull the whole card at once, and I'll elaborate on why when I get to the side question about adb pull.
So, here are my questions:
1. Is it possible to mount this SD Card back to normal through TWRP? If so, how? I'd like just enough so that I can restore my apps as is onto the phone, and then convert the card to portable storage to avoid this mess again. While I do have the data pulled, it's little things like NewPipe playlists that I've got in mind here.
2. If above is not possible, how much loss am I looking at if I choose to 'forget' the adopted card? Will I have to do a factory reset?
3. (adb) When doing the adb pull, it was unable to skip any files it couldn't copy - i.e. corrupted images - and would simply stop on finding one. This means that, for example, in one folder it hit a corrupted file after 3400 successes, and stopped without copying the remaining 300. Naturally, if I had just done 'adb pull /external_sd/', then I probably would have lost a lot more because of this. Can I add any options to the command adb pull to circumvent this? I was unable to find any decent documentation on the command, but maybe I was searching for the wrong thing.
Any and all help is much appreciated, thanks in advance!
johnfr92 said:
Hi all. Apologies for the wall of text, I have a few questions following all of the background below.
Device info: Samsung Galaxy S7 32GB running LineageOS 16.0, NOT rooted; SD Card in question is a 128GB Sandisk MicroSD. All commands being run on computer running Ubuntu 19.10.
Yesterday, my phone gave me the "SD Card Missing" notification suddenly, and in the settings it said it was corrupted. I had had it set up as adopted storage, so it isn't a matter of just losing photos and such unfortunately - it seems as though there's important app and system data on it.
After trying several recovery programs to no avail, I came across this thread:
https://forum.xda-developers.com/general/help/corrupted-sd-card-adoptable-storage-t3801250
Which is very similar to my situation. Unfortunately I didn't find a fix here, but I did manage to make a full .img copy of the card itself, and find the encryption key at "/data/misc/vold/expand_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.key" as per https://nelenkov.blogspot.com/2015/06/decrypting-android-m-adopted-storage.html . The problem I ran into with this guide was that I couldn't get the dmsetup command to work. However, when reading the comments of the post to see if anyone else had the problem, I saw someone mention retrieving the files through TWRP. So, I put the card back in the phone, and booted into TWRP.
In TWRP, I was able to browse through the SD Card perfectly normally with the file manager, despite the fact that it still read as corrupted when booting back into the system. So, I used adb pull (side question on this later) to retrieve the folders I was most worried about - largely what I could find of app data, my photos and videos, etc. I did not just pull the whole card at once, and I'll elaborate on why when I get to the side question about adb pull.
So, here are my questions:
1. Is it possible to mount this SD Card back to normal through TWRP? If so, how? I'd like just enough so that I can restore my apps as is onto the phone, and then convert the card to portable storage to avoid this mess again. While I do have the data pulled, it's little things like NewPipe playlists that I've got in mind here.
2. If above is not possible, how much loss am I looking at if I choose to 'forget' the adopted card? Will I have to do a factory reset?
3. (adb) When doing the adb pull, it was unable to skip any files it couldn't copy - i.e. corrupted images - and would simply stop on finding one. This means that, for example, in one folder it hit a corrupted file after 3400 successes, and stopped without copying the remaining 300. Naturally, if I had just done 'adb pull /external_sd/', then I probably would have lost a lot more because of this. Can I add any options to the command adb pull to circumvent this? I was unable to find any decent documentation on the command, but maybe I was searching for the wrong thing.
Any and all help is much appreciated, thanks in advance!
Click to expand...
Click to collapse
Hey...did u get dmsetup to work?

Categories

Resources