ZFS Volumes

A ZFS volume is a dataset that represents a block device. ZFS volumes
are identified as devices in the /dev/zvol/{dsk,rdsk}/pool directory.

In the following example, a 5-GB ZFS volume, tank/vol,
is created:

# zfs create -V 5gb tank/vol

When you create a volume, a reservation is automatically set to the
initial size of the volume so that unexpected behavior doesn't occur. For
example, if the size of the volume shrinks, data corruption might occur. You
must be careful when changing the size of the volume.

In addition, if you create a snapshot of a volume that changes in size,
you might introduce inconsistencies if you attempt to roll back the snapshot
or create a clone from the snapshot.

For information about file system properties that can be applied to
volumes, see Table 6–1.

If you are using a Solaris system with zones installed, you cannot create
or clone a ZFS volume in a non-global zone. Any attempt to do so will fail.
For information about using ZFS volumes in a global zone, see Adding ZFS Volumes to a Non-Global Zone.

Using a ZFS Volume as a Swap or Dump Device

During installation of a ZFS root file system or a migration from a
UFS root file system, a swap device is created on a ZFS volume in the ZFS
root pool. For example:

During installation of a ZFS root file system or a migration from a
UFS root file system, a dump device is created on a ZFS volume in the ZFS
root pool. The dump device requires no administration after it is set up.
For example:

If you need to change your swap area or dump device after the system
is installed or upgraded, use the swap and dumpadm commands
as in previous Solaris releases. If you need to create an additional swap
volume, create a ZFS volume of a specific size and then enable swap on that
device. For example:

Solaris iSCSI targets can also be created and managed with the iscsitadm command. If you set the shareiscsi property
on a ZFS volume, do not use the iscsitadm command to also
create the same target device. Otherwise, you create duplicate target information
for the same device.

A ZFS volume as an iSCSI target is managed just like any other ZFS dataset.
However, the rename, export, and import operations work a little differently for iSCSI targets.

When you rename a ZFS volume, the iSCSI target name remains
the same. For example: