Were you trying to root your phone? Did you recently mess with some settings, install a third-party app, etc? How do you think this happened? Has it happened before or is this the first time?
If you don't mind resetting the phone back to factory, you could do a hard reset. Turn the phone off, then hold down the Power and Volume Down buttons simultaneously. The Factory Hard Reset screen should appear. Press the power button once and then again to confirm your selection. Just a warning: you will lose all data on your phone if you do this. Your phone will be reset back to factory settings, like it's new out of the box.
I'm not sure if this will reformat the SD card or not, but you could always take it out beforehand. However, I'd just back up anything on the card and reformat the card too anyway, just to eliminate any possible causes.