This is a script which will try to answer the question of what sort of data corruption ZFS might see.

If you have an unprotected ZFS file system and a file which consistently causes a checksum mismatch, then this script would help us to determine the extent of corruption. If you don't have that case, then it will remain quiet.

This version is very limited, unfortunately. The expected checksum and a tracemem of a portion of the mismatched buffer are printed. What is missing is the actual checksum and automatic sizing of the tracemem.

Usage: zcksummon.ksh [-p poolname]
    -p poolname   # only look at poolname
    -s integer    # tracemem the first <integer> bytes

        zcksummon.ksh # default, monitors all pools
        zcksummon.ksh -p rpool   # monitor rpool only
        zcksummon.ksh -s 1024    # tracemem the first 1024 bytes of the mismatched buffer

            when a checksum mismatch is found, information is
            printed which will show the expected checksum, calculated
            checksum and a dump of the buffer.  Otherwise, there is no

Richard Elling,
Jul 8, 2009, 5:42 PM