Detecting data corruption includes receiving one or more blocks of data to
be written to a storage device, selecting a portion of the data in the
blocks (e.g., one or more bytes or data words), applying a rule to derive
information characterizing the selected portion of data (e.g.,
calculating a checksum for the for the portions of data selected from the
block to be written), and storing this information. After the data has
been written to the storage device, the store information is used in
deciding whether the data has been corrupted.