Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Apparently, in the ZFS (filesystem), there is an uberblock that points to the root of a zpool tree. Does anyone know why this tree makes things more efficient/reliable, and where the tree itself is stored?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

The purpose of the tree is to improve data integrity, partly by storing checksums away from the data blocks those checksums protect. The entire file system hierarchy forms a self-healing hash tree, or merkle tree. Here's a simplified description I made earlier:

ZFS data integrity example

Going from left to right, directory 1 contains a pointer to file A, file A's checksum, and some other meta-data. But dir 1 is just another data block, which is pointed to by the uberblock. The uberblock therefore contains a checksum of dir 1, and so on. This does mean that every write to a file involves recalculating several checksums, all the way back to the root node (the uberblock). But ZFS's copy-on-write policy and transactional nature mitigate the performance penalty. Furthermore, ZFS is designed to take advantage of Moore's law: CPU cycles are cheap, but hard drives are slow.

ZFS also uses ditto blocks to replicate the more important parts of the tree (i.e., the parts closer to the root), to further protect against corruption.

share|improve this answer
    
Just curious, but what is a "checksum", and what is "data integrity" supposed to mean? –  Kaitlyn Mcmordie Oct 27 '11 at 18:57
    
What other benefits does this configuration allow zfs to provide, compared to other filesystems? –  Kaitlyn Mcmordie Oct 27 '11 at 19:07
2  
Take "data integrity" at face value - making sure things don't get changed or corrupted, basically. As for a checksum, that's basically a hash taken of a file to verify it matches what you expect (no transcription errors or damage or anything). This is a pretty important concept, so get familiar with it. en.wikipedia.org/wiki/Checksum –  Shinrai Oct 27 '11 at 20:10
    
To add to @Shinrai's comment, ZFS actually allows you use either a Fletcher checksum (computationally cheap) or a SHA-2 hash (more secure, i.e., less chance of false match, but more CPU intensive). –  sblair Oct 27 '11 at 20:42
    
I have to admit, I'm the bad kind of computer geek who couldn't care less about *NIX anything, let alone Solaris! (I'm a hardware guy mostly, I guess), so I'm not that familiar with ZFS...but it's a pretty neat implementation now that I get to looking. –  Shinrai Oct 27 '11 at 22:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.