Get AirVPN and be free online

Wednesday, June 03, 2009

Recover data from a restored iPhone (part 2)

PLEASE NOTE: this method will almost certainly NOT work with an iPhone 4 or above, and may NOT work with the 3GS (although I have heard some report that it did work for them with a 3GS). The reason for it not working is to do with hardware encryption. Now on with the guide...

This guide is the practical implementation of the "how to" guide that I posted a while back. That original "guide" only consisted of 3 links. The first link was to a tutorial, and the other two were to pages with Cygwin information.

When I finally got around to executing the plan, I only needed the first link. Because since the original post I've bought a Macbook, and therefore don't need to use Cygwin (which for those that don't know provides you with a Unix environment inside Windows).

So armed with the guide I set out on my little iPhone image dump adventure. I'm just going to repeat parts of the guide or reference it, adding little extras specific to my setup.

FIRST of all, the guide provides the following list of things you need. I've added my own notes:

- Jailbroken iPhone
[Check this tutorial on for jailbreaking your iPhone successfully with QuickPwn]

- BSD Subsystem and OpenSSH installed on your iPhone
[When you jailbreak your iPhone with QuickPwn, BSD Subsystem will automatcally be installed, as will an application called Cydia. Cydia lets you search for and install other apps. So use Cydia to search for and install OpenSSH]

- Terminal (or MobileTerminal) installed on your iPhone
[Search for and install MobileTerminal with Cydia]

- An SSH server installed on your computer
[I'm a Mac newbie, so thankfully I got emailed a tip from Matthew Zito who has a blog at He directed me as follows: Go to System Preferences -> Sharing -> and check the box "Remote Login"]

- The 'DD' utility installed on your computer
[DD was already installed on my Macbook]

- Your iPhone's IP address
[If you go to the Wireless LAN settings on your iPhone it tells you in the details what your IP address is]

- Your computer's IP address
[on a Macbook open a Terminal and use the ifconfig command to check your computer's IP address]

Now you're basically ready to go. Just follow the guide, keeping in mind the following:

DON'T forget the tip about turning OFF your iPhone's auto-lock and do the SAME on your computer (on the Macbook it's under Energy Saver settings)

DON'T forget to change the user to "root" after you've started up MobileTerminal on the iPhone. The guide also explain this.

The only other thing I want to share is that the dump process took nearly 3 hours on a 802.11 G Wireless LAN. Below is a pic of MobileTerminal on my iPhone with the commands and the transfer data information. You can see the speed was approximately 783 kB/s and it took ages.

Ok, once you've got your iPhone image dumped, it's a piece of cake to turf at least your media out of it. I was hoping I could get the image mounted and browse it in its original state, but so far I haven't found a way to do that.

My original goal was to recover my photos, and that's what I achieved anyway. So here's the plan:

1) Go and get this wizard free application (Harry Potter would be proud) called PhotoRec. PhotoRec will make you happy I promise.

2) Just unpack it and run it against your disk image. E.g.

./Users/josh/Utils/photorec ./Users/josh/iphone-dump.img

You don't even need to be root to run it. It'll jump straight into a nice simple interactive terminal screen.

- So you choose "Proceed"

Then you pick the partition table of your image. For the iPhone that's Mac, or at least that worked for me :)

Then choose the partition, it only offered me one option

Then choose the filesystem. ext2/ext3 worked for me.

Then choose the location for the files it fishes out of your image.

And once you're satisfied with the location press "Y" and it'll start ransacking your image file :)

..Until it's done. It only took about 24 mins in the end. Not bad at all.
It found all my photos. At least, I can't remember exactly what photos I had or how many, but it found lots. Plus it recovered my mp3s and movie clips.

So, I'm a happy man, and can finally go back to using my 2G iPhone :D... er, did I say 2G? Yup, that's the bummer. It's a first gen model that I bought in the UK when the price plumetted. Still, it's fun to use. But man that 2G slowness certainly bugs me, especially when I'm used to 3G freedom on my HTC Kaiser.

So what'll it be?
- The 3rd gen iPhone (not 3G, I mean the 3rd generation of iPhone) that'll hopefully be out by Autumn 2009.
- Or the HTC Dimaond 2 with its slick look, wicked screen, pants camera, no qwerty keyboard
- Or the HTC Touch Pro 2, with its QWERTY keyboard, fat screen, and pure niceness.

Dunno, I'll probably wait till the next round. I'm a sucker for perfection and it takes them so long to bring out something REALLY interesting. Till then I'll probably just grin and bare it ;))


Anonymous said...

Awesome, thanks so much for the how-to, it was really useful.

Anonymous said...

can u help me... i lost my photos in september, didn't sync it and i had to restore it.. i want my pictures and notes back

Josh said...

Hi, sure I'd be happy to help you out. Let me know how I can contact you. Or you can contact me on Twitter - @gigajosh

Anonymous said...

hiii,, I will contact you from twitter 2morow.. if i cant get on to it, i will give u my email add...

thank you soo much! :)

Anonymous said...
This comment has been removed by a blog administrator.
eXTReMe Tracker