TrueNASGuide
Isometric comparison of datasets as filesystem folders on one side and zvols as virtual block devices on the other
zfs-fundamentals

TrueNAS Datasets vs Zvols: When to Use Which

A dataset is a filesystem; a zvol is a virtual block device. How they differ on TrueNAS, what recordsize and volblocksize mean, and which to create for SMB shares, apps, VMs, and iSCSI.

By TrueNASGuide Editorial · · 8 min read

When you carve up a ZFS pool on TrueNAS, you create one of two things inside it: a dataset or a zvol. They sound interchangeable and the UI presents them side by side, but they are fundamentally different objects, and choosing wrong means either awkward sharing or poor performance. This guide explains the difference and gives you a clear rule for each common use case.

The core difference

A dataset is a filesystem. It holds files and folders, it’s what you point SMB and NFS shares at, and ZFS manages the files inside it — permissions, snapshots, compression, and concurrent access by multiple clients. When you want “a place to store and share files,” you want a dataset. Datasets are also how you organize a pool: you nest them to apply different settings (compression, snapshot schedules, quotas) to different kinds of data.

A zvol is a virtual block device. It presents as a raw, unformatted disk. ZFS doesn’t manage files inside it — something else formats it (NTFS, ext4, VMFS) and owns the filesystem. A zvol is what you export over iSCSI, or hand to a VM as a virtual disk. It’s by definition meant for a single consumer that treats it like a local drive.

A useful mental model: a dataset is a shared folder TrueNAS manages; a zvol is a disk TrueNAS lends out and the client manages.

recordsize vs volblocksize

This is the parallel that confuses people, and it matters for performance.

  • Datasets have a recordsize — the maximum logical block size, default 128K. It’s dynamic: ZFS uses up to recordsize but writes smaller records for smaller files. Because it’s a ceiling, the default is fine for most file workloads, and you only raise it (e.g., 1M) for large sequential media or lower it for specific small-random workloads.
  • Zvols have a volblocksize — the block size of the virtual device, which on current TrueNAS defaults to 16K. Unlike recordsize, volblocksize is fixed and chosen at creation; it does not adapt. You match it to the consumer’s I/O pattern up front: smaller (8-16K) for database/VM random I/O, larger for sequential. You cannot change volblocksize later without destroying and recreating the zvol — so decide before you write data.

The headline: volblocksize is to a zvol what recordsize is to a dataset, but recordsize is a flexible ceiling while volblocksize is a hard, permanent choice.

When to use a dataset

Create a dataset when:

  • You’re setting up an SMB or NFS share — file sharing always points at a dataset. See SMB shares setup.
  • You’re storing app/container data on TrueNAS SCALE — create per-app datasets so backup and snapshots are clean (covered in the SCALE apps guide).
  • You want to organize the pool and apply different compression, quotas, or snapshot policies to different data types.
  • You’re storing VM disk files (qcow2/raw on a filesystem) and want them visible and snapshottable at the file level — many homelabs prefer this over zvols for simplicity.

Datasets are the default answer for the overwhelming majority of home NAS use. If you’re not sure, you almost certainly want a dataset.

When to use a zvol

Create a zvol when:

  • You’re exporting iSCSI block storage — an iSCSI target is backed by a zvol. See iSCSI vs NFS vs SMB.
  • A VM needs a raw block device rather than a disk file (some hypervisor setups, or when you want the VM to own the filesystem directly).
  • An application specifically wants raw, unformatted block storage.

Zvols are the specialist tool: block storage for a single consumer. Reach for one only when something genuinely needs a disk rather than a folder.

A common mistake

Don’t create a zvol because you “want a disk for backups” and then struggle to share it — a zvol exported over iSCSI is single-client and the client owns the filesystem, so it’s the wrong tool for multi-device file storage. If several machines need to drop backups onto the NAS, that’s a dataset with an SMB/NFS share. Conversely, don’t try to put a VM’s raw block disk on an SMB share and wonder about performance — block workloads want a zvol (or at least a tuned dataset holding disk files).

Another: leaving a zvol’s volblocksize at default when hosting a database with a known page size. Because it’s fixed at creation, mismatched volblocksize causes read/write amplification you can’t fix without rebuilding the zvol. Decide the block size against the workload first.

Quick reference

Use caseCreate a…Notes
SMB / NFS file shareDatasetDefault for file sharing
TrueNAS SCALE app dataDatasetOne per app for clean backups
VM disk as a file (qcow2/raw)DatasetSimpler, file-level snapshots
iSCSI targetZvolSet volblocksize for the workload
VM raw block deviceZvolSingle consumer owns the FS
Database needing raw blockZvolMatch volblocksize to page size

Next steps

See also

Related

Comments