Can checksum from metadata be exported?

byenilmez

Cadet
Joined
Feb 18, 2021
Messages
4
Hi,

I'm new to ZFS so I might be wrong. But as far as I understand, ZFS keeps checksum (default:flether) of each file in metadata.
Is it possible to get this metadata so that I can compare files in different systems without recalculating the checksum for each file (at least on Truenas)?

Thanks
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Sorry, no.
 

byenilmez

Cadet
Joined
Feb 18, 2021
Messages
4
Thank for the quick reply.
Just trying to understand how ZFS works. Is the checksum is block-based rather than file-based like in encryption?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Is the checksum is block-based rather than file-based like in encryption?
Yes. :wink:
Checksums, snapshots, deduplication, compression, ... everything is block based - apart from the filesystem presentation itself.
 

Samuel Tai

Never underestimate your own stupidity
Moderator
Joined
Apr 24, 2020
Messages
5,399
Essentially, yes. If you're willing to do some reading, here are some good links on the low-level details of ZFS:

 

byenilmez

Cadet
Joined
Feb 18, 2021
Messages
4
Thank you both. I'll go over the link.
I did some reading but I couldn't figure out how deduplication would work if the checksum wasn't file based.
Anyways, thanks again for steering me in the right direction.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I did some reading but I couldn't figure out how deduplication would work if the checksum wasn't file based.
It deduplicates blocks, not files.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
And to re-visit one of your posts about encryption, ZFS native encryption is block based as well. What this implies is that you can append, (or update part of), an encrypted file without re-writing the whole file, in ZFS. At least, I think this is what happens.
 

AlexGG

Contributor
Joined
Dec 13, 2018
Messages
171
Checksums and encryption are block-based. More precisely, record-based. What's more, if the compression is in use, the checksum is calculated on the compressed data. If the encryption is in use, the checksum is calculated on the encrypted data. This is done to avoid decrypting and/or decompressing each record when doing a scrub. You don't even need a decryption key to do the scrub on the encrypted volume, because checksum covers what was written to disk, not the data in the file.
 
Top