3

I'm trying to do this, I'm sure you don't wanna read all that then I'll make a resume on it: A file was accidentally deleted on a iPod4, I need to recover it and I've been able to do all the process through SSH and DD.

I was using this command:

root@g1:/home/gustav# ssh [email protected] dd if=/dev/rdisk0s2s1 bs=1M | dd of=iphone-use2.img
[email protected]'s password: 
Write failed: Broken pipe
4113088+0 records in
4113088+0 records out
2105901056 bytes (2.1 GB) copied, 51107.2 s, 41.2 kB/s

And then I was having this error - I had the error twice, the first time I had it I could make a ISO file of ~11GB, the second time I've made a file of ~2GB. I presume the dd process can stop due to unknown reasons then I had the idea of using the DD to make splits of the iPod's harddrive.

Then I've started to use these commands:

ssh [email protected] dd if=/dev/rdisk0s2s1 of=iphone1.img bs=1M count=1024
ssh [email protected] dd if=/dev/rdisk0s2s1 skip=1024 of=iphone1.img bs=1M count=1024
...

The problem now is: When I was using the first command, the DD was copying the ISO file to my computer, with this second command it's copying the ISO file to the iPod's harddrive, how can I specify where the output file is going? I want it copied to my computer, I'm aware that it may involve some alteration on the of argument but I don't know how to do it, can you help me?

Also, why the first command make a copy of the iPod's disk to my computer drive and the second make a copy of my iPod's disk to itself, if the of argument is similar on both?

1 Answer 1

3

Seems like your SSH session is cutting out. I've expirienced a similar problem in a different situation. Try adding this line to your /etc/ssh/ssh_config file on your PC:

ServerAliveInterval 120

Give it a try and see if that prevents your Broken Pipe errors.

As for your command your missing something. It should be:

ssh [email protected] dd if=/dev/rdisk0s2s1 bs=1M count=1024 | dd of=iphone1.img

You forgot to pipe the dd output to your PC.

13
  • This won't solve the problem, even doing that I can have problems with router, power, etc. I need to find a definitive way for doing it, and I guess this way is through the splitted images.
    – Red Banana
    Dec 3, 2012 at 5:03
  • @GustavoBandeira WiFi reliability isn't a real problem. Hasn't ever stopped me from copying large files between devices before. Anyway I've addressed your dd issue as well. Check my edited Answer.
    – japzone
    Dec 3, 2012 at 5:10
  • Yeah, but here the power is a little unstable. The | means "pipe out of the device"?
    – Red Banana
    Dec 3, 2012 at 5:13
  • The | symbol means "pipe output of this to input of that" so basically the command is this: "ssh connect to iPod, use dd to read /dev/rdisk0s2s1, pipe output of ssh command(reading of disk) to dd and write data to file 'iphone1.img'"
    – japzone
    Dec 3, 2012 at 5:20
  • Everybody has lapses :)
    – japzone
    Dec 3, 2012 at 5:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .