3 ms·
> Imagine an inode filled with all zeroes for example, tons of files have large segments that are all zeroes, what if they all get deduped and point to the same
by mustache_kimono 3y ago
> Imagine an inode filled with all zeroes for example, tons of files have large segments that are all zeroes, what if they all get deduped and point to the same inode when the identical bytes are >= the inode size?
Transparent compression of ZFS handles trivial cases like this quite easily. It even has a 'zle' (Zero Length Encoding) compression mode expressly for such, blocks with all zeros only, instances. Although, of course, the default 'lz4' compression should cover such trivial instances equally well.
> I've always wondered why file systems don't have a dedupe feature similar to defragment.
Because dedup is enormously expensive to do in the otherwise non-trivial cases. ZFS can do it live, and it requires an in memory hash table to track each deduped block. Which, if you imagine a ZFS filesystem with a recordsize of 8K or 16K blocks, this can be enormously RAM intensive. btrfs supposedly does dedup with less overhead(?), but I'd be interested to hear about instance where the combination of compression and filesystem clones isn't more practical.
- _8j50 3y agoThanks, TIL!