Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jun 2011 17:57:16 -0400
From:      Robert Simmons <rsimmons0@gmail.com>
To:        freebsd-fs@freebsd.org
Subject:   Re: Getting access to checksums.
Message-ID:  <BANLkTim4=rvn=2A9N=_wx3y3YrHA3sqyWA@mail.gmail.com>
In-Reply-To: <4DF11BB8.5030805@dannysplace.net>
References:  <4DF11BB8.5030805@dannysplace.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Thu, Jun 9, 2011 at 3:15 PM, Dan Carroll <fbsd@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTim4=rvn=2A9N=_wx3y3YrHA3sqyWA>