I have a noob question. I'm planning to buy an android phone which doesn't include sdcard slot. Only internal memory. I am now using HTC Desire S which include sdcard slot. I change ROM on my phone so often. What I'm worried about is, will formatting data before flashing ROM going to remove all data in internal memory as the one I'm planning to buy rely only on internal memory. Or does HTC make some partition for something like virtual sdcard space that is stay untouched even wiping data from recovery?
It depends on how the particular recovery you will choose to install handles user data.
Most recent versions of commonly used recovery images (e.g. TWRP and ClockworkMod) recognize the need to keep certain portions of internal memory on devices without removable storage. On such devices the
/sdcard mount point is still present, but is pointing to
/data/media partition instead. When doing a regular factory reset, this
/data/media partition is left untouched. If you really wish to clear that area as well, in ClockworkMod recovery, for example, you would need to navigate to
mounts and storage and use the
format /data and /data/media(/sdcard) option.
Terminology is important in this case...
/data will wipe out your internal
/data, on the other hand, will usually not erase your sdcard.
Usually you don't need to actually format
/data/, and wiping (usually called a "Factory Reset") will suffice.
/sdcard/ lives in
/data/media. When doing a factory reset, the recovery will delete everything in
/data/ except for
/data/media/. In fact, when factory resetting, my recovery will tell me "wiping /data, skipping /data/media". However, when formatting, you cannot be selective like that. Formatting will wipe out everything on a mount point.