Pcornel
Storage · ZFS

Zvol

Cheat sheet · https://pcornel.dk/topic.php?topic=4013

Back to the Topic

Answer

A zvol is a ZFS dataset of type volume that presents a block device instead of a mounted ZFS filesystem. It has properties such as volsize and volblocksize, and its upper consumer may add another partition, filesystem, database or virtual-disk layer. ZFS snapshots/checksums protect the zvol blocks, not the semantic consistency of the filesystem or application inside them.

Remember

  • Zvol ≠ filesystem.
  • volsize ≠ used guest/application data.
  • Zvol snapshot ≠ application-consistent backup by default.
  • volblocksize choice ≠ workload block size at every upper/lower layer.

First checks

  • zfs list -t volume -o name,volsize,used,refreservation — zvols
  • ls -l /dev/zvol/<pool>/ — device nodes
  • zfs get volblocksize <zvol> — block size

Verify in this order

block I/O → zvol → pool

Where it usually breaks

First mismatch in member media → metadata/layout → allocation/placement → redundancy/recovery → logical object → consumer; preserve identity/pre-state before mutation.

ZFS → Zvol ZFS map

ZFS boundaryWhat to verifyProof limit
Identity / topologyPool GUID/name, dataset/zvol, top-level vdev class, leaf-device identity and effective propertiesObject presence alone does not prove integrity, performance or recovery
Capacity / protectionPool free space, quotas/reservations, snapshot retention, redundancy and active scrub/resilver stateFree space or ONLINE state at one layer does not prove end-to-end health
Failure boundaryA present writable zvol proves ZFS can expose and service the tested block device; it does not prove the upper filesystem/application is consistent or correctly resized.Correlate ZFS evidence with both workload and lower device/path evidence
AcceptanceHealthy evidence: the intended zvol has expected size/properties, pool capacity and vdev health are sound, and representative consumer I/O completes without unexplained checksum or latency symptoms.Close only after original workload plus checksum/read-back/recovery verification succeeds

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4013

Confirmation

Confirm action

Continue?