yashsingh1/xdaforums huggingface dataset:
[Samsung Galaxy Nexus] optimusfan:
He. I've been reading through this thread, trying to fix a problem with my wife's phone. I was in the process of rooting it last night to install link2sd to resolve the low internal memory issues she's been having with it and inadvertently wiped the internal memory in the process. Whoops. Turns out she's been storing the journal containing my daughters milestones (talking, walking, etc) on it, and I'd like to get it back.

At any rate, here's where I am. She's running a Sprint HTC Evo 4G. It's been rooted and is running Busybox. I already had Cygwin installed on my computer and added some the required extensions. The partition I'm trying to pull doesn't seem to match the example, but I believe it may be mmcblk0 or mmcblk0p1:

cat /proc/partitions

major minor #blocks name

31 0 12288 mtdblock0

31 1 1024 mtdblock1

31 2 4608 mtdblock2

31 3 3328 mtdblock3

31 4 358400 mtdblock4

31 5 163840 mtdblock5

31 6 436224 mtdblock6

179 0 7875584 mmcblk0

179 1 7871488 mmcblk0p1

I can run /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 , but every time I try to run nc 127.0.0.1 555 | pv -i 0.5 > data.raw in my secon Cygwin terminal I get a zero byte file. I'm running su prior to the busybox command above. My phone is unlocked when I run the commands above, but I'm not seeing any request on the phone to grant or deny the su request per a previous response in the thread.

I feel like I may be missing something obvious, and any help would be appreciated!

Thanks!
[Samsung Galaxy Nexus] pitone02:
do you see the reading speed?

i have 0 byte file also during the operation and until operation is finished....then it becomes 8GB (my phone has 8GB flash memory, total reading time was 30 minutes) when finished.

i haven't any request in phone screen also.

just wait until the end of read operation (may take few hours, it depends on varius factors....)

i'm in windows 7 32bit.
[Samsung Galaxy Nexus] optimusfan:
The read speed is 0 b/s, and unless it's running asynchronously it also returns to the console immediately after I run it:

$ nc 127.0.0.1 555 | pv -i 0.5 > data.raw

0 B 0:00:00 [ 0 B/s] [<=> ]

So, I assume it's done at that point, yes?
[Samsung Galaxy Nexus] pitone02:
in first window i have used:

adb forward tcp:5555 tcp:5555
adb shell
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0

because i have busybox installed in xbin folder and i want to backup entire flash memory (mmcblk0), all partition into one raw file and it works.

in second window i have used:

nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw

try it, hope this can solve your backup problem.
[Samsung Galaxy Nexus] optimusfan:
I'm not sure what was wrong, but it's totally working now. I also closed all of my Cygwin terminals prior to doing anything. Backup is underway! Thanks!!
[Samsung Galaxy Nexus] scottspa74:
You guys in this thread are awesome. !
[Samsung Galaxy Nexus] vaka85:
hi,

i'm trying to do the procedure from recovery mode, but "nc" is not in the available commands list...

Busybox doesn't work with full set of commands in recovery mode?
[Samsung Galaxy Nexus] dmsChap:
I got it to work...finally!

So I've been struggling with this for ages and Cygwin kept finishing the copying very fast and only copying 827B or so. Anyways, here is the answer - I found it on p2 of this thread and it was posted by [MENTION=2738944]scandiun[/MENTION]. Please head over there and give him a "Thanks"! Just use this code exactly as is, the only thing you might need to change is the memory block number - I9500 S4 is 21, I9505 S4 is 29, etc.

I hope it works for you too!

Kind regards

Dev
[Samsung Galaxy Nexus] k4trozz:
same problem... any answer yet?

it's not working either

I didn't see any superuser permission when i write "su" and I've got an error

unknown option -- e

After I checked... my netcat doesn't has any -e command... I've tried several download... still the same... can anyone share me netcat that has -e in it?
[Samsung Galaxy Nexus] optimusfan:
This is what I used:

Upon further review, I'm not sure if my problem is solved or not. Both mmcblk0p1 and mmcblk0 are right around 8GB, which is the size of the memory card and not internal memory (~1 GB on the EVO 4G, if Google is giving me the right answer). One of mmcblk0p1 and mmcblk0 mounted in windows immediately and appeared to be the sd card. I had to run through the full procedure on the second one and recuva is currently restoring files, but from looking at them they appear to again be from the sd card. Am I missing something?

Below are the results of a couple of the commands from the thread referenced in the op regarding figuring out where to look:
[Samsung Galaxy Nexus] k4trozz:
It's working :D

finally... it's working....

