I just checked the install scripts and /data/dalvik-cache "symlinks" to /system/sd/dalvik-cache (only when you have an ext partition of course). Symlink = Symbolic Link, http://en.wikipedia.org/wiki/Symbolic_link
This way the Android system still thinks the dalvik-cache is located at /data/ and can access it in a normal way, but underwater it is stored on the SD ext partition.
You can view the symlinks with "ls -l". An example would be:
lrwxrwxrwx 1 0 0 17 May 2 22:12 d -> /sys/kernel/debug
where /d/ is a symlink to /sys/kernel/debug/
Removing dalvik-cache under recovery, would delete the symlink reference only but not the contents on the SD ext partition. Simply because the ext-partition it ain't mounted under recovery (it is done via the init.d script).
Also.. I ain't sure it is safe to remove the dalvik-cache when the system is running, while removing it under recovery might be troubling as you have to mount the ext partition of your sd-card.
Which recovery are you using?
Small mock-up what you could write under recovery (via adb shell):
mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /sd-ext;
chown 1000:1000 /sd-ext;
chmod 771 /sd-ext;
rm -rf /sd-ext/dalvik-cache;
Devices: HTC One X, HTC Hero GSM
My Github: linky
- HTC One X kernel playground, based on Franco's
- 2.6.35 port for the Hero