[Desire Android Development] ClassicalDude:
For Advanced Users:

Any advanced user can turn his or her currently flashed rom into a faster rom, and gain additional space on the data partition.

Please read everything in the first post so you know what you're about to do.

Prerequisites:

adb on your system, and you know how to use it.

An ext3 or ext4 partition after the fat partition on your sd card (512mb minimum).

Your rom is an a2sd or a2sd+ rom (not d2ext or d2we).

YOU MADE A NAND BACKUP.

1. Reboot into recovery and connect your phone to the computer. Mount system, data and sd-ext. Use adb to move files from /system to /sd-ext:

adb shell
mkdir /sd-ext/system
mkdir /sd-ext/system/app
mkdir /sd-ext/system/framework
mkdir /sd-ext/system/fonts
mv /system/app/* /sd-ext/system/app/
mv /system/framework/* /sd-ext/system/framework/
mv /system/fonts/* /sd-ext/system/fonts/

2. Now we have to symlink all the files we moved. This was a trial and error process for me, since I am not a programmer. But it works.

First of all, we create files that list all the names of the files we moved:

ls /sd-ext/system/app > /tmp/sysapp
ls /sd-ext/system/framework > /tmp/sysframe
ls /sd-ext/system/fonts > /tmp/fonts

Now we check how files are already symlinked to the ext partition in our rom (so we know how to symlink ours):

ls -all /data

This will show you the symbolic links. In my case, for instance, they were pointing at /system/sd, which is common.

Now we use arrays to create all the symlinks we need. Replace /system/sd if necessary:

c=0; while read line; do array[c]=`ln -s /system/sd/system/app/"$line" /system/app/`; let c=$c+1; done < /tmp/sysapp
c=0; while read line; do array[c]=`ln -s /system/sd/system/framework/"$line" /system/framework/`; let c=$c+1; done < /tmp/sysframe
c=0; while read line; do array[c]=`ln -s /system/sd/system/fonts/"$line" /system/fonts/`; let c=$c+1; done < /tmp/fonts

This will give you a nice output of errors, but will get the job done. Just to make sure, run these commands:

ls -all /system/app
ls -all /system/framework
ls -all /system/fonts

If all is well, you just viewed your newly created symlinks.

You can run the command

df

in order to see your new memory usage.

Now you can reboot your device. If all went well, you will notice absolutely no difference from before. If this is the case, make a second nand backup (without deleting the first one).

3. So now we have a nand backup of our rearranged rom. It is time to go to http://alpharev.nl, if you have not done so already, and follow the instructions there in order to s-off your device. If you are modifying a regular Sense rom (or anything without Sense) then choose to flash the oxygen hboot. For HD roms, choose the data++ hboot.

4. Restore your second nand backup.

5. If you used a2sd+, you need to move the dalvik-cache back to your internal memory, on the /data partition (that has plenty of space for it now).

If your a2sd is darktremor's script, you can simply enter

adb shell a2sd nocache

while your device is running (NOT in recovery) and reboot.

If you have a different a2sd script, you need to reboot to the recovery, and use adb to find out where it is:

adb shell mount /system
adb shell ls /system/etc/init.d

This will show you what's the name of your script. Mine was the usual 40a2sd.

Pull this file from your device:

adb pull /system/etc/init.d/40a2sd

Open the file in a text editor, search for every occurrence of "dalvik-cache" and "app-private" and delete them, without harming the command's syntax. Save the file (don't forget to back it up as well), push it back to the device and restore its owner and permissions:

adb push 40a2sd /system/etc/init.d
adb shell chown root:shell /system/etc/init.d/40a2sd
adb shell chmod 755 /system/etc/init.d/40a2sd

Now all we have to do is to move the actual dalvik-cache and app-private.

adb shell mount /data
adb shell mount /sd-ext
adb shell rm /data/dalvik-cache
adb shell mv /sd-ext/dalvik-cache /data/
adb shell rm /data/app-private
adb shell mv /sd-ext/app-private /data/

That's it. Reboot, and you'll notice an increase in performance, as well as in storage space on the data partition.

Remember: from now on you cannot flash new themes with the usual recovery zips (unless you opted to leave the file framework-res.apk inside the original /system/framework folder). You have to push the files through adb.

Also, if you use the data++ layout, you have to use fastboot to flash new radios, and you may have trouble installing very large apps.

There is a way to enable the installation of large apps from the market, but this is for EXTREMELY advanced users, so I will not even go into details. Simply follow the section "Fixing market downloads" in the first post and flash your new boot.img using fastboot flash boot boot.img.