Using a ZFS Volume as a Swap or Dump Device

During an installation of a ZFS root file system or a migration from a UFS root file system, a swap device and a dump device are created on a ZFS volume in the ZFS root pool.

A ZFS volume that is used as a swap device is always encrypted regardless of the ZFS volume's encryption property value. Encryption is performed by using ephemeral keys that are generated automatically by the system. These ephemeral keys do not require that you set them or manage them.

The following examples show how to display information about the swap device and the dump device.

$ swap -l
swapfile                     dev    swaplo   blocks     free
/dev/zvol/dsk/rpool/swap   253,3        16  8257520  8257520

$ dumpadm
Dump content: kernel pages
Dump device: /dev/zvol/dsk/rpool/dump (dedicated)
Savecore directory: /var/crash/
Savecore enabled: yes

If you need to change your swap area or dump device after the system is installed, use the swap and dumpadm commands as in previous Oracle 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:

$ zfs create -V 2G rpool/swap2
$ swap -a rpool/swap2
$ swap -l
swapfile                      dev  swaplo  blocks    free
/dev/zvol/dsk/rpool/swap    256,1      16 2097136 2097136
/dev/zvol/dsk/rpool/swap2   256,5      16 4194288 4194288

Using files for swap or dump is not supported.

For information about adjusting the size of the swap and dump volumes, see Adjusting the Sizes of ZFS Swap and Dump Devices.