This question already has an answer here:
Raspberry Pi runs on Linux and the filesystem is prone to corruption when power is abruptly removed or improperly shutdown. Sometimes, users are just impatient to wait for proper shutdown to be completed. When corruption happens, RPi may even have problem booting up. How can one prevent filesystem on the SDcard?