Android: Partitioning your 16GB card

MAJOR WARNING: The instructions below will wipe your SD-card for good. So make sure that you want to do this. (Follow my backup instructions just in case)

If you are running Cyanogen or a similar firmware which requires 3 partitions (FAT32, EXT3/4 and Swap), then execute the following commands which in short does the following: repartition your SD-card with a FAT32, EXT3 and swap partition and then convert EXT3 to EXT4:

parted /dev/block/mmcblk0
print
rm 1
rm 2 (if you have a 2nd partition)
rm 3 (if you have a 3rd partition)

Then run this for a 16GB SD-card:
mkpartfs primary fat32 0 15416
mkpartfs primary ext2 15416 15916
mkpartfs primary linux-swap 15916 15948

Then run this for a 8GB SD-card:
mkpartfs primary fat32 0 7425
mkpartfs primary ext2 7425 7937
mkpartfs primary linux-swap 7937 7969

Complete the partitioning and convert to EXT4:
upgrade_fs
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -fpDC0 /dev/block/mmcblk0p2

The above should be done from the recovery-console (turn off phone and then Home + Power-button). If you use App2SD all your apps will be gone and some of the widgets will fail. The above is the perfect way of starting out fresh. I would recommend doing a Wipe as well as install of the latest firmware afterwards.