Getting access to checksums.

Robert Simmons rsimmons0 at gmail.com
Thu Jun 9 21:57:18 UTC 2011


On Thu, Jun 9, 2011 at 3:15 PM, Dan Carroll <fbsd at dannysplace.net> wrote:
> I'm currently working on a system that monitors file changes.
> I'd like to calculate the checksums on each file both to see if a change has
> occured as well as looking for duplicate files.
>
> I'm not sure what algorithm I'll end up using but I was wondering if it was
> possible to get access to ZFS' checksumming?
> Does it happen on a file level or is it block level only?  And if it does,
> is there an easy way to obtain this information from the system?

You may not want to reinvent the wheel.  There are quite a few ports
that do what you want, more or less.  You may want to start there, and
if they don't serve your purpose, then maybe do it the hard way.  ;)

The main one is the famous Tripwire:
http://www.freebsd.org/cgi/url.cgi?ports/security/tripwire/pkg-descr
http://www.freebsd.org/cgi/url.cgi?ports/security/tripwire12/pkg-descr
http://www.freebsd.org/cgi/url.cgi?ports/security/tripwire-131/pkg-descr

Then there are some replacements for Tripwire that you may want to
look at as well:
http://www.freebsd.org/cgi/url.cgi?ports/security/aide/pkg-descr
http://www.freebsd.org/cgi/url.cgi?ports/security/yafic/pkg-descr

Also, if you really want to roll your own, just write a script and use
the built-in checksum utilities:
http://www.freebsd.org/cgi/man.cgi?query=sha256&apropos=0&sektion=0&manpath=FreeBSD+8.2-RELEASE&format=html

And find(1):
http://www.freebsd.org/cgi/man.cgi?query=find&apropos=0&sektion=0&manpath=FreeBSD+8.2-RELEASE&format=html


More information about the freebsd-fs mailing list