[Galaxy S II Android Development] Lanchon:
it's working!!!!

it's very smart, it tries to check ***everything*** beforehand. and if it did have a problem, mostly it should be able to continue where it left off on a later run, provided there was no corruption on resizes or partition moves.

i have to create and destroy temporary partitions all over the place to read and write data with dd in small chunks, given that dd break bad with big offsets.

it can wipe or move or resize ext4 and vfat partitions and gets the ordering and planning right so that everything can work out, and is able to restart where it left off is something goes wrong.

here is a run, the config is:

system_size="1024 $MB"

system_content=keep

data_size="1024 $MB"

data_content=keep

sdcard_size="10 $GB"

sdcard_content=keep

sdcard_fs=vfat

preload_size="8 $MB"

preload_content=wipe

#preload_fs=ext4

check it out :)

===== PREPARATION =====
info: checking tool: parted
unmounting all partitions
info: rereading partition table
checking existing partition layout
WARNING: the existing partition layout has unused space at the end of the disk
checking new partition layout
WARNING: the new partition layout has unused space at the end of the disk

===== DRY-RUN =====
analyzing partition #9 /system (FACTORYFS)
info: partition #9 /system (FACTORYFS) will expand into disk area of partition #10 /data (DATAFS)
info: deferring processing of partition #9 /system (FACTORYFS)
analyzing partition #10 /data (DATAFS)
info: partition #10 /data (DATAFS) will expand into disk area of partition #11 /sdcard (UMS)
info: deferring processing of partition #10 /data (DATAFS)
analyzing partition #11 /sdcard (UMS)
***** processing partition #11 /sdcard (UMS)
info: will move/resize the vfat partition
info: checking the file system
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
Starting check/repair pass.
Starting verification pass.
/dev/block/mmcblk0p11: 48 files, 105249/3139585 clusters
analyzing partition #12 /preload (HIDDEN)
***** processing partition #12 /preload (HIDDEN)
info: will format the partition in ext4 and trim it
info: checking tool: mke2fs
***** processing partition #10 /data (DATAFS)
info: will move the ext4 partition
WARNING: moving a big ext4 partition can take a very long time
(it requires copying the complete partition, including its free space)
info: checking tool: dd
info: will resize the ext4 partition
info: checking tool: resize2fs
info: checking and trimming the file system
/dev/block/mmcblk0p10: 11/32768 files (0.0% non-contiguous), 2113/131072 blocks
***** processing partition #9 /system (FACTORYFS)
info: will resize the ext4 partition
info: checking tool: resize2fs
info: checking and trimming the file system
/dev/block/mmcblk0p9: 11/32768 files (9.1% non-contiguous), 10449/131072 blocks

===== EXECUTION =====
analyzing partition #9 /system (FACTORYFS)
info: partition #9 /system (FACTORYFS) will expand into disk area of partition #10 /data (DATAFS)
info: deferring processing of partition #9 /system (FACTORYFS)
analyzing partition #10 /data (DATAFS)
info: partition #10 /data (DATAFS) will expand into disk area of partition #11 /sdcard (UMS)
info: deferring processing of partition #10 /data (DATAFS)
analyzing partition #11 /sdcard (UMS)
***** processing partition #11 /sdcard (UMS)
info: moving/resizing the vfat partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: checking the file system
dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
Starting check/repair pass.
Starting verification pass.
/dev/block/mmcblk0p11: 48 files, 105249/2616320 clusters
analyzing partition #12 /preload (HIDDEN)
***** processing partition #12 /preload (HIDDEN)
info: deleting the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: recreating the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: naming the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: formatting the partition in ext4 and trimming it

Warning: the fs_type small is not defined in mke2fs.conf

***** processing partition #10 /data (DATAFS)
info: moving the partition
info: deleting the partition to workaround dd's 4GB wraparound bug
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: moving data towards the end of the disk

----- move 256 MB chunk: 936 MB -> 1448 MB
info: creating temporary partition to read chunk at offset 936 MB
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: reading data
256+0 records in
256+0 records out
268435456 bytes (256.0MB) copied, 15.177735 seconds, 16.9MB/s
info: deleting the temporary partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: creating temporary partition to write chunk at offset 1448 MB
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: writing data
256+0 records in
256+0 records out
268435456 bytes (256.0MB) copied, 19.601633 seconds, 13.1MB/s
info: deleting the temporary partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?

----- move 256 MB chunk: 680 MB -> 1192 MB
info: creating temporary partition to read chunk at offset 680 MB
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: reading data
256+0 records in
256+0 records out
268435456 bytes (256.0MB) copied, 15.246780 seconds, 16.8MB/s
info: deleting the temporary partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: creating temporary partition to write chunk at offset 1192 MB
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: writing data
256+0 records in
256+0 records out
268435456 bytes (256.0MB) copied, 19.268291 seconds, 13.3MB/s
info: deleting the temporary partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?

info: recreating the final partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: naming the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: checking and trimming the file system
/dev/block/mmcblk0p10: 11/32768 files (0.0% non-contiguous), 2113/131072 blocks
info: enlarging the partition entry
info: deleting the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: recreating the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: naming the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: enlarging the ext4 file system
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/block/mmcblk0p10 to 262144 (4k) blocks.
The filesystem on /dev/block/mmcblk0p10 is now 262144 blocks long.

info: checking and trimming the file system
/dev/block/mmcblk0p10: 11/65536 files (0.0% non-contiguous), 4203/262144 blocks
***** processing partition #9 /system (FACTORYFS)
info: enlarging the partition entry
info: deleting the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: recreating the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: naming the partition
Warning: Not all of the space available to /dev/block/mmcblk0 appears to be used, you can fix the GPT to use all of the space (an extra 2048 blocks) or continue with the current setting?
info: rereading partition table
info: enlarging the ext4 file system
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/block/mmcblk0p9 to 262144 (4k) blocks.
The filesystem on /dev/block/mmcblk0p9 is now 262144 blocks long.

info: checking and trimming the file system
/dev/block/mmcblk0p9: 11/65536 files (9.1% non-contiguous), 12635/262144 blocks

===== SUCCESS =====

it needs proper packaging and configuration still