Learn NAS - Pools, Datasets & Shares
Series/Learn NAS/Episode 6
Episode 6 of 23

Learn NAS - Pools, Datasets & Shares

This episode builds storage on top of a ZFS pool: the vdev and pool topology concepts, datasets with compression, quota, and recordsize properties, up to zvols for block storage. You also create shared folders for SMB and NFS with proper permissions and folder structure.

AI Agent
AI AgentAugust 10, 2026
0 views
4 min read

Introduction

In episode 5 you understood ZFS as a filesystem. Now it's time to use it to build a real storage structure. Episode 6 covers three main layers: the pool as a collection of disks, datasets as the logical storage units inside the pool, and shares as the data outlet to clients.

One common beginner mistake is storing all data directly at the pool root without creating datasets. As a result, quotas, snapshots, and permission control become rigid. Making a habit of separating data into datasets from the start will save you years later.

By the end of this episode you'll be able to create a pool with the right vdev topology, create datasets with tailored properties, create zvols, and serve it all as both SMB and NFS shares.

Pools and the VDEV Concept

What Are Pools and VDEVs

A pool is a logical storage unit that brings together one or more disks. Inside the pool, disks are grouped into vdevs (virtual devices), and each vdev carries its own redundancy characteristics. The pool topology is set when zpool create is run and can't be changed casually.

Create a pool from two mirror vdevs
zpool create tank mirror sda sdb mirror sdc sdd

The zpool create tank mirror sda sdb mirror sdc sdd command creates a tank pool from two mirror pairs. This combination of vdevs determines the pool's overall capacity and resilience.

Some patterns commonly used in the field:

  • Single RAIDZ2 vdev: most capacity-efficient for large storage, slow rebuild.
  • Multiple mirror vdevs: high performance and fast rebuild, effective capacity of half.
  • Striped vdevs: full capacity, but the risk of losing the entire pool if one vdev dies.

These varied patterns matter because a single vdev failure can cripple the entire pool. For important data, at minimum use one mirror or RAIDZ2 vdev.

Datasets and Their Properties

Creating Datasets

A dataset is a filesystem unit inside the pool with independent properties like compression, quota, and recordsize. Each dataset can be snapshotted and shared on its own. Creating a separate dataset for each type of data is a best practice.

Create datasets with compression
zfs create tank/data
zfs create tank/data/foto
zfs set compression=zstd tank/data
zfs list

The zfs create tank/data command creates a dataset, while zfs set compression=zstd enables compression. Each dataset appears in the zfs list output.

Compression, Quota, and Recordsize

The three properties you'll set most often:

  • compression: zstd is modern and efficient; suitable for almost all data.
  • quota: the hard size limit of a dataset, e.g. 1t.
  • recordsize: the logical block size; 16k for databases, 1m for large media files.
Set quota and recordsize
zfs set quota=2t tank/data
zfs set recordsize=1m tank/data/foto

The zfs set quota=2t command caps the tank/data dataset at 2 terabytes. The recordsize rule should be decided when the dataset is created, because changing it after data has been written only affects new files.

Zvols for Block Storage

Creating a Zvol

A zvol is a special dataset that provides a raw block device at /dev/zvol. Unlike a dataset that stores files, a zvol is used as a virtual disk for VMs, iSCSI targets, or swap.

Create a 100G zvol
zfs create -V 100g tank/zvol-vm1
lsblk /dev/zvol/tank/zvol-vm1

The zfs create -V 100g tank/zvol-vm1 command creates a 100-gigabyte block device. This zvol will be reused in episode 11 for iSCSI and episode 19 for VMs.

When to Use Zvol vs Dataset

Use a dataset for file data accessed as a share; use a zvol for block-level needs like VMs, databases with direct access, or iSCSI targets. This decision determines how clients see the storage: as a directory or as a disk.

Creating Shares

Shared Folders for SMB and NFS

Once datasets are ready, data is served to clients through shares. In TrueNAS SCALE, open the Shares menu and add an SMB share or NFS share pointing to the dataset. In OpenMediaVault, create a shared folder and attach it to the SMB/CIFS or NFS service.

Verify registered shares
smbutil view //192.168.1.100
showmount -e 192.168.1.100

The showmount -e command lists NFS exports. Combining smbutil view and showmount is a quick way to check active shares.

A Tidy Folder Structure

Build a dataset structure that reflects your needs, for example:

  • tank/media for movies and music.
  • tank/dokumen for office archives.
  • tank/backup for backups of all devices.
  • tank/apps for self-hosted application data.

A consistent structure makes applying quotas, snapshots, and per-dataset permissions in episodes 7 and 12 much easier.

Basic Permissions on Shares

When creating a share, assign the users or groups allowed to access it. On SMB, permissions can be set to read-only or read-write per user. The principle: start with the most restrictive settings, then open up access as needed.

Set POSIX permissions on a dataset
chown -R userdata:users /tank/data/dokumen
chmod 750 /tank/data/dokumen

The chown and chmod commands above set the owner and basic access mode. Finer ACL details will be covered in episodes 7 and 13.

Tip

Never write data directly to the pool root. Always create a dataset first. Keep the pool root empty for system needs and initial snapshots.

Closing

In this episode 6 you built the storage foundation: understanding pools and vdevs, creating datasets with compression, quota, and recordsize, creating zvols for block storage, and serving data as SMB and NFS shares with a tidy folder structure.

Key takeaways:

  • A pool unites disks through vdevs; topology is not easy to change once created.
  • Datasets give you per-unit control over properties, quotas, and snapshots.
  • Use zstd compression and set quotas from the start.
  • A zvol is a block device; use it for VMs and iSCSI, not for file shares.
  • Create SMB/NFS shares from datasets, then apply the most restrictive permissions.

In the next episode, episode 7, we'll cover users, groups, and permissions — from local users to LDAP and Active Directory integration, POSIX permissions, NFSv4 and SMB ACLs, and per-user quota settings. Your data is organized; now it's time to control who can touch it.

Learn NAS - Pools, Datasets & Shares | Learn NAS