User Tools

Site Tools


zfs:dataset

ZFS Datasets

A dataset is a child filesystem of the parent pool, or parent dataset.

This may seem confusing at first. Let me explain.

Imagine that the pool were a whole hard drive. With most filesystems, you create a single, disk-sized partition, and then format the partition with the filesystem. But, sometimes you want to do different things where it would be useful to have multiple independent filesystems. Well, then you have to erase and redo your partition structure to fit more partitions, and thus more filesystems. Or, more hazardous, and more time consuming, use a tool to resize the filesystems, resize the partitions, and then create the new filesystems.

With datasets in ZFS, all these partitioning concerns are unnecessary. A dataset acts like another mounted partition with no locked-in size. The quantity of disk space it takes up is only as much space as you use in populating it, or children of it. You don't have to worry about resizing partitions or anything. ZFS transparently handles all that for you.

Additionally, each dataset can have its own special configuration by modifying different behavioral variables.

For example:

  • If a dataset will mostly be text/logs/documents, it would be useful to use lz4 as compression.
  • If access-time records are unnecessary, you can disable atime for the dataset.
  • If a dataset will be for reference only, and modifications should never happen, you can use “readonly=on” to prevent all writes to the dataset.
  • If a dataset will hold a small quantity of data, but you want the data to be a little more damage resistant, you can use “copies=2” or “copies=3” to help prevent damage to the data.

These are just a few of the behaviors that are controllable on the dataset level.

ZFS Dataset Variables

Back to ZFS

zfs/dataset.txt · Last modified: 2018/07/08 16:29 (external edit)