Can you list internal checksums of a ZFS filesystem?

CH freebsd-fs at ch.pkts.ca
Wed Jul 18 05:08:03 UTC 2012


On Tue, 17 Jul 2012 23:54:38 +0100
"Steven Hartland" <killing at multiplay.co.uk> wrote:

> ----- Original Message ----- 
> From: "CH" <freebsd-fs at ch.pkts.ca>
> To: <freebsd-fs at freebsd.org>
> Sent: Tuesday, July 17, 2012 11:26 PM
> Subject: Can you list internal checksums of a ZFS filesystem?
> 
> 
> > Hello list,
> > 
> > I'm moving data to a ZFS filesystem, and it's a ton of big files
> > (more than 3 terabytes).  I don't trust the network copy command
> > completely, and so I'd like to compare checksums.  I'm not looking
> > forward to it, since it's going to be a slow process, especially if
> > I can't run the command on the server. 
> > 
> > Since ZFS already has computed and stored checksums for every file
> > on the destination machine, is there an easy way to extract that
> > from the filesystem? Perhaps 'ls -lR --checksums' or similar?
> > 
> > Note, checksums still have to be calculated on the source machine,
> > and so the overall operation will still take the same length of time
> > (assuming ZFS is faster than HFS+), but it does save a lot of cpu
> > and disk reads on the destination machine, which can then be used
> > for other things.
> 
> IIRC it's block level checksums, not file level ones, so I don't think
> this will be what you're looking for.
> 
>     Regards
>     Steve

You're right, block-level checksums would be less efficient, and
there probably isn't a handy program out there for generating the same
block-level checksums on a non-ZFS system.  I suspect it wouldn't
(shouldn't?) be hard: for each file, while not eof, read block, checksum
block, print checksum, repeat, compare list of checksums, do next file.
As long as the checksum algorithm and the block size are the same, the
thing should work.

In any case, if the checksums are effectively unreachable from
userspace, then I should just recalculate file-level checksums.

Thanks
CH


More information about the freebsd-fs mailing list