Do a total wipe of my device I have flashed my ROM several times with different ROMS, and sometimes back to stock. I flashed roms, modems, kernels etc.

But the flashing never seems to totally format the device, because the folders of old software keep showing up on the phones hard drive. 

Is there a way to completely format my device, and install a new rom afterwards.

I have a Samsung Galaxy 2s running gingerbread 2.3

If this question is already ask this can be closed and redirected. I could not find a similair question.
To completely format your device, you need to use Odin and an Odin-able ROM (preferably stock).  Note that the device can't be blank.  You should always have firmware on it.


Download Odin 1.85 from here and extract it.
Download stock firmware (listed here), you probably want JPKF3.
Put your phone into Download mode (you may have to attempt this a couple times):


Power off the phone
Hold VolDown+OK:

Click the Power button
Let go of VolDown+OK when the Android icon with "Downloading..." underneath appears


Start Odin
Connect your phone to USB and ensures it shows up in Odin (a yellow box with a COM port will be shown).  If it doesn't, disconnect and reconnect.  If it still doesn't, reboot your phone and start over from (3).
Click the PDA button in Odin and choose the firmware file you downloaded.
Click Start and wait till "PASS" appears in the Message area.  If it fails, start over from (3).


Normally, to completely wipe the device, you would select "Re-partition" in Odin.  However, this apparently can brick the Galaxy S II! So don't do it.  I guess it only works consistently with the original Galaxy S.