Complete ipod backup

Discussion in 'Application Ideas' started by Ezekeel, Mar 29, 2009.

  1. Ezekeel

    Ezekeel New Member

    Mar 15, 2009
    Likes Received:
    iPhone 3GS (Black)
    I was thinking about a way to make a complete backup of my ipod.

    The standard procedure for a linux machine is to boot up using a CD linux distribution like Knoppix (so you do not have to mount the filesystem) and then use dd, gzip and ssh to make a complete backup of the filesystem and send it to another linux machine where it is stored. For a restore you boot the machine with CD and restore from the other machine where the backup file is stored.

    Since dd, gzip and ssh are also available on the ipod I thought it might be possible to do a similar thing for the ipod. I do not know much about the ipod since I only have mine for three days however I read in the forum about iRecovery and if I am not mistaken you can access the processor and ram over the USB cable. So a possible way to do it might be to built a ramdisk with some light-weight OS which is able to access the ipod filesystem, supports wifi and provides dd, gzip and ssh, put it into the ipod ram and boot the ipod from the ramdisk without touching the ipod filesystem.

    This however sounds like a lot of work and I though maybe you can do it in a quick and dirty way. I rebooted my ipod, switched on KeepAwake and locked the ipod to minimize the activity of programs running. I connected over ssh and remounted the larger disk0s2 partition mounted on /private/var as read-only with

    umount -f /dev/disk0s2
    mount -t hfs -o ro /dev/disk0s2 /private/var

    which worked without crashing the ipod. You can even unlock the ipod and run some games and apps. Most apps claim that the internet connection is broken, however the ssh connection still works fine.
    Sadly the same does not work with the small disk0s1 partition mounted on / since the OS is stored there. It might be possible to backup disk0s2 first, then copy the content of disk0s1 over to disk0s2 and then boot only using disk0s2. Maybe someone has an idea to do that without much work since I do not. A quick and dirty way to get around this problem, would be to copy all files on disk0s1 to disk0s2 and only backup disk0s2. Then when restoring copy the files back, overwriting the files on disk0s1 hopefully without crashing the OS.

    I would try this idea, however my ipod is already packed with 12GB of stuff and I finally have everything setup the way I want it to be, so I am not too eager to risk losing all that. Maybe someone of you has a spare ipod for testing.

    Backup ipod:

    Reboot the ipod, activate KeepAwake and lock the ipod. Log in over ssh as root and

    cd /private/var
    rm -rf disk0s1
    mkdir disk0s1
    cd disk0s1
    cp -rpP /Developer .
    cp -rpP /Library .
    cp -rpP /System .
    cp -rpP /bin .
    cp -rpP /boot .
    cp -rpP /cores .
    cp -rpP /lib .
    cp -rpP /mnt .
    cp -rpP /private/etc .
    cp -rpP /sbin .
    cp -rpP /usr .
    cd /
    umount -f /dev/disk0s2
    dd if=/dev/disk0s2 bs=1k conv=sync,noerror | gzip -c | ssh -c blowfish user@host "dd of=ipod.gz bs=1k"

    Restore ipod:

    Reboot the ipod, activate KeepAwake and lock the ipod. Log in over ssh as root and

    umount -f /dev/disk0s2
    dd of=/dev/disk0s2 bs=1k | gunzip -c | ssh -c blowfish user@host "dd if=ipod.gz"
    mount -a
    cd /private/var/disk0s1
    cp -rpfP Developer /
    cp -rpfP Library /
    cp -rpfP System /
    cp -rpfP bin /
    cp -rpfP boot /
    cp -rpfP cores /
    cp -rpfP lib /
    cp -rpfP mnt /
    cp -rpfP etc /private
    cp -rpfP sbin /
    cp -rpfP usr /

    EDIT: rearranged the backup procedure a bit
    EDIT2: corrected a noob mistake
  2. xsouldeath

    xsouldeath New Member

    Sep 8, 2009
    Likes Received:
    anyone have luck with this?
  3. geekgrrl

    geekgrrl Member

    Oct 14, 2008
    Likes Received:
    5G iPod touch
    How about Copy to PC everything in iFunBox?

    Then, Copy from PC.

    Would it work?

Share This Page