The present invention includes a method of managing page-based data
storage media such as flash media, a system that uses the method, and a
computer-readable storage medium bearing code for implementing the
method. For each page, a corresponding risk zone, of other pages whose
data are put at risk of corruption if writing to the page is interrupted,
is identified. When a page is selected for writing new data, the written
pages in its risk zone are copied to a log. As necessary, corrupt data
are replaced with corresponding data from the log.