Home ยท Volume 1 ยท Chapter 04

๐Ÿ“– Chapter 04 โ€” Datasets

The most important concept in the system. Smart folders with their own rules.

v0.1 ยท draft Vol 1 ยท Ch 04
~12 min

Learning Objectives

Introduction

If you remember nothing else from this volume, remember this: datasets are the most important concept in ZFS. Not pools, not vdevs, not RAIDZ2 โ€” datasets. The reason a ZFS system feels modern and a regular Windows share doesn't is almost entirely because of datasets.

Once you have the dataset model in your head, every question about "where do I put X" or "who can see Y" gets easier.

What a dataset is

A dataset is a folder inside a pool, but it has its own:

That list is the entire reason datasets exist. A regular folder can't do any of that. A dataset can do all of it, independently for every dataset you create.

The slogan

Dataset = Folder with superpowers.

Datasets vs folders vs nested folders

This is the most common design question. When do you make a new dataset, and when do you just make a regular folder inside an existing one?

Rule of thumb from the conversation:

For TK's family NAS, the rule "make a dataset when the rules differ" produces this design:

tank โ† pool โ”œโ”€โ”€ Family โ† dataset: everyone has access โ”œโ”€โ”€ Photos โ† dataset: everyone has access โ”œโ”€โ”€ Videos โ† dataset: everyone has access โ”œโ”€โ”€ Documents โ† dataset: everyone has access โ”œโ”€โ”€ Private โ† dataset: shared by TK + spouse โ”‚ โ”œโ”€โ”€ Tom โ† dataset: only Tom โ”‚ โ”œโ”€โ”€ Mimi โ† dataset: only Mimi โ”‚ โ””โ”€โ”€ (Lai) โ† dataset: only Lai โ”œโ”€โ”€ Apps โ† dataset: app data, no user access โ”œโ”€โ”€ Media โ† dataset: video production โ”‚ โ”œโ”€โ”€ Active โ† dataset: current work, fast โ”‚ โ””โ”€โ”€ Archive โ† dataset: completed projects โ””โ”€โ”€ Lab โ† dataset: VMs and testing

Notice the deliberate choices:

Compression

Compression is "essentially free on modern CPUs." Leave it on. Use lz4 for almost everything.

The decision is: just enable lz4 on every dataset you create. Move on.

Quotas and reservations

Two related concepts that work in opposite directions:

For TK's build, the conversation recommends:

Encryption

Datasets can be encrypted at rest. The bytes are scrambled on the drives; even someone who physically steals the drives can't read the data without the key.

For most home NAS setups, encryption is optional but increasingly recommended:

TrueNAS lets you set encryption per dataset. You can encrypt the whole pool (encrypts every dataset in it), or encrypt specific datasets (the rest are unencrypted). The conversation recommends per-dataset encryption for the most sensitive data (the `Private` family datasets) and leaving shared data unencrypted for simplicity.

Common mistake

Enabling encryption and not backing up the key. If the system disk dies and you didn't export the key, every encrypted dataset is permanently lost. Always back up encryption keys to a separate location (a password manager, a USB drive stored elsewhere, a printed paper in a safe).

Permissions โ€” preview

Datasets are where permissions get interesting. Each dataset has its own owner, group, and permission bits. Chapter 07 covers this in detail; for now, just know that when you create a dataset, you'll be asked "who owns this and what can they do?" and your answer is per-dataset.

The PhoneUploads pattern (revisited)

From earlier in the conversation, the recommended pattern for phone uploads:

tank โ””โ”€โ”€ PhoneUploads โ† separate dataset, short retention โ”œโ”€โ”€ Tom โ† per-user subdataset, quota โ”œโ”€โ”€ Mimi โ””โ”€โ”€ Lai

Why this works:

TK decided not to use this pattern (manual uploads only) because he didn't want to use bandwidth on automatic junk. That's a valid call. The pattern is here so you can use it if your situation changes.

Snapshot retention per dataset

Datasets can have different snapshot policies. Here's the conversation's recommendation:

DatasetFrequencyRetentionWhy
Family / Photos / Videos / DocumentsHourly โ†’ Daily โ†’ Monthly48h / 30d / 12moFamily data, want long-term recovery
PhoneUploadsHourly7 daysStaging area, low-value, short retention
Private/*Daily90 daysPersonal data, but the user can usually re-create
AppsBefore each app update5 versionsApp data, snapshots for rollback on bad update
Media/ActiveBefore each significant change30 daysProject work, but actively changing
Media/ArchiveAfter each major editForeverFinished work, immutable, want history

Engineering Note

Datasets are the abstraction that makes ZFS extensible. When ZFS gets a new feature โ€” say, a new compression algorithm, or a new way to encrypt โ€” it shows up as a dataset property. You don't have to redesign your storage; you just change the property on the datasets that need it. The fact that pools, vdevs, and drives are below the dataset line means the dataset abstraction can keep evolving without forcing you to migrate your data.

This is why the conversation's volume roadmap opens with datasets (Volume 1, Chapter 4) rather than pools. The pool is the foundation. The dataset is the building you actually live in.

Summary

Datasets are smart folders. They have their own permissions, compression, snapshots, quotas, reservations, encryption, and replication. The rule for when to make a new dataset: when the rules differ. Use lz4 compression everywhere. Use quotas to bound potentially-unbounded content (uploads, personal data, experiments). Encrypt sensitive data and back up the key. Per-dataset snapshot policies let you balance "long retention" against "lots of disk space" dataset by dataset.

Checklist

Looking Ahead

Chapter 05 covers SMB shares โ€” how Windows and Mac actually see your datasets. Datasets are a ZFS concept; SMB shares are the bridge from ZFS to the rest of the world.

Ch 04 ยท v0.1 ยท drafted from the original ChatGPT conversation, July 2026