A method and apparatus is provided for maintaining data integrity. According
to
the method, a physical checksum calculation is performed on a block of data. After
performing the physical checksum calculation, a logical check is performed on the
data contained with the block of data. If the block of data passes the logical
check, then the block of data may be written to nonvolatile memory. Thereafter,
when the block of data is read from nonvolatile memory a physical checksum verification
procedure is performed on the block of data to determine whether the block of data
was corrupted after performing the logical check on the data contained with the
block of data.