Page 1 of 1

iPhone & PhotoRec

Posted: 02 Apr 2012, 23:56
by jbob
I've used photorec a few times on my iPhone, but haven't had a whole lot of success. I mean I have managed to restore a few lost items, but the majority of what I have found has seemed to be empty files. I have never came close to filling the memory up, only used maybe 30% of its capacity. I would think some of my data would still be written on the drive...

I have a few questions regarding the "dd" command. On the PhotoRec site, it says to use the following command,

Code: Select all

dd if=/dev/rdisk0 bs=4096 | ssh -C username@computer_IP 'dd of=iphone.img'
On another site, I found someone recommending using this command,

Code: Select all

dd if=/dev/disk0 | ssh <username>@<computer-ip> 'dd of=iphone-dump.img'

My questions are:

1) I have used both commands successfully, does it make a difference which one I use?

2) What are the differences with the "disk" / "rdisk", "bs=4096" vs no bs, and "-C" vs no "-C"

Thanks.

Re: iPhone & PhotoRec

Posted: 03 Apr 2012, 06:17
by cgrenier
jbob wrote:What are the differences with the "disk" / "rdisk", "bs=4096" vs no bs, and "-C" vs no "-C"
- disk / rdisk: in the second case, Mac OS X doesn't do disk caching
- bs=4096 means the copy is using 4096 bytes read/write operation instead of 512 bytes I/O, it should be faster using bs=4096.
- "ssh -C" enables the compression during the transfer.

The content of the disk image should be identical in every case.

Re: iPhone & PhotoRec

Posted: 03 Apr 2012, 22:39
by jbob
cgrenier wrote: - disk / rdisk: in the second case, Mac OS X doesn't do disk caching
- bs=4096 means the copy is using 4096 bytes read/write operation instead of 512 bytes I/O, it should be faster using bs=4096.
- "ssh -C" enables the compression during the transfer.

The content of the disk image should be identical in every case.[/quote]


Thanks for the clarification, but the one time I used the first command, with the bs and -C it took nearly three times as long, close to 12 hours for 8 gigs, where the 2nd command came in close to 4 hours. Any chance the compression made it longer?

Re: iPhone & PhotoRec

Posted: 04 Apr 2012, 13:29
by remy
It's possible, and depends on the rate transfer and on the compression ability of source and destination . If rate transfer is low, it's better to lose time with compression and limit the quantity of transfer. If it's quite good, you'll lose time with compression/decompression. Knowing that often datarecovery on phones is only for pictures, you probabely have a great quantity of data that is not possible to compress more (jpg is already compressed format). So, in that case, you loose time to "not compress", transfer quite the same amount, and again loose time to uncompress something "not so much compressed".

Sorry for my bad english skills. Hope that was clear enough.

Re: iPhone & PhotoRec

Posted: 10 Apr 2012, 19:55
by nimmolo
Hi tout le monde

I have macFUSE and Phone Disk/Disk for iPhone installed, it's code that runs in the background, with which I can browse the phone directly through the USB connection in the Finder, without a Wifi connection.

Could I then use dd in a different way, perhaps without the ip address and would it be faster than creating the image over wifi?

And finally sorry for a V E R Y newbie question, I can't think of an efficient way to google this. Does the " | " in the command (in the first post) signify a new line in the Terminal, or is everything typed in-line with the " | " being part of the rest of the command? :/// i know, i know, i should know that.

Re: iPhone & PhotoRec

Posted: 11 Apr 2012, 09:12
by remy
I can't answer your first question, because I don't have an Iphone (I prefer Nokia N9 and linux embedded :P) neither a mac.

The "|" is a "pipe". It says to the result of the first part of the command line to become the entry for the second part. You have to write that inline.

Re: iPhone & PhotoRec

Posted: 11 Apr 2012, 16:27
by nimmolo
Merci Rémy! Your phone setup sounds very cool.

The disk image was created in a few hours over wifi comme prévu, and everything worked just fine. I rather used EXIF Untrasher to find the files, just out of curiosity, and it also works great. Thanks Christophe for writing this code!

Re: iPhone & PhotoRec

Posted: 11 Apr 2012, 20:02
by remy
Well done !
You can now close your topic and refer it as "solved".

By the way : I'll try to put testdisk_static on my N9 to see If I would be able to do recovery from inside the phone :P