Backup and restore options

First, here's a list of each partition and notes on whether you need to backup that partition or not.

Block name Name/purpose Backup?
nanda bootloader Yes
nandb environment Yes - used by u-boot
nandc boot Yes - contains the kernel
nandd system Yes
nande data Yes, but only if you have any apps installed or data present on this partition
nandf misc No - this partition is written to by the tablet
nandg recovery Yes
nandh cache No - this is just temporary storage so can be deleted
nandi emmc/databk No
nandj sdcard Yes, but again only if you have data present on this partition

As I see it, there are three possible ways of backing up and restoring the partitions on the tablet, depending on what sort of state it's in.

Easy: Taking partition images and re-burning them

To make an image of a particular partition, you can use cat to do a complete byte-by-byte dump to a file. Here's an example (storing the image file on the external SD card):

adb shell "cat /dev/block/nanda > /mnt/extsd/nanda.img"

To re-burn the image again, simply reverse the direction of the cat command. It's best to do this over ADB whilst booted into CWM recovery, since you're not then trying to burn a partition which is already in use. For example:

adb shell "cat /sdcard/nanda.img > /dev/block/nanda"

Remember that, when in CWM recovery, sdcard refers to the external SD card.

In theory, you could use cat for every partition. However, if this is done for the system, data, cache or sdcard partitions, it will result in a needlessly large file. cat will do a complete dump of the partition, even though there may not actually be much data on it. Since these partitions are type ext4, it's possible to compress the files themselves into a single .tgz archive which takes up much less space. To do this, run the following, assuming the tablet is booted into Android (from here):

adb.exe shell su -c "cd /system && busybox tar cvf - * | gzip -c > /sdcard/dump/system.tgz"

What does all this do? adb.exe shell tells ADB to run what comes next as a shell command on the tablet. su -c runs things as superuser and the -c switch tells su to consider everything that follows (the stuff in the quotes) as a single command (don't omit it). Next, we change to the system directory with cd /system. The && just concatenates several commands. busybox tar runs the tar command to combine lots of files into a tar archive. c tells tar to create a new archive. v tells tar to operate verbosely (list all files processed). f tells tar to use a specific filename, in this case "-", which means the standard input/output. * tells tar to operate on all the files and folders in the current (/system) directory. The output from tar is piped using | to gzip which compresses the files and -c tells gzip to write to the standard output. Lastly, the output from gzip is written to the .tgz file using > /sdcard/dump/system.tgz.

To burn this back to the partition again, you need to start up in CWM recovery mode, format the relevant partition, push the tgz file over to somewhere convenient on the tablet (e.g. the emmc or external SD card), then run

adb shell busybox tar -C /system/ -zxvf /sdcard/system.tgz

The -C switch tells tar to change to the /system/ directory before extracting. z tells it to stick the archive through gzip to uncompress it. x tells it to extract. v means verbose (list files processed). f selects the input archive to use.

Medium: Burn a stock LiveSuit image first then burn individual partitions

If you've screwed up the partitions, or CWM recovery isn't available, then the only option is to do a flash using LiveSuit of a stock firmware, then individually burn the partition backups you already have (you do, don't you?) to them manually. The LiveSuit image is able to actually create the partitions and does not require a bootable tablet.

Hard: Modify a stock LiveSuit image and burn it

As a real punishment, you can modify a stock LiveSuit image using the individual partition backups made using the easy technique. The advantage of this is that it's a one-shot process, and a single file. Just burn using LiveSuit and you're done. However, modifying the LiveSuit image is tricky.

Back to index