I think the problem is port that I use.... for anyone else have same problem... that the code is not working.... try to change to another tcp port... search at google which is available...

btw... very helpful topic... thanks guys....
[Samsung Galaxy Nexus] boffti:
I extracted the entire memory block (mmcblk0) of my nexus4. Also ran the CMD line to attach the VHD footer. Im getting an "A Virtual disk support provider for the specified file was not found" error when I try to attach the VHD. I followed the instructions to the letter. Someone please Help. Im running Win 8 Pro x64 if thats of any help.

Edit: I also tried renaming to .VHD, didnt work. Also did the Registry Changes, didnt work. Getting the same error.
[Samsung Galaxy Nexus] Kitof:
Thanks a lot for this guide. Unfortunately, it didn't work for me.

Like a lot of people here, I only recover crap on my HTC One X+ (I mean none of my pictures or movies in /DCIM/100MEDIA).

I looked deeply inside the raw, and saw a lot of 0 values ....

The reason is here : hxxps:/www . hatforce . com/blog/android/wipe

"The source code indicates that Honeycomb (and after) do securely wipe the memory on factory data reset."

It's means : "It rewrite the data partition with 0 values".

It's sad...
[Samsung Galaxy Nexus] happy94:
Thanks for this tutorial, will try it!
[Samsung Galaxy Nexus] pitone02:
Do you find a new disk (raw) in administrator tools?

Inviato dal mio T600 con Tapatalk 2
[Samsung Galaxy Nexus] boffti:
No! How can I when it's not mounting?
[Samsung Galaxy Nexus] dmsChap:
I've tested this using mmcblk0 on my S4 and that didn't work (I'm also on Win8 x64). For some reason it wouldn't let me initialise the drive in Disk Management, although I didn't have issues with the support provider error. However doing it with the userdata partition worked perfectly for me. Try it with mmcblk0p23 (userdata partition on Nexus 4) and see if that works.

[MENTION=2618512]k4trozz[/MENTION], make sure you don't have more than one instance of adb running - as far as I know the -e error is as a result of adb trying to attach to several devices. Just to be sure, in your cmd type:

adb
adb kill-server

Then close cmd. Download MiniADB here, extract it to your desktop, run RunMe.bat and do things from there. If that doesn't fix it then unfortunately I'm out of answers :)

Hope you get it to work!

Regards

Dev

--------------------------------------------------------------------------------------------------

DevStickells

Samsung Galaxy S4 GT-I9500, rooted stock

Please hit thanks if I helped you!
[Samsung Galaxy Nexus] Mariohlp:
Hello guys, okay?

I have an i-9250 with photos I took of my engagement, but accidentally i did not back up my photos before doing the factory reset. I'm trying to do this tutorial but I can't do the commands in cygwin. I can only do these commands in CMD, but it does not recognize the command "pv" in the last step and generates 0byte RAW.

Where am I going wrong? I believe the program is cygwin, I could not download properly from the internet. Anyone Can help me?

Thank you!
[Samsung Galaxy Nexus] thjoku:
I had my nexus 4 factory reset due to encryption. Its not rooted. I want to try this procedure. But does this work with Nexus 4.

Or is there any other method to convert internal storage to usb mass storage and then try recovery softwares?
[Samsung Galaxy Nexus] dmsChap:
Make sure you install the x86 version of Cygwin and that you install the pv and util-linux modules when it comes up with the list of modules - just search pv and util-linux and make sure all the results that come up are selected. That should fix your issue with the pv command not being recognised. If you aren't sure exactly of how to do things, here is a very helpful tutorial. Note that this guy uses an S3, so you need use different a mmcblk number.

Yes it works for Nexus 4 and no, since Android 4.2 there is no way to convert internal storage to USB mass storage :) You can try this on a non-rooted phone, but I highly doubt it will work. Your best bet is to root your phone and follow the instructions on p1 of this thread or in the youtube tutorial at the link above.

Kind regards

Dev

--------------------------------------------------------------------------------------------------

DevStickells

Samsung Galaxy S4 GT-I9500, rooted stock

Please hit thanks if I helped you!
[Samsung Galaxy Nexus] pablo.va87:
Hi!

I've just deleted /sdcard accidentally from my N4, I'm following the guide, trying to export mmcblk0p23 block, that is my userdata partition, but when I export the RAW file is empty (0 bytes)! I've followed the guide, I don't know what is failing, any idea?

Thank you very much!

Edit: When I run "nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw" it exports the raw file directly, it's very rare. :S
[Samsung Galaxy Nexus] dmsChap:
[MENTION=4761692]boffti[/MENTION] Ok ja that's odd. I had to convert to VHD and then change the file extension to .vhd, but mine shows up as a .vhd in properties, so there must be something wrong with your VhdTool. Have you got VhdTool.exe in the /Nexus folder and all that? Check out this tutorial if you want to check your stuff - he shows you step by step how to do it.
[Samsung Galaxy Nexus] pablo.va87:
I've re-installed Busybox, also installed Cygwin x86 (first time I installed x64, i'm on Win8 64), and with x86 version of Cygwin, when I try to run adb.exe it appearse an error like:

-bash: adb.exe: command not found

Any help please, i'm a bit desperate with this.

Thanks!!

Also I have to say that when I run the nc command I don't see any text like "0B and 0 B/S completed" or similar :S
[Samsung Galaxy Nexus] dmsChap:
Download MiniADB here, extract it, double click runme.bat and try from there. Then you don't need to worry about adb.exe not being found.

Hope that gets things sorted out for you!

Edit: check if your busybox is installed to /bin or /xbin - it won't work if you point Cygwin to the wrong folder.
[Samsung Galaxy Nexus] pablo.va87:
Thanks for your answer, but when I run miniadb it says mi adb server is out of date, and doing an "adb devices" appears my device offline, that's not happening with the usual adb.exe :S
[Samsung Galaxy Nexus] dmsChap:
Exactly the same thing happened with me and it worked fine. Just carry on and see if it works. If it doesn't then put 'adb kill-sever' into the MiniADB cmd, close MiniADB, plug your phone into another USB port and try then. As far as I know, that ADB device offline thing is not accurate.

If you keep getting the ADB out of date error, make sure you have the latest version of the Android SDK tools installed, find the SDK's adb.exe and copy it into your MiniADB folder.

Regards
[Samsung Galaxy Nexus] vaka85:
hi,

anyone please tell me if this guide can be done via recovery...

Because my busybox has not the nc command, and if i try to install nc it gives me this error:

mount: mounting /dev/block/mmcblk0p5 on /system failed: Invalid argument
[Samsung Galaxy Nexus] worf_1977:
Do not run more than one instance of ADB, or you Will get that error always for sure ;)
[Samsung Galaxy Nexus] pablo.va87:
Thanks again, but I'm still in the same situation :(

I've downloaded the latest version of adb.exe from the SDK and replaced in the MiniADB folder as you said, now I don't have the out of date error, but still, when I create the RAW file is 0 bytes.

I noticed that when I run this (I've busybox installed inside xbin folder)

/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0

The shell window doesn't appear to do anything, I'm not sure if that's the correct behaviour or not:

Do I have to wait or something? :rolleyes: What I do is open a new windows of Cygwin and run the other commands.

Other thing is that I'm using the x64 version of Cygwin because x86 version doesn't work, everytime I try to run adb.exe it gives an error like "-bash: adb.exe can't find the command". Can this be the cause of the problem?

If anyone knows how to help me I'll pay him a beer for sure! I'm completely out of ideas.

Thanks :good:
[Samsung Galaxy Nexus] Luna01:
Well, useful guide! Most data recovery software can only recover data from external memory card of mobile phone.
[Samsung Galaxy Nexus] spakimo:
Hi all, I have a doubt, is possible that some of my picture have an extension different like .txt or .tar. What I can see in that in the mmcblk0 I have about 5000 files but only some pictures...
[Samsung Galaxy Nexus] Kitof:
No, sadly. The best test you could confirm this : take a picture with your phone and dump it. You will recover it.

Let me guess unlock or factory reset ?

As I said before, Android did a secure wipe during this operation.
[Samsung Galaxy Nexus] dmsChap:
Ok here's the exact code I put into Cygwin. Don't worry if nothing happens in the first terminal - it only changes after you execute code in the second terminal.

Terminal 1:

adb forward tcp:5555 tcp:5555
adb shell
su
nc -l -p 5555 -e dd if=/dev/block/mmcblk0p21

(Just replace 21 with the userdata partition number for your phone)

Terminal 2:

adb forward tcp:5555 tcp:5555
cd /S4
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0p21.raw

(Replace S4 with the folder you want to extract to and change 21 to the correct number for your phone.

Something to mention is that I haven't been successful with mmcblk0, only with the userdata partition.

Regards
[Samsung Galaxy Nexus] pablo.va87:
Thanks again!!

Finally, I installed a new Windows 7 x86 virtual, and it's working, is extracting the RAW file, I hope that's all.
[Samsung Galaxy Nexus] spakimo:
I have unlock boot with Google Nexus Toolkit, and after this operation I didn't do any other procedure and no take pictures in order to no overwrite any possible data deleted...

What mean "take a picture with your phone and dump it..."?

Thanks!
[Samsung Galaxy Nexus] Kitof:
As I said, android did a secure wipe during an unlock and filled your data partition with 0. So it's probably too late.

Sorry for my bad English. I meant : to ensure that your picture are stored in clear jpeg, you could take a new picture with your phone, and dump the data partition with the method on the first post. If you could recover this picture with this method, there is no reason you couldn't recover the others with the same operation. If not, you're screwed...
[Samsung Galaxy Nexus] spakimo:
OK I understand you about take a picture...

About the secure wipe what I don't understand is why in many guide this thread is suggested in the unlock boot wipe... :confused: and why some pictures are found in the dump.

Thanks a lot!
[Samsung Galaxy Nexus] optimusfan:
Anyone have any ideas on this? I'm about to give up hope of recovering the journal containing my daughters milestones.
[Samsung Galaxy Nexus] Kitof:
Try a "ll /dev/block" and dump each block listed.

Good luck.
[Samsung Galaxy Nexus] teorouge:
Thanks, I got to create a 29GB raw file (HTC One here) dumping the whole mmcblk0 memory: now I scan this with Recuva or Puran and I find nothing, should I try and dump /data partition from phone only and scan that? Would that change anything? Wifey's so mad at mad right now... xD
[Samsung Galaxy Nexus] Kitof:
It'll probably change nothing to dump only /data partition. But you could use PhotoRec from here for better result : cgsecurity.org /wiki/PhotoRec_FR

Anyway, if it's a wipe after a factory reset or an unlock, you'll probably recover nothing. Sorry.
[Samsung Galaxy Nexus] optimusfan:
Thanks for the feedback. I believe that's what I've tried, and every block other than mmcblk0 and mmcblk0p1 are 1 KB (see attached images). Again, I'm confused because both mmcblk0p1 and mmcblk0 are ~8GB and appear to be the contents of the 8 GB SD card. I'm not seeing anything similarly sized to the 1 GB internal memory partition.
[Samsung Galaxy Nexus] Kitof:
What's the output of the mount command ? (with previous "su")
[Samsung Galaxy Nexus] optimusfan:
My wife has the phone at work, so I'll take a look tonight. I had taken a look at the instructions here: http://xdaforums.com/showthread.php?p=28115791 and posted a few results here: http://xdaforums.com/showthread.php?p=45173727#post45173727 . I don't remember that running mount after su yielded anything useful, but given that I don't know exactly what I'm looking for I could have easily missed something. I'll check it again tonight.
[Samsung Galaxy Nexus] Kitof:
This is to be sure you didn't miss a hidden partition or something. (the output of the "df" command could be useful as well).
[Samsung Galaxy Nexus] optimusfan:
OK, please let me know what I'm missing:

$ su
su
# mount
mount
rootfs / rootfs rw,relatime 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /app-cache tmpfs rw,relatime,size=8192k,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mtdblock4 /system yaffs2 ro,relatime 0 0
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev,relatime 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev,relatime 0 0
htcfs /data/htcfs fuse.htcfs rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow _other 0 0

and

# df
df
/dev: 207196K total, 64K used, 207132K available (block size 4096)
/mnt/asec: 207196K total, 0K used, 207196K available (block size 4096)
/mnt/obb: 207196K total, 0K used, 207196K available (block size 4096)
/app-cache: 8192K total, 2876K used, 5316K available (block size 4096)
/system: 358400K total, 335556K used, 22844K available (block size 4096)
/data: 436224K total, 154936K used, 281288K available (block size 4096)
/cache: 163840K total, 2316K used, 161524K available (block size 4096)
[Samsung Galaxy Nexus] thjoku:
I booted my nexus 4 and followed the procedure with youtube video side by side. Excellent guide even for those who are doing it for very first time.

I had some difficulties in setting up the phone on adb. And the busybox was installed on different folder. Other than that no glitches.

Unfortunately i could not recover any pics. whatever i recovered was only the picasa pics which were already uploaded. Btw, i used partition 23. is this the right one?
[Samsung Galaxy Nexus] ierrors:
I have Nexus 4

and when I type second command it's just nothing happen
[Samsung Galaxy Nexus] Kitof:
Interesting. /data and /system seems to be the partitions you need to recover. There is no reason to dump a 1Ko file for mtdblock4 and mtdblock6.

Maybe the yaffs2 filesystem is the reason. Cloud you try to replace the dump command by this one :

/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox nanddump -f - /dev/block/mtdblock6

or

/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox nanddump /dev/block/mtdblock6

---------- Post added at 03:04 PM ---------- Previous post was at 02:49 PM ----------

Try to disable your firewall or change the 5555 to another number.

It seems that you doesn't have right to write the dump on /nexus directory. Try another directory to dump.
[Samsung Galaxy Nexus] ierrors:
Switch it off firewall but not help!

I gave nexus folder all the permission.

When I type second command without adb shell it creates RAW file but 0 bytes.
[Samsung Galaxy Nexus] spakimo:
Ok, sorry but, why then this thread describe the procedure to recover pictures in case of unlock bootloader wipe...

I'm sorry if I am insistent, and thanks for the help!
[Samsung Galaxy Nexus] Kitof:
I have the same question than you.

Anyway, since Honeycomb, Android performs a secure wipe during a factory reset. (https://www.hatforce.com/blog/android/wipe)

For unlock, it's depends on manufacturer's choice. That's probably why some people sucessfully recover some pictures.

And, as you can read on the first post, Wartickler wrote "try to root with a non-destructive method". Maybe, it's because destrucive method is destructive ;)

Anyway, sorry for your data.
[Samsung Galaxy Nexus] spakimo:
so I have to give up their :-|
[Samsung Galaxy Nexus] Kitof:
Maybe it could help some people : I lost my picture after an unlock, but I could recover the thumbnails (and some of them are in pretty good size) in a Titanium Backup of the album application.
[Samsung Galaxy Nexus] ierrors:
Same here I lost them after bootloader unlock and still trying but no luck. I don't know what's wrong. ( Nexus 4 )
[Samsung Galaxy Nexus] Kitof:
Strange errors. Could you try on another PC ?
[Samsung Galaxy Nexus] ierrors:
The PC which I used running Win 8. I'll try other PC running Win XP.
[Samsung Galaxy Nexus] Mariohlp:
im get the raw, but i can't recover just one image ou video file. Just image from facebook and apks. Why? another way to search more deep?
[Samsung Galaxy Nexus] Kitof:
For French people, there is a translated guide here : http://forum.frandroid.com/topic/163598-tuto-récupérer-ses-données-supprimées-en-mémoire-interne/

---------- Post added at 08:30 AM ---------- Previous post was at 08:26 AM ----------

Did you use PhotoRec ? It's probably the program to use to have the best result.

Otherwise, there are probably no more option sorry.

Did you lost your data after a boot unlock ?
[Samsung Galaxy Nexus] Mariohlp:
I will try with this soft, tks. I make a factory reset, but i forgot make the backup.

No way. The recuva have more lucky to recover files, but im not have lucky. :(
[Samsung Galaxy Nexus] Garridon:
For the life of me i cant download the vhd tool. The website gives me an error trying to open the link. could someone give me a mirror for the file?
[Samsung Galaxy Nexus] optimusfan:
Dang, just gave it a shot and ended up with equally bad results. I only tried with block6, but ended up with 1 KB .raw files again:

$ nc 127.0.0.1 5555 | pv -i 0.5 > mtdblock6a.raw
53 B 0:00:00 [51.8kiB/s] [<=>]

$ nc 127.0.0.1 5555 | pv -i 0.5 > mtdblock6b.raw
53 B 0:00:00 [50.5MiB/s] [<=>]

Any other ideas?
[Samsung Galaxy Nexus] dmsChap:
Recover contents of DCIM folder

Does anyone know what happens to photos if you delete the 'Camera photos' folder from your galary? - So basically the contents of the DCIM folder, but all at once. I've run this method of recovery on the UserData partition and everything worked, except for the fact that my DCIM folder photos aren't there. The ones which I have individually deleted along the way (all the trashy photos) got recovered, but the thousand or so perfectly decent ones which I deleted all at once from my gallary are nowhere to be found.

I am on a Samsung S4 I9500 and would greatly appreciate it if anyone knows where the pics might have gone or if there is a 'LOST.DIR' equivalent somewhere on the internal storage.

Thanks so much

Dev
[Samsung Galaxy Nexus] Kitof:
Which recovery software did you use ? Did you test PhotoRec ?
[Samsung Galaxy Nexus] nmann:
Thanks to genius UI design of Samsung, I've deleted the whole camera folder instead of a single video. I've done all steps, but same as you, I could not find any of target pictures. I've tried with Ontrack Easy Recovery 10. Interesting really...

Now trying with different software
[Samsung Galaxy Nexus] dmsChap:
Haven't tried PhotoRec, but I've tried Recuva and Wondershare, neither of them worked. It's very odd - my other pics are there, but the ones from the camera (DCIM) folder are nowhere to be found...

PS: Please let me know if you manage to get it right - I'd really appreciate it!