UPDATE: This is a partition clone, it has the same result as the following dd command executed on iPhone:
dd if=/dev/disk0s1 of=disk0s1.dmg bs=1048576 count=300
The only difference is: dd is running on iPhone, this method is running on your Mac.
—
I’ve figured out a way to backup and restore the iPhone system, with the help of iPHUC. It can restore your system (activation, 3rd party apps, ringtones, wallpapers, etc) on-the-fly.
This method only works when iPHUC can putfile to your phone, which normally means the phone can still enter the normal mode, you can’t do this when you’re stuck at ‘Connect to iTunes for recovery’.
Preparation
1. Before the backup/restore can be done, you have to setup a device node for the system partition. Enter the following command (in SSH shell):
mknod /var/root/Media/rdisk0s1 c 14 1
This creates a device node in user partition, which offers you the opportunity to restore the system when it mulfunctions.
2. Install BSD Subsystem and OpenSSH on your phone so that you can login and do fixup after a restore.
Backup the System
To backup the current system partition, start the iPHUC, then enter the following command:
getfile rdisk0s1 iphone_sys_dump 314572800
It will take about 5 minutes to finish. This command dumps the current running iPhone system partition to a file named ‘iphone_sys_dump’, the file is 300MB in size. The dumped partition may later be used to restore your system to the current state. So keep it in a safe place.
Restore the System
If for some reason your phone doesn’t work properly, and it’s still in normal mode (not in recovery mode), start the iPHUC, then issue the following command to restore it:
putfile iphone_sys_dump rdisk0s1
The above command put back the dumped partition into the phone, it’ll take about 1 minute to finish. When it’s done, reboot the phone immediately.
After the reboot, some data in the system (e.g. the file count) may not be correct. We need to fix the issue using SSH. Login to your phone, then enter the following commands:
mount -u -o ro /
fsck
The first command remounts the system partition in read-only mode which allows fsck to fix any possible issues. The second command does the fix. Once the fsck is done, reboot your iPhone, it’s now back to the state when the dump was made.
Your user data will not be wiped during the system restore.
Notes
1. Do not use the above method to restore a different firmware version other than the one currently running on your phone, you may render the phone bricked if you try it and have to do a full restore to recover, which wipes out all your data.
2. I use this method to quickly setup a new phone. First jailbreak the phone (no activation required), then restore a backup, after that, all the previously installed stuffs are ready to run. Some applications may require extra data (normally store under /var/root/Library), such applications will not run.
E.g. Installer checks the data files in /var/root/Library/Installer, unless you upload the required files (LocalPackages.plist, RemotePackages.plist, PackageSources.plist and TrustedSources.plist) into that folder, it will not run. UPDATE: for Installer 3.0, you should remove it and let Installer create it again.

6 Comments
so,basically i can always revert back from 113 soft-update to 112 (jail-broken,4.6 BL) by using this method, right?
Actually, the soft-update uses the similar way to ‘restore a disk image back to the system partition’. Besides, the soft-upgrade is just a homebrew firmware update without baseband update, and it does not touch baseband, so you can always downgrade in case something’s totally messed.
mmmm, I find this quite interesting, but I’m not sure of what happens with the installed apps…
and how about if I had used bosstool to move my apps??
could you be more specific on that?
It’s a partition clone, imagine it like a Norton Ghost, you get everything back when you restore. For your specific question, let’s consider a similar situation in Windows, you create a shortcut in drive C:, which points to a folder in drive D:, when you clone your C: and later restore it, all your shortcuts are still there right? This iPhone clone/restore behaves the same, except on iPhone, your system partition is /dev/disk0s1 (like your C: on Windows), your user partition is /dev/disk0s2 (like you D: on Windows). So when you move applications to user partition and create symbolic links in system partition, after restoration, all your symbolic links are still there and still work (given the user partition is not wiped), but your real applications will not be restored because they’re stored in user partition.
I cant get this to work on a 1.1.3 iPhone
i think i successfully the node, but doesn’t the node need to be under mobile b/c of the permissions problem with 1.1.3…..after i try to run the getfile command to create my backup iPhuc said it couldnt access the remote file
anything like this for 2.0? 2.0.2 specifically…