Chapter 8. ZFS Advanced Topics

Table of Contents

Emulated Volumes
Emulated Volumes as Swap or Dump Devices
Using ZFS on a Solaris System With Zones Installed
Adding ZFS File Systems to a Non-Global Zone
Delegating Datasets to a Non-Global Zone
Adding ZFS Volumes to a Non-Global Zone
Using ZFS Storage Pools Within a Zone
Property Management Within a Zone
Understanding the zoned Property
ZFS Alternate Root Pools
Creating ZFS Alternate Root Pools
Importing Alternate Root Pools
ZFS Rights Profiles

Emulated Volumes

An emulated volume is a dataset that represents a block device and can be used like any block device. ZFS volumes are identified as devices in the /dev/zvol/{dsk,rdsk}/path directory.

In the following example, 5-Gbyte 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. The reservation size continues to equal the 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.

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 create or clone a volume from within a non-global zone will fail. For information about using ZFS volumes in a global zone, see Adding ZFS Volumes to a Non-Global Zone.

Emulated Volumes as Swap or Dump Devices

To set up a swap area, create a ZFS volume of a specific size and then enable swap on that device. Do not swap to a file on a ZFS file system. A ZFS swap file configuration is not supported.

In the following example, the 5-Gbyte tank/vol volume is added as a swap device.

# swap -a /dev/zvol/dsk/tank/vol
# swap -l
swapfile                 dev  swaplo blocks   free
/dev/dsk/c0t0d0s1      32,33      16 1048688  1048688
/dev/zvol/dsk/tank/vol 254,1      16 10485744 10485744

Using a ZFS volume as a dump device is not supported. Use the dumpadm command to set up a dump device.