+ Reply
Page 1 of 14 123 11 ... LastLast
Results 1 to 20 of 270

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: HOW TO: iPhone Data Recovery

is a discussion within the

File Mods

forums, a part of the

iPhone Modding

section;
Recently, I bricked my iPhone and had to restore it in iTunes. In the process, I lost a bunch of photos from my Camera Roll that hadn't been saved to
...
  1. #1
    What's Jailbreak?
    Join Date
    Apr 2008
    Posts
    9
    Thanks
    1
    Thanked 14 Times in 1 Post
    Lightbulb HOW TO: iPhone Data Recovery
    Recently, I bricked my iPhone and had to restore it in iTunes. In the process, I lost a bunch of photos from my Camera Roll that hadn't been saved to my computer yet. After an endless amount of Google searching, I finally found a way to recover, or "undelete" data from the iPhone. This guide will focus on recovering photos, since that's what I had to do, but the same process could be used to recover other lost data.

    What you'll need:
    - Jailbroken iPhone
    - BSD Subsystem and OpenSSH installed on your iPhone
    - Terminal (or MobileTerminal) installed on your iPhone
    - An SSH server installed on your computer (mine is running Ubuntu 7.10 with OpenSSH)
    - The 'DD' utility installed on your computer (this should be pre-installed on most Linux systems)
    - Your iPhone's IP address
    - Your computer's IP address

    First, make sure that your iPhone and computer are on the same LAN. You can try to ping your computer from your iPhone (using Terminal) and vice versa, just to make sure they can see each other on your LAN. For example:
    Code:
    ping 192.168.1.215
    Next, you'll want to make sure that you can SSH into your computer from the iPhone. To do that, open Terminal on the iPhone and enter:
    Code:
    ssh <username>@<computer-ip>
    Where:
    <username> = Your user name on the computer.
    <computer-ip> = Your computer's IP address on the LAN.

    If that worked, you should be prompted to enter a password for <username>. If the connection times out, then you need to make sure that you have the SSH server running on your computer and make sure that port 22 (the default SSH port) isn't being blocked by your router's firewall.

    Once you know that your iPhone and the computer are talking to each other, open Terminal on the iPhone and run the following command to begin transferring the iPhone's "disk" image to your computer (be sure to run this as root using 'su'):
    NOTE: Make certain that your iPhone's screen lock is disabled first. If the screen lock comes on, it will kill the SSH connection. Also, you'll want to connect your iPhone to its charger. This transfer can take a while.
    Code:
    dd if=/dev/disk0 | ssh <username>@<computer-ip> 'dd of=iphone-dump.img'
    The above command will create a "disk" image of your iPhone (named "iphone-dump.img") on your computer. Feel free to use a different name or a different destination directory. For example: 'dd of=/home/username/iphone-dump.img'.

    Also, be sure that you don't mix up the "if" (input-file) and "of" (output-file) in the command above. Doing so could wipe-out your iPhone.

    After the process has completed and the iPhone's image file has been saved to your computer, you can use a program like PhotoRec to recover your photos.

    I hope this helps!
    Last edited by lmarr28; 08-08-2008 at 09:27 AM.

  2. The Following 14 Users Say Thank You to lmarr28 For This Useful Post:

    ajrulez (07-16-2008), army113 (05-08-2010), brinzei (07-31-2008), colouny (11-27-2009), guls_guys (05-15-2010), miidxs (03-11-2011), mungler (03-29-2009), new0rder (06-16-2009), Retell (08-11-2010), rotaryheadrx7 (08-08-2008), Trooper Sam (09-03-2010), VampiraQula (11-30-2009), Vatec (08-26-2010), zdestiny (06-12-2009)

  3. #2
    iPhone? More like MyPhone
    Join Date
    Mar 2008
    Posts
    195
    Thanks
    14
    Thanked 21 Times in 17 Posts

    Default Awesome!
    Excellent post!

    Mods, please make this sticky if possible.

  4. #3
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks!!! I'm gonna try it! I just bricked my phone before, so this is helpful, ill let u know if it works

  5. #4
    What's Jailbreak?
    Join Date
    Jul 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I get a dd: opening `/dev/disk0`: Permission denied

    Any ideas?

    -mike

  6. #5
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can someone please help with the permission denied error....thanks.

  7. #6
    What's Jailbreak?
    Join Date
    Apr 2008
    Posts
    9
    Thanks
    1
    Thanked 14 Times in 1 Post
    Quote Originally Posted by msbreton View Post
    I get a dd: opening `/dev/disk0`: Permission denied

    Any ideas?

    -mike
    You might have to run the DD command I mentioned above as root on your iPhone. That's what I did and it worked for me (I never tried it without being root though).

    To do that, as soon as you open the Terminal app on your iPhone, run the command: su

    You should be asked to enter a password. The password should be: alpine

    If that worked, try running the DD command again and see if you still get the permission denied error. If it didn't accept the password, you may need to install the "BSD Subsystem 2.x SU Replacement". (The su command that came with BSD Subsystem 2.0 and 2.1 was broken -- this fixes it.)

    To install it, add the following source to your installer app:
    http://iphone.lenlolabs.com

    Hope this helps!

  8. #7
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Cydia
    So I made it through most of the steps, got my computer and iphone (1.1.4 ziphone) to connect, got past the "permission denied" error, but then I get a "dd: not found" error.

    I believe this is because I have Cydia instead of the BSD Subsytem, and it probably doesn't have the dd utility.

    So, what do you guys suggest? Uninstall Cydia?

    I'm also wondering if syncing will cause me to lose any potentially recoverable data.

    Quote Originally Posted by Shasha04 View Post
    So I made it through most of the steps, got my computer and iphone (1.1.4 ziphone) to connect, got past the "permission denied" error, but then I get a "dd: not found" error.

    I believe this is because I have Cydia instead of the BSD Subsytem, and it probably doesn't have the dd utility.

    So, what do you guys suggest? Uninstall Cydia?

    I'm also wondering if syncing will cause me to lose any potentially recoverable data.
    Ok, so I do have the dd utility. I realized that I couldn't be getting a "permission denied" error without it. I also noticed I have internal help files for that command.

    So, my problem is: I type in the command. I get some scrolling stuff and a password prompt for my pc. I type in that password, more stuff scrolls, and then I get an error that says "dd: not found"

    What the hell is not found??
    Last edited by Shasha04; 08-01-2008 at 02:44 PM. Reason: Automerged Doublepost

  9. #8
    What's Jailbreak?
    Join Date
    Apr 2008
    Posts
    9
    Thanks
    1
    Thanked 14 Times in 1 Post
    I'm not familiar with Cydia, since I've never used it, but I can tell you that you will need the BSD Subsystem installed for it to work.

    When you delete something from your iPhone (or in this case, when you do a "restore" in iTunes), it's not actually removed from the flash memory... The data is still there, it's just been "flagged" so the OS knows that it's OK to overwrite that section of memory. So, anything you do on the iPhone could potentially overwrite some of that recoverable data (e.g. syncing, taking photos, saving notes, etc.).

    Quote Originally Posted by Shasha04 View Post
    So, my problem is: I type in the command. I get some scrolling stuff and a password prompt for my pc. I type in that password, more stuff scrolls, and then I get an error that says "dd: not found"

    What the hell is not found??
    Ahh... I completely forgot about that. You'll need DD on your computer as well, since the command that you're running uses DD on the PC-end to create the image file. I didn't mention it before because DD comes pre-packaged with most Linux distros.
    Last edited by lmarr28; 08-01-2008 at 02:55 PM. Reason: Automerged Doublepost

  10. #9
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alright, I figured out my problem and wanted to post it here for the next person to run across it.

    I was using OpenSSH for Windows. Windows does not have dd. To use dd, you need on both machines (your phone and the machine you are sshing into), so my error was that dd was not found on my Windows machine.

    So, Windows people, either throw in a Knoppix disk, or find a friend who will let you ssh into their unix box like I did

    Anyone got stats on how long this transfer will take?

    Quote Originally Posted by Shasha04 View Post
    So I made it through most of the steps, got my computer and iphone (1.1.4 ziphone) to connect, got past the "permission denied" error, but then I get a "dd: not found" error.

    I believe this is because I have Cydia instead of the BSD Subsytem, and it probably doesn't have the dd utility.

    So, what do you guys suggest? Uninstall Cydia?

    I'm also wondering if syncing will cause me to lose any potentially recoverable data.



    Ok, so I do have the dd utility. I realized that I couldn't be getting a "permission denied" error without it. I also noticed I have internal help files for that command.

    So, my problem is: I type in the command. I get some scrolling stuff and a password prompt for my pc. I type in that password, more stuff scrolls, and then I get an error that says "dd: not found"

    What the hell is not found??
    Cool, yeah, I figured that out before I saw your reply. FYI, Cydia is an opensource alternative to BSD Subsystem and Installer.app. It has all the BSD Subsystem tools packaged in it, plus others, and leans more to the development community in terms of Unix utilities that have been ported over. It even has color highlighting vim.

    So for the record, this method does indeed work with Cydia.

    And yeah, I had a feeling syncing might be the moment when stuff gets literally deleted.

    Quote Originally Posted by lmarr28 View Post
    I'm not familiar with Cydia, since I've never used it, but I can tell you that you will need the BSD Subsystem installed for it to work.

    When you delete something from your iPhone (or in this case, when you do a "restore" in iTunes), it's not actually removed from the flash memory... The data is still there, it's just been "flagged" so the OS knows that it's OK to overwrite that section of memory. So, anything you do on the iPhone could potentially overwrite some of that recoverable data (e.g. syncing, taking photos, saving notes, etc.).



    Ahh... I completely forgot about that. You'll need DD on your computer as well, since the command that you're running uses DD on the PC-end to create the image file. I didn't mention it before because DD comes pre-packaged with most Linux distros.
    Last edited by Shasha04; 08-01-2008 at 04:10 PM. Reason: Automerged Doublepost

  11. #10
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks Imarr28 for a great guide. I have got an image off my 16G iphone. Could you explain how to mount the image? I thought I could mount it as:

    #mount -o loop iphone-dump.img

    but it errors with "you must specify the filesystem type"
    I've tried this under linux and under OSX...just can't mount the image.
    Any help would be appreciated.
    cheers

  12. #11
    What's Jailbreak?
    Join Date
    Apr 2008
    Posts
    9
    Thanks
    1
    Thanked 14 Times in 1 Post
    Quote Originally Posted by Shasha04 View Post
    Anyone got stats on how long this transfer will take?

    ...

    And yeah, I had a feeling syncing might be the moment when stuff gets literally deleted.
    Don't sweat the syncing stuff. I literally went about two weeks after restoring my bricked iPhone before I did this recovery procedure and I was still able to recover about 90% of my lost photos. During those two weeks before doing the restore, I was using my iPhone as normal (syncing, taking photos, etc.). So there's still a chance that you can get a lot of your data back.

    As for the transfer time, it took me about 3.5 hours for an 8 GB iPhone. I wasn't very close to my wireless router though, so that could have had an effect on the transfer speed.

    Quote Originally Posted by scroll1 View Post
    Thanks Imarr28 for a great guide. I have got an image off my 16G iphone. Could you explain how to mount the image? I thought I could mount it as:

    #mount -o loop iphone-dump.img

    but it errors with "you must specify the filesystem type"
    I've tried this under linux and under OSX...just can't mount the image.
    Any help would be appreciated.
    cheers
    I wish I could help you here, but unfortunately I'm really not familiar with Linux/Unix/OSX at all. I'm sure there is someone around here who can tell you though.

    Just out of curiosity, why do you need to mount the image? If you're using PhotoRec for your recovery, you can just point it directly at the image file by using the file's name as a parameter at the command line. For example, run: "photorec iphone-dump.img"
    Last edited by lmarr28; 08-05-2008 at 09:39 AM. Reason: Automerged Doublepost

  13. #12
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks again Imarr28, I didn't realise that photorec could read directly the .img file. I have got nearly all my pictures back from a 16G iphone. It took awhile to download the image ( I left it going over night) but photorec did the restore very, very quickly...I'm impressed.
    thanks again.

  14. #13
    What's Jailbreak?
    Join Date
    Apr 2008
    Posts
    9
    Thanks
    1
    Thanked 14 Times in 1 Post
    Quote Originally Posted by scroll1 View Post
    Thanks again Imarr28, I didn't realise that photorec could read directly the .img file. I have got nearly all my pictures back from a 16G iphone. It took awhile to download the image ( I left it going over night) but photorec did the restore very, very quickly...I'm impressed.
    thanks again.
    Awesome! I know first hand how it feels to lose a bunch of your data like that, so I'm glad I could help you get it back!

  15. #14
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Help
    Quote Originally Posted by lmarr28 View Post
    Recently, I bricked my iPhone and had to restore it in iTunes. In the process, I lost a bunch of photos from my Camera Roll that hadn't been saved to my computer yet. After an endless amount of Google searching, I finally found a way to recover, or "undelete" data from the iPhone. This guide will focus on recovering photos, since that's what I had to do, but the same process could be used to recover other lost data.

    What you'll need:
    - Jailbroken iPhone
    - BSD Subsystem and OpenSSH installed on your iPhone
    - Terminal (or MobileTerminal) installed on your iPhone
    - An SSH server installed on your computer (mine is running Ubuntu 7.10 with OpenSSH)
    - Your iPhone's IP address
    - Your computer's IP address

    First, make sure that your iPhone and computer are on the same LAN. You can try to ping your computer from your iPhone (using Terminal) and vice versa, just to make sure they can see each other on your LAN. For example:
    Code:
    ping 192.168.1.215
    Next, you'll want to make sure that you can SSH into your computer from the iPhone. To do that, open Terminal on the iPhone and enter:
    Code:
    ssh <username>@<computer-ip>
    Where:
    <username> = Your user name on the computer.
    <computer-ip> = Your computer's IP address on the LAN.

    If that worked, you should be prompted to enter a password for <username>. If the connection times out, then you need to make sure that you have the SSH server running on your computer and make sure that port 22 (the default SSH port) isn't being blocked by your router's firewall.

    Once you know that your iPhone and the computer are talking to each other, open Terminal on the iPhone and run the following command to begin transferring the iPhone's "disk" image to your computer:
    NOTE: Make certain that your iPhone's screen lock is disabled first. If the screen lock comes on, it will kill the SSH connection. Also, you'll want to connect your iPhone to its charger. This transfer can take a while.
    Code:
    dd if=/dev/disk0 | ssh <username>@<computer-ip> 'dd of=iphone-dump.img'
    The above command will create a "disk" image of your iPhone (named "iphone-dump.img") on your computer. Feel free to use a different name or a different destination directory. For example: 'dd of=/home/username/iphone-dump.img'.

    Also, be sure that you don't mix up the "if" (input-file) and "of" (output-file) in the command above. Doing so could wipe-out your iPhone.

    After the process has completed and the iPhone's image file has been saved to your computer, you can use a program like PhotoRec to recover your photos.

    I hope this helps!
    Could you tell me how can I do?
    I'm on G5 with Leopard (no airport card installed) connected via ethernet to an airport extreme. Can I connect to the G5 from iPhone to save the disk image? Is there any way?
    thank you
    Last edited by flager; 08-06-2008 at 03:36 PM.

  16. #15
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    flager,
    I'm running Leopard also, but on an intel iMac, with a wireless router attached. As long as you know the ip address of the G5 and as long as you have ssh enabled both on the iphone and G5 and as long as you have a terminal program on the iphone you can do it.
    Worked for me and I have retreived nearly all my pictures, even after reinstalling firmware on the iphone.

  17. #16
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by scroll1 View Post
    flager,
    I'm running Leopard also, but on an intel iMac, with a wireless router attached. As long as you know the ip address of the G5 and as long as you have ssh enabled both on the iphone and G5 and as long as you have a terminal program on the iphone you can do it.
    Worked for me and I have retreived nearly all my pictures, even after reinstalling firmware on the iphone.
    Hi thanks for your quick answer..I forget to tell you that I don't know how to enable ssh server on Leopard. It has a built in solution or I have to install another software?

  18. #17
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Quote Originally Posted by lmarr28 View Post
    Recently, I bricked my iPhone and had to restore it in iTunes. In the process, I lost a bunch of photos from my Camera Roll that hadn't been saved to my computer yet. After an endless amount of Google searching, I finally found a way to recover, or "undelete" data from the iPhone. This guide will focus on recovering photos, since that's what I had to do, but the same process could be used to recover other lost data.

    What you'll need:
    - Jailbroken iPhone
    - BSD Subsystem and OpenSSH installed on your iPhone
    - Terminal (or MobileTerminal) installed on your iPhone
    - An SSH server installed on your computer (mine is running Ubuntu 7.10 with OpenSSH)
    - The 'DD' utility installed on your computer (this should be pre-installed on most Linux systems)
    - Your iPhone's IP address
    - Your computer's IP address

    First, make sure that your iPhone and computer are on the same LAN. You can try to ping your computer from your iPhone (using Terminal) and vice versa, just to make sure they can see each other on your LAN. For example:
    Code:
    ping 192.168.1.215
    Next, you'll want to make sure that you can SSH into your computer from the iPhone. To do that, open Terminal on the iPhone and enter:
    Code:
    ssh <username>@<computer-ip>
    Where:
    <username> = Your user name on the computer.
    <computer-ip> = Your computer's IP address on the LAN.

    If that worked, you should be prompted to enter a password for <username>. If the connection times out, then you need to make sure that you have the SSH server running on your computer and make sure that port 22 (the default SSH port) isn't being blocked by your router's firewall.

    Once you know that your iPhone and the computer are talking to each other, open Terminal on the iPhone and run the following command to begin transferring the iPhone's "disk" image to your computer (be sure to run this as root using 'su'):
    NOTE: Make certain that your iPhone's screen lock is disabled first. If the screen lock comes on, it will kill the SSH connection. Also, you'll want to connect your iPhone to its charger. This transfer can take a while.
    Code:
    dd if=/dev/disk0 | ssh <username>@<computer-ip> 'dd of=iphone-dump.img'
    The above command will create a "disk" image of your iPhone (named "iphone-dump.img") on your computer. Feel free to use a different name or a different destination directory. For example: 'dd of=/home/username/iphone-dump.img'.

    Also, be sure that you don't mix up the "if" (input-file) and "of" (output-file) in the command above. Doing so could wipe-out your iPhone.

    After the process has completed and the iPhone's image file has been saved to your computer, you can use a program like PhotoRec to recover your photos.

    I hope this helps!
    I get the "pemission dennied" message too. I logged in as SU, installed ALL fixes to terminal but no success. Any Ideas???
    UPDATE:
    It ask me for a password (after "permission denied" message) I type my system pass and then this text apperas on terminal:
    0+0 records in
    0+0 records out
    0 bytes transferred in 0.000047 secs (0 bytes/sec)

    Any ideas?
    Last edited by flager; 08-11-2008 at 09:10 AM.

  19. #18
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    I get the "pemission dennied" message too. I logged in as SU, installed ALL fixes to terminal but no success. Any Ideas???
    UPDATE:
    It ask me for a password (after "permission denied" message) I type my system pass and then this text apperas on terminal:
    0+0 records in
    0+0 records out
    0 bytes transferred in 0.000047 secs (0 bytes/sec)

    What am I doing wrong??
    Last edited by flager; 08-11-2008 at 12:35 PM. Reason: Automerged Doublepost

  20. #19
    What's Jailbreak?
    Join Date
    Aug 2008
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    Hi flager,
    on the G5 (running Leopard), go into the system preferences > sharing and make sure "remote login" is ticked. It should also show you how to log in via ssh into that machine.
    I would try now to log in from the phone to the G5. At the terminal on the phone type "ssh username@ipaddress". with no inverted commas and you G5 login username and ip address info of the G5. You will probably have to type "yes" to allow the ssh connection, however eventually it should log you in. Now type "exit" to log off of the G5 and try the command on the phone:
    dd if=/dev/disk0 | ssh <username>@<computer-ip> 'dd of=iphone-dump.img'

    you may need to be su user on the phone, just type su and the password alpine (I think...) to become su user on the phone.

    good luck

  21. The Following User Says Thank You to scroll1 For This Useful Post:

    flager (08-19-2008)

  22. #20
    My iPhone is a Part of Me rwin84's Avatar
    Join Date
    Nov 2007
    Location
    Orlando, FL
    Posts
    679
    Thanks
    3
    Thanked 16 Times in 16 Posts

    Does anyone know how to access a phone which is password protected with a failure of the touchscreen on the lower portion of the screen (cant put pw in)??? i just need to get the contacts out...
    This is getting a lil' ridiculous...

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts