1. A method of storing data from a host, comprising: dividing a flash memory into a plurality of memory groups, the memory groups each comprising a plurality of flash memory blocks; allocating a first portion of one of the plurality of memory groups for storing parity data of an error-correcting code for the memory group; allocating a second portion of the memory group for storing data from the host; using a controller to erase a flash memory block in the memory group prior to writing the data from the host, wherein the flash memory block contains valid data; and recovering the erased valid data using the error-correcting code